diff options
author | Amith Yamasani <yamasani@google.com> | 2012-12-12 09:57:37 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-12-12 09:57:37 -0800 |
commit | 9a03c8cfb22c79090d2291d64899a7e4234bd79b (patch) | |
tree | 9678c3dd060135d464198467f937c92fba96d9d8 /src/com/android/settings/tts | |
parent | 96a06f79be5db67c766790aefb019f5bb094c349 (diff) | |
parent | 004970da50ddbce80321b50536625e149ff1f825 (diff) | |
download | packages_apps_Settings-9a03c8cfb22c79090d2291d64899a7e4234bd79b.zip packages_apps_Settings-9a03c8cfb22c79090d2291d64899a7e4234bd79b.tar.gz packages_apps_Settings-9a03c8cfb22c79090d2291d64899a7e4234bd79b.tar.bz2 |
am 004970da: am 0df6a277: Merge "Grey out settings icon when it is in disabled state"
* commit '004970da50ddbce80321b50536625e149ff1f825':
Grey out settings icon when it is in disabled state
Diffstat (limited to 'src/com/android/settings/tts')
-rw-r--r-- | src/com/android/settings/tts/TtsEnginePreference.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/settings/tts/TtsEnginePreference.java b/src/com/android/settings/tts/TtsEnginePreference.java index 80c4ac7..486fdf8 100644 --- a/src/com/android/settings/tts/TtsEnginePreference.java +++ b/src/com/android/settings/tts/TtsEnginePreference.java @@ -33,6 +33,7 @@ import android.widget.RadioButton; import com.android.settings.R; +import com.android.settings.Utils; public class TtsEnginePreference extends Preference { @@ -141,6 +142,9 @@ public class TtsEnginePreference extends Preference { // Will be enabled only the engine has passed the voice check, and // is currently enabled. mSettingsIcon.setEnabled(isChecked && mVoiceCheckData != null); + if (!isChecked) { + mSettingsIcon.setAlpha(Utils.DISABLED_ALPHA); + } mSettingsIcon.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -174,7 +178,12 @@ public class TtsEnginePreference extends Preference { // case mSettingsIcon && mRadioButton will be null. In this case // getView will set the right values. if (mSettingsIcon != null && mRadioButton != null) { - mSettingsIcon.setEnabled(mRadioButton.isChecked()); + if (mRadioButton.isChecked()) { + mSettingsIcon.setEnabled(true); + } else { + mSettingsIcon.setEnabled(false); + mSettingsIcon.setAlpha(Utils.DISABLED_ALPHA); + } } } |