* commit '004970da50ddbce80321b50536625e149ff1f825': Grey out settings icon when it is in disabled state
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user