Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Translucent icons in ActionBar when disabled: only on my phone?

I'm using ActionBarSherlock on my app and when I disable some MenuItem in the ActionBar the icon turns translucent on my phone (HTC One X running stock Android 4.0.4) but I haven't seen this behavior in any other phone or emulator.

Am I right in assuming this behavior is not the default one for the native ActionBar? I like the idea though... It warns the user that the MenuItem is not enabled for some reason (in my case, it's a save button and if at least one field is not filled, it disables the button).

I was thinking in providing myself a translucent icon and set it manually when the MenuItem is disabled. This will work on every Android version, native ActionBar or not. The problem is that on my phone (or any other with the same behavior for that matter), it will be twice as translucent and I don't want that.

Any ideas on how can I properly achieve this effect?

like image 921
rfgamaral Avatar asked Nov 12 '22 19:11

rfgamaral


1 Answers

I think that the problem is on the Theme, you are applying the default theme. So, HTC override default theme resources, i think you have to create a custom theme and change the item_background to the default one on sdk resources.

<item name="selectableItemBackground">@android:drawable/item_background</item>
like image 196
Anis BEN NSIR Avatar answered Nov 15 '22 12:11

Anis BEN NSIR