android - Change ActionBar pressed elements overlay -
android - Change ActionBar pressed elements overlay -
i can't find way alter overlay color on actionbar items when press on them. have minsdk = 11 , can't utilize
<item name="android:actionbaritembackground">@drawable/selectable_background_</item>
because works api 14.
i created values-v14 folder style.xml file, , devices >= v.14 works in way:
not pressed: pressed:
but, how can same version >= 11 < 14 ?
this style.xml file:
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="appbasetheme" parent="theme.appcompat.light.darkactionbar"> </style> <!-- actionbar styles --> <style name="myactionbar" parent="@style/widget.appcompat.light.actionbar.solid.inverse"> <item name="android:background">@color/brand_color</item> </style> <!-- application theme. --> <style name="apptheme" parent="appbasetheme"> <item name="android:actionbarstyle">@style/myactionbar</item> </style> </resources>
in file changed actionbar background color, can't figure out how alter overlay color on pressed items. can help me?
here how can alter color of pressed items. add together 2 actionbuttonstyle
items style in values , should work on versions (with app compat). replace @drawable/selector
own drawable action buttons.
<style name="apptheme" parent="theme.appcompat.light.darkactionbar"> <item name="android:selectableitembackground">@drawable/selector</item> <item name="selectableitembackground">@drawable/selector</item> </style>
example @drawable/selector
:
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="#ddffffff" /> <item android:drawable="@android:color/transparent" /> </selector>
android android-actionbar appcompat
Comments
Post a Comment