diff --git a/res/layout/preference_balance_slider.xml b/res/layout/preference_balance_slider.xml index 32010c36026..80cb9962985 100644 --- a/res/layout/preference_balance_slider.xml +++ b/res/layout/preference_balance_slider.xml @@ -87,7 +87,7 @@ android:orientation="horizontal"> - - - - diff --git a/res/values/strings.xml b/res/values/strings.xml index 3fec7c4f7b7..4061af6720f 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -666,8 +666,8 @@ Accounts Location - - Use location + + Use location Off @@ -5045,12 +5045,12 @@ Mono audio Combine channels when playing audio - + Audio balance - - Left - - Right + + Left + + Right Default @@ -10579,8 +10579,8 @@ Choose spell checker - - Use spell checker + + Use spell checker Not selected @@ -10793,8 +10793,8 @@ Storage manager - - Use Storage manager + + Use Storage manager Automatic diff --git a/src/com/android/settings/dashboard/profileselector/ProfileSelectLocationFragment.java b/src/com/android/settings/dashboard/profileselector/ProfileSelectLocationFragment.java index 0d7c4d040e2..a3f73fbc3af 100644 --- a/src/com/android/settings/dashboard/profileselector/ProfileSelectLocationFragment.java +++ b/src/com/android/settings/dashboard/profileselector/ProfileSelectLocationFragment.java @@ -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(); diff --git a/src/com/android/settings/deletionhelper/AutomaticStorageManagerSettings.java b/src/com/android/settings/deletionhelper/AutomaticStorageManagerSettings.java index 0de9f67be36..495764bce9b 100644 --- a/src/com/android/settings/deletionhelper/AutomaticStorageManagerSettings.java +++ b/src/com/android/settings/deletionhelper/AutomaticStorageManagerSettings.java @@ -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( diff --git a/src/com/android/settings/inputmethod/SpellCheckersSettings.java b/src/com/android/settings/inputmethod/SpellCheckersSettings.java index 017c1016765..dcd3703dafd 100644 --- a/src/com/android/settings/inputmethod/SpellCheckersSettings.java +++ b/src/com/android/settings/inputmethod/SpellCheckersSettings.java @@ -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(); diff --git a/src/com/android/settings/location/LocationSettings.java b/src/com/android/settings/location/LocationSettings.java index a9aa9a3fe3a..43918111cca 100644 --- a/src/com/android/settings/location/LocationSettings.java +++ b/src/com/android/settings/location/LocationSettings.java @@ -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(); diff --git a/src/com/android/settings/widget/MasterCheckBoxPreference.java b/src/com/android/settings/widget/PrimaryCheckBoxPreference.java similarity index 84% rename from src/com/android/settings/widget/MasterCheckBoxPreference.java rename to src/com/android/settings/widget/PrimaryCheckBoxPreference.java index 48e09c9a6cc..a784d5da971 100644 --- a/src/com/android/settings/widget/MasterCheckBoxPreference.java +++ b/src/com/android/settings/widget/PrimaryCheckBoxPreference.java @@ -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) { diff --git a/tests/robotests/src/com/android/settings/widget/MasterCheckBoxPreferenceTest.java b/tests/robotests/src/com/android/settings/widget/PrimaryCheckBoxPreferenceTest.java similarity index 89% rename from tests/robotests/src/com/android/settings/widget/MasterCheckBoxPreferenceTest.java rename to tests/robotests/src/com/android/settings/widget/PrimaryCheckBoxPreferenceTest.java index 16818b40caf..a1d74e3828f 100644 --- a/tests/robotests/src/com/android/settings/widget/MasterCheckBoxPreferenceTest.java +++ b/tests/robotests/src/com/android/settings/widget/PrimaryCheckBoxPreferenceTest.java @@ -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);