I have use class RadioButtonCenter at
It worked good in below API 24. But in API 24, It not display correct.
when i click tab new. tab old always active. When I intent to activity diff and back. It display correct.
I did not find the problem. Please. Help me!
This is xml
<RadioGroup
android:id="@+id/bottom_navigation_on_main"
android:layout_width="match_parent"
android:layout_height="@dimen/item_height"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:weightSum="4">
<RadioButtonCenter
android:id="@+id/tab_home"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/selector_tab_main"
android:button="@null"
android:clickable="true"
android:gravity="center"
app:radioDrawable="@drawable/selector_tab_home" />
<RadioButtonCenter
android:id="@+id/tab_search"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:button="@null"
android:clickable="true"
android:background="@drawable/selector_tab_main"
android:gravity="center"
app:radioDrawable="@drawable/selector_tab_search" />
</RadioGroup>
This is selector
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_home_on" android:state_checked="true"
/>
<item android:drawable="@drawable/ic_home_on" android:state_activated="true"
/>
<item android:drawable="@drawable/ic_home_off" />
</selector>