Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion ABS menu icons: setEnabled(false)

Date: Tue, 19 Jun 2012 17:15:46 -0700 (PDT)
From: Nobu Games <dev.nobu.ga...@gmail.com>
To: actionbarsherlock@googlegroups.com
Message-Id: <92c04d38-fc08-48bf-9af7-2e0084424825@googlegroups.com>
In-Reply-To: <7d3ded77-0fba-4f0b-a3f4-aa2c7f2c93f1@googlegroups.com>
References: <7d3ded77-0fba-4f0b-a3f4-aa2c7f2c93f1@googlegroups.com>
Subject: Re: ABS menu icons: setEnabled(false)
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1220_5796895.1340151346956"

------=_Part_1220_5796895.1340151346956
Content-Type: multipart/alternative; 
	boundary="----=_Part_1221_19899264.1340151346956"

------=_Part_1221_19899264.1340151346956
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The Android design guidelines<http://developer.android.com/design/style/iconography.html>for iconography say that disabled action bar icons should have an opacity 
of 30% (as opposed to enabled state with opacity 60% for the dark theme or 
80% for the light theme). The guidelines also state that action bar icons 
should be either a specific shade of gray or white (and not colored).

For coping with that issue I'm using following workaround:

menuItem.getIcon().setAlpha(enabled ? 255 : 64);
>

255 in case of enabled because my icon graphics already have the required 
opacity of 60%.
64 for the disabled icon state because it looked best in my case (using a 
light theme).

Actually I was expecting that there is some default behavior that takes 
care of that automatically. But I'm getting the impression that Google 
simply lets some room for individual theme customizations that have nothing 
much in common with the guidelines - like for example colored action bar 
items and different disabled state looks.

------=_Part_1221_19899264.1340151346956
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

The <a href=3D"http://developer.android.com/design/style/iconography.html">=
Android design guidelines</a> for iconography say that disabled action bar =
icons should have an opacity of 30% (as opposed to enabled state with opaci=
ty 60% for the dark theme or 80% for the light theme). The guidelines also =
state that action bar icons should be either a specific shade of gray or wh=
ite (and not colored).<br><br>For coping with that issue I'm using followin=
g workaround:<br><br><blockquote style=3D"margin: 0px 0px 0px 0.8ex; border=
-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class=3D"gmail_quo=
te">menuItem.getIcon().setAlpha(enabled ? 255 : 64);<br></blockquote><div><=
br>255 in case of enabled because my icon graphics already have the require=
d opacity of 60%.<br>64 for the disabled icon state because it looked best =
in my case (using a light theme).<br><br>Actually I was expecting that ther=
e is some default behavior that takes care of that automatically. But I'm g=
etting the impression that Google simply lets some room for individual them=
e customizations that have nothing much in common with the guidelines - lik=
e for example colored action bar items and different disabled state looks.<=
br></div>
------=_Part_1221_19899264.1340151346956--

------=_Part_1220_5796895.1340151346956--