Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference Bug: 161896447 Test: robotest & manual Change-Id: I32f369a608c8b4f513f2c32afca6d408ee273428
This commit is contained in:
@@ -87,7 +87,7 @@
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/left_text"
|
||||
android:text="@string/accessibility_toggle_master_balance_left_label"
|
||||
android:text="@string/accessibility_toggle_primary_balance_left_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
@@ -95,7 +95,7 @@
|
||||
android:textAlignment="viewStart" />
|
||||
<TextView
|
||||
android:id="@+id/right_text"
|
||||
android:text="@string/accessibility_toggle_master_balance_right_label"
|
||||
android:text="@string/accessibility_toggle_primary_balance_right_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
|
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2018 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!-- Layout used by CheckBoxPreference for the checkbox style. This is inflated
|
||||
inside android.R.layout.preference. -->
|
||||
<RadioButton xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@android:id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:background="@null"
|
||||
android:focusable="false"
|
||||
android:clickable="false" />
|
@@ -666,8 +666,8 @@
|
||||
<string name="Accounts_settings_title">Accounts</string>
|
||||
<!-- Main Settings screen setting option title for the item to take you to the location screen -->
|
||||
<string name="location_settings_title">Location</string>
|
||||
<!-- Used in the location settings to control turning on/off the feature entirely -->
|
||||
<string name="location_settings_master_switch_title">Use location</string>
|
||||
<!-- Used in the location settings to control turning on/off the feature entirely [CHAR LIMIT=60] -->
|
||||
<string name="location_settings_primary_switch_title">Use location</string>
|
||||
<!-- Summary for Location settings when location is off [CHAR LIMIT=NONE] -->
|
||||
<string name="location_settings_summary_location_off">Off</string>
|
||||
<!-- Summary for Location settings when location is on, explaining how many apps have location permission [CHAR LIMIT=NONE]-->
|
||||
@@ -5045,12 +5045,12 @@
|
||||
<string name="accessibility_toggle_primary_mono_title">Mono audio</string>
|
||||
<!-- Summary for the accessibility preference for primary mono. [CHAR LIMIT=50] -->
|
||||
<string name="accessibility_toggle_primary_mono_summary">Combine channels when playing audio</string>
|
||||
<!-- Title for the accessibility preference for master balance. [CHAR LIMIT=35] -->
|
||||
<!-- Title for the accessibility preference for primary balance. [CHAR LIMIT=35] -->
|
||||
<string name="accessibility_toggle_primary_balance_title">Audio balance</string>
|
||||
<!-- 'Left' balance text for the accessibility preference for master balance. [CHAR LIMIT=20] -->
|
||||
<string name="accessibility_toggle_master_balance_left_label">Left</string>
|
||||
<!-- 'Right' balance text for the accessibility preference for master balance. [CHAR LIMIT=20] -->
|
||||
<string name="accessibility_toggle_master_balance_right_label">Right</string>
|
||||
<!-- 'Left' balance text for the accessibility preference for primary balance. [CHAR LIMIT=20] -->
|
||||
<string name="accessibility_toggle_primary_balance_left_label">Left</string>
|
||||
<!-- 'Right' balance text for the accessibility preference for primary balance. [CHAR LIMIT=20] -->
|
||||
<string name="accessibility_toggle_primary_balance_right_label">Right</string>
|
||||
|
||||
<!-- Option heading to leave the timeout requirement for accessibility users at its default level. [CHAR LIMIT=35] -->
|
||||
<string name="accessibility_timeout_default">Default</string>
|
||||
@@ -10579,8 +10579,8 @@
|
||||
<!-- [CHAR LIMIT=30] Title for dialog for setting to control the default spell checker -->
|
||||
<string name="choose_spell_checker">Choose spell checker</string>
|
||||
|
||||
<!-- [CHAR LIMIT=45] Title for the master switch for spell checker, turning off will disable entire spell check feature. -->
|
||||
<string name="spell_checker_master_switch_title">Use spell checker</string>
|
||||
<!-- [CHAR LIMIT=45] Title for the primary switch for spell checker, turning off will disable entire spell check feature. -->
|
||||
<string name="spell_checker_primary_switch_title">Use spell checker</string>
|
||||
|
||||
<!-- [CHAR LIMIT=30] Label for the placeholder of the current spell checker name. Used when no spell checker is currently selected. -->
|
||||
<string name="spell_checker_not_selected">Not selected</string>
|
||||
@@ -10793,8 +10793,8 @@
|
||||
<!-- Preference title for the automatic storage manager toggle. [CHAR LIMIT=60]-->
|
||||
<string name="automatic_storage_manager_preference_title">Storage manager</string>
|
||||
|
||||
<!-- Used in the storage manager settings screen to control turning on/off the feature entirely -->
|
||||
<string name="automatic_storage_manager_master_switch_title">Use Storage manager</string>
|
||||
<!-- Used in the storage manager settings screen to control turning on/off the feature entirely [CHAR LIMIT=60] -->
|
||||
<string name="automatic_storage_manager_primary_switch_title">Use Storage manager</string>
|
||||
|
||||
<!-- Category title for the automatic settings in the storage manager settings. [CHAR LIMIT=40] -->
|
||||
<string name="deletion_helper_automatic_title">Automatic</string>
|
||||
|
@@ -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();
|
||||
|
@@ -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(
|
||||
|
@@ -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();
|
||||
|
@@ -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();
|
||||
|
@@ -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) {
|
@@ -39,28 +39,28 @@ import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class MasterCheckBoxPreferenceTest {
|
||||
public class PrimaryCheckBoxPreferenceTest {
|
||||
|
||||
private Context mContext;
|
||||
private MasterCheckBoxPreference mPreference;
|
||||
private PrimaryCheckBoxPreference mPreference;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
mContext = RuntimeEnvironment.application;
|
||||
mPreference = new MasterCheckBoxPreference(mContext);
|
||||
mPreference = new PrimaryCheckBoxPreference(mContext);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createNewPreference_shouldSetLayout() {
|
||||
assertThat(mPreference.getWidgetLayoutResource())
|
||||
.isEqualTo(R.layout.preference_widget_master_checkbox);
|
||||
.isEqualTo(R.layout.preference_widget_primary_checkbox);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setChecked_shouldUpdateCheckBoxCheckedState() {
|
||||
final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
|
||||
LayoutInflater.from(mContext).inflate(
|
||||
R.layout.preference_widget_master_checkbox, null));
|
||||
R.layout.preference_widget_primary_checkbox, null));
|
||||
final CheckBox checkBox = (CheckBox) holder.findViewById(R.id.checkboxWidget);
|
||||
mPreference.onBindViewHolder(holder);
|
||||
|
||||
@@ -75,7 +75,7 @@ public class MasterCheckBoxPreferenceTest {
|
||||
public void setEnabled_shouldUpdateCheckBoxEnabledState() {
|
||||
final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
|
||||
LayoutInflater.from(mContext).inflate(
|
||||
R.layout.preference_widget_master_checkbox, null));
|
||||
R.layout.preference_widget_primary_checkbox, null));
|
||||
final CheckBox checkBox = (CheckBox) holder.findViewById(R.id.checkboxWidget);
|
||||
mPreference.onBindViewHolder(holder);
|
||||
|
||||
@@ -90,7 +90,7 @@ public class MasterCheckBoxPreferenceTest {
|
||||
public void setCheckboxEnabled_shouldOnlyUpdateCheckBoxEnabledState() {
|
||||
final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
|
||||
LayoutInflater.from(mContext).inflate(
|
||||
R.layout.preference_widget_master_checkbox, null));
|
||||
R.layout.preference_widget_primary_checkbox, null));
|
||||
final CheckBox checkBox = (CheckBox) holder.findViewById(R.id.checkboxWidget);
|
||||
mPreference.onBindViewHolder(holder);
|
||||
|
||||
@@ -107,7 +107,7 @@ public class MasterCheckBoxPreferenceTest {
|
||||
public void onBindViewHolder_shouldSetCheckboxEnabledState() {
|
||||
final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
|
||||
LayoutInflater.from(mContext).inflate(
|
||||
R.layout.preference_widget_master_checkbox, null));
|
||||
R.layout.preference_widget_primary_checkbox, null));
|
||||
final CheckBox checkBox = (CheckBox) holder.findViewById(R.id.checkboxWidget);
|
||||
|
||||
mPreference.setCheckBoxEnabled(false);
|
||||
@@ -129,7 +129,7 @@ public class MasterCheckBoxPreferenceTest {
|
||||
final LinearLayout widgetView = holder.itemView.findViewById(android.R.id.widget_frame);
|
||||
assertThat(widgetView).isNotNull();
|
||||
|
||||
inflater.inflate(R.layout.preference_widget_master_checkbox, widgetView, true);
|
||||
inflater.inflate(R.layout.preference_widget_primary_checkbox, widgetView, true);
|
||||
final CheckBox checkBox = (CheckBox) holder.findViewById(R.id.checkboxWidget);
|
||||
mPreference.onBindViewHolder(holder);
|
||||
|
||||
@@ -148,7 +148,7 @@ public class MasterCheckBoxPreferenceTest {
|
||||
final LinearLayout widgetView = holder.itemView.findViewById(android.R.id.widget_frame);
|
||||
assertThat(widgetView).isNotNull();
|
||||
|
||||
inflater.inflate(R.layout.preference_widget_master_checkbox, widgetView, true);
|
||||
inflater.inflate(R.layout.preference_widget_primary_checkbox, widgetView, true);
|
||||
final CheckBox checkBox = (CheckBox) holder.findViewById(R.id.checkboxWidget);
|
||||
mPreference.onBindViewHolder(holder);
|
||||
mPreference.setEnabled(false);
|
||||
@@ -178,8 +178,8 @@ public class MasterCheckBoxPreferenceTest {
|
||||
@Test
|
||||
public void onBindViewHolder_checkBoxShouldHaveContentDescription() {
|
||||
final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(
|
||||
LayoutInflater.from(mContext)
|
||||
.inflate(R.layout.preference_widget_master_checkbox, null));
|
||||
LayoutInflater.from(mContext).inflate(R.layout.preference_widget_primary_checkbox,
|
||||
null));
|
||||
final CheckBox checkBox = (CheckBox) holder.findViewById(R.id.checkboxWidget);
|
||||
final String label = "TestButton";
|
||||
mPreference.setTitle(label);
|
Reference in New Issue
Block a user