Grey out settings icon when it is in disabled state
If engine is not active, its settings icon is disabled in
Settings > Language & input > Text-to-speech output screen.
Currently, settings icons for all TTS engines are shown at
the same opacity. This fix dims settings icons of not-selected
engines.
Make sure that more than one TTS engine are installed on the
target, for e.g., Google Text-to-speech Engine and Classic
Text To Speech Engine (SVOX Classic TTS).
Additionally, since setAlpha() is used in multiple places within
Settings package, moved DISABLED_ALPHA declaration to Utils.java
in order to have single point of reference.
Change-Id: Ifa7de79814a2f4a4aa021cd8621cbfab41655680
Signed-off-by: Shuhrat Dehkanov <uzbmaster@gmail.com>
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index 6d76bed..4b0a753 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -80,6 +80,11 @@
public static final int UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY = 1;
/**
+ * The opacity level of a disabled icon.
+ */
+ public static final float DISABLED_ALPHA = 0.4f;
+
+ /**
* Name of the meta-data item that should be set in the AndroidManifest.xml
* to specify the icon that should be displayed for the preference.
*/