Merge "Update language to comply with Android's inclusive language guidance"

This commit is contained in:
TreeHugger Robot
2020-08-12 08:19:06 +00:00
committed by Android (Google) Code Review
10 changed files with 47 additions and 65 deletions

View File

@@ -37,8 +37,8 @@ public class ProfileSelectLocationFragment extends ProfileSelectFragment {
super.onActivityCreated(savedInstanceState);
final SettingsActivity activity = (SettingsActivity) getActivity();
final SwitchBar switchBar = activity.getSwitchBar();
switchBar.setSwitchBarText(R.string.location_settings_master_switch_title,
R.string.location_settings_master_switch_title);
switchBar.setSwitchBarText(R.string.location_settings_primary_switch_title,
R.string.location_settings_primary_switch_title);
final LocationSwitchBarController switchBarController = new LocationSwitchBarController(
activity, switchBar, getSettingsLifecycle());
switchBar.show();

View File

@@ -83,8 +83,8 @@ public class AutomaticStorageManagerSettings extends DashboardFragment
private void initializeSwitchBar() {
final SettingsActivity activity = (SettingsActivity) getActivity();
mSwitchBar = activity.getSwitchBar();
mSwitchBar.setSwitchBarText(R.string.automatic_storage_manager_master_switch_title,
R.string.automatic_storage_manager_master_switch_title);
mSwitchBar.setSwitchBarText(R.string.automatic_storage_manager_primary_switch_title,
R.string.automatic_storage_manager_primary_switch_title);
mSwitchBar.show();
mSwitchController =
new AutomaticStorageManagerSwitchBarController(

View File

@@ -93,8 +93,8 @@ public class SpellCheckersSettings extends SettingsPreferenceFragment
super.onResume();
mSwitchBar = ((SettingsActivity) getActivity()).getSwitchBar();
mSwitchBar.setSwitchBarText(
R.string.spell_checker_master_switch_title,
R.string.spell_checker_master_switch_title);
R.string.spell_checker_primary_switch_title,
R.string.spell_checker_primary_switch_title);
mSwitchBar.show();
mSwitchBar.addOnSwitchChangeListener(this);
updatePreferenceScreen();

View File

@@ -71,8 +71,8 @@ public class LocationSettings extends DashboardFragment {
super.onActivityCreated(savedInstanceState);
final SettingsActivity activity = (SettingsActivity) getActivity();
final SwitchBar switchBar = activity.getSwitchBar();
switchBar.setSwitchBarText(R.string.location_settings_master_switch_title,
R.string.location_settings_master_switch_title);
switchBar.setSwitchBarText(R.string.location_settings_primary_switch_title,
R.string.location_settings_primary_switch_title);
mSwitchBarController = new LocationSwitchBarController(activity, switchBar,
getSettingsLifecycle());
switchBar.show();

View File

@@ -31,32 +31,32 @@ import com.android.settingslib.TwoTargetPreference;
* A custom preference that provides inline checkbox. It has a mandatory field for title, and
* optional fields for icon and sub-text.
*/
public class MasterCheckBoxPreference extends TwoTargetPreference {
public class PrimaryCheckBoxPreference extends TwoTargetPreference {
private CheckBox mCheckBox;
private boolean mChecked;
private boolean mEnableCheckBox = true;
public MasterCheckBoxPreference(Context context, AttributeSet attrs,
public PrimaryCheckBoxPreference(Context context, AttributeSet attrs,
int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
public MasterCheckBoxPreference(Context context, AttributeSet attrs, int defStyleAttr) {
public PrimaryCheckBoxPreference(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public MasterCheckBoxPreference(Context context, AttributeSet attrs) {
public PrimaryCheckBoxPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MasterCheckBoxPreference(Context context) {
public PrimaryCheckBoxPreference(Context context) {
super(context);
}
@Override
protected int getSecondTargetResId() {
return R.layout.preference_widget_master_checkbox;
return R.layout.preference_widget_primary_checkbox;
}
@Override
@@ -98,6 +98,10 @@ public class MasterCheckBoxPreference extends TwoTargetPreference {
return mCheckBox != null && mChecked;
}
/**
* Set the check status of checkbox
* @param checked
*/
public void setChecked(boolean checked) {
mChecked = checked;
if (mCheckBox != null) {
@@ -105,6 +109,10 @@ public class MasterCheckBoxPreference extends TwoTargetPreference {
}
}
/**
* Set the enabled status of CheckBox
* @param enabled
*/
public void setCheckBoxEnabled(boolean enabled) {
mEnableCheckBox = enabled;
if (mCheckBox != null) {