Sachin Malik
Sachin Malik

Reputation: 129

Radio button inside Remote view

I have a radio button inside the remote view of android. Upon clicking the layout of the radio button, it is getting selected but no animation or ripple effect is being shown. How to show the default check animation.

<RadioButton
    android:id="@+id/radio_dolby_level1"
    style="@style/tile_preset_effect_radio_button" />

this is the style

<style name="tile_preset_effect_radio_button" parent="@android:style/Widget.DeviceDefault.Light.CompoundButton.RadioButton">
    <item name="android:layout_width">wrap_content</item>
    <item name="android:layout_height">wrap_content</item>
    <item name="android:layout_marginStart">24dp</item>
    <item name="android:background">@null</item>
    <item name="android:focusable">false</item>
    <item name="android:clickable">false</item>
</style>

and this is how I am checking the radio button

mRemoteViews.setBoolean(getDolbyTileRadioId(mDolbyValue), "setChecked", true);

Upvotes: 0

Views: 186

Answers (1)

aminography
aminography

Reputation: 22832

You can't use a RadioButton in a RemoteViews. RemoteViews is limited to support some layouts and widgets:

https://developer.android.com/reference/android/widget/RemoteViews

An important point is that descendants of supporting classes are not supported.

Upvotes: 1

Related Questions