android - How to add press effect or selector indicator to astuetz/PagerSlidingTabStrip? -
i used astuetz library , implemented pagerslidingtabstrip android application, it's working find. want change pressing effect, tried:
android:background="@drawable/tab_selecor"
code tab selector:
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/darkgreen" android:state_focused="true" android:state_pressed="true" /> <item android:drawable="@color/darkgreen" android:state_focused="false" android:state_pressed="true" /> <item android:drawable="@color/green" /> </selector>
the press colour suppose changed dark green see not change, still looks if use colour red, yellow, .... .
make use of setindicatorcolor() setting color of indicator , setindicatorheight() setting height
and make use of settabbackground() method set background tab
use drawable tab background
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- active tab --> <item android:state_selected="true" android:state_focused="false" android:state_pressed="false" android:drawable="@color/red" /> <!-- inactive tab --> <item android:state_selected="false" android:state_focused="false" android:state_pressed="false" android:drawable="@android:color/black" /> <!-- pressed tab --> <item android:state_pressed="true" android:drawable="@android:color/transparent" /> <!-- selected tab (using d-pad) --> <item android:state_focused="true" android:state_selected="true" android:state_pressed="false" android:drawable="@android:color/transparent" /> </selector>
Comments
Post a Comment