Merge "Typos in CheckBoxAndSettingsPreference"
This commit is contained in:
committed by
Android (Google) Code Review
commit
5aa7a15706
@@ -34,8 +34,7 @@ public class CheckBoxAndSettingsPreference extends CheckBoxPreference {
|
|||||||
private SettingsPreferenceFragment mFragment;
|
private SettingsPreferenceFragment mFragment;
|
||||||
private TextView mTitleText;
|
private TextView mTitleText;
|
||||||
private TextView mSummaryText;
|
private TextView mSummaryText;
|
||||||
private View mCheckBox;
|
private ImageView mSettingsButton;
|
||||||
private ImageView mSetingsButton;
|
|
||||||
private Intent mSettingsIntent;
|
private Intent mSettingsIntent;
|
||||||
|
|
||||||
public CheckBoxAndSettingsPreference(Context context, AttributeSet attrs) {
|
public CheckBoxAndSettingsPreference(Context context, AttributeSet attrs) {
|
||||||
@@ -47,28 +46,28 @@ public class CheckBoxAndSettingsPreference extends CheckBoxPreference {
|
|||||||
@Override
|
@Override
|
||||||
protected void onBindView(View view) {
|
protected void onBindView(View view) {
|
||||||
super.onBindView(view);
|
super.onBindView(view);
|
||||||
mCheckBox = view.findViewById(R.id.inputmethod_pref);
|
View textLayout = view.findViewById(R.id.inputmethod_pref);
|
||||||
mCheckBox.setOnClickListener(
|
textLayout.setOnClickListener(
|
||||||
new OnClickListener() {
|
new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View arg0) {
|
public void onClick(View arg0) {
|
||||||
onCheckBoxClicked();
|
onCheckBoxClicked();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mSetingsButton = (ImageView)view.findViewById(R.id.inputmethod_settings);
|
|
||||||
|
mSettingsButton = (ImageView) view.findViewById(R.id.inputmethod_settings);
|
||||||
mTitleText = (TextView)view.findViewById(android.R.id.title);
|
mTitleText = (TextView)view.findViewById(android.R.id.title);
|
||||||
mSummaryText = (TextView)view.findViewById(android.R.id.summary);
|
mSummaryText = (TextView)view.findViewById(android.R.id.summary);
|
||||||
mSetingsButton.setOnClickListener(
|
mSettingsButton.setOnClickListener(
|
||||||
new OnClickListener() {
|
new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View arg0) {
|
public void onClick(View clickedView) {
|
||||||
onSettingsButtonClicked(arg0);
|
onSettingsButtonClicked();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
enableSettingsButton();
|
enableSettingsButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
super.setEnabled(enabled);
|
super.setEnabled(enabled);
|
||||||
@@ -88,23 +87,23 @@ public class CheckBoxAndSettingsPreference extends CheckBoxPreference {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onSettingsButtonClicked(View arg0) {
|
protected void onSettingsButtonClicked() {
|
||||||
if (mFragment != null && mSettingsIntent != null) {
|
if (mFragment != null && mSettingsIntent != null) {
|
||||||
mFragment.startActivity(mSettingsIntent);
|
mFragment.startActivity(mSettingsIntent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enableSettingsButton() {
|
private void enableSettingsButton() {
|
||||||
if (mSetingsButton != null) {
|
if (mSettingsButton != null) {
|
||||||
if (mSettingsIntent == null) {
|
if (mSettingsIntent == null) {
|
||||||
mSetingsButton.setVisibility(View.GONE);
|
mSettingsButton.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
final boolean checked = isChecked();
|
final boolean checked = isChecked();
|
||||||
mSetingsButton.setEnabled(checked);
|
mSettingsButton.setEnabled(checked);
|
||||||
mSetingsButton.setClickable(checked);
|
mSettingsButton.setClickable(checked);
|
||||||
mSetingsButton.setFocusable(checked);
|
mSettingsButton.setFocusable(checked);
|
||||||
if (!checked) {
|
if (!checked) {
|
||||||
mSetingsButton.setAlpha(DISABLED_ALPHA);
|
mSettingsButton.setAlpha(DISABLED_ALPHA);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user