Merge "[Settings] Add strings for Natural and Automatic color modes" into pi-dev

am: 8d8ee565b1

Change-Id: I147f0648d976094b291b49c2649d8529930436be
This commit is contained in:
Sean Callanan
2018-03-24 05:23:17 +00:00
committed by android-build-merger
3 changed files with 15 additions and 2 deletions

View File

@@ -2461,6 +2461,12 @@
<string name="color_mode_option_boosted">Boosted</string>
<!-- Display settings screen, Color mode option for "Saturated color" [CHAR LIMIT=45] -->
<string name="color_mode_option_saturated">Saturated</string>
<!-- Display settings screen, Color mode option for "Automatic color" [CHAR LIMIT=45] -->
<string name="color_mode_option_automatic">Automatic</string>
<!-- Display settings screen, "natural(sRGB) color" setting option summary [CHAR LIMIT=NONE] -->
<string name="color_mode_summary_natural">Use accurate colors only</string>
<!-- Display settings screen, "Automatic color" setting option summary [CHAR LIMIT=NONE] -->
<string name="color_mode_summary_automatic">Adjust between vivid and accurate colors</string>
<!-- Sound & display settings screen, accelerometer-based rotation summary text when check box is selected -->
<string name="accelerometer_summary_on" product="tablet">Switch orientation automatically when rotating tablet</string>

View File

@@ -38,6 +38,9 @@ public class ColorModePreferenceFragment extends RadioButtonPickerFragment {
static final String KEY_COLOR_MODE_BOOSTED = "color_mode_boosted";
@VisibleForTesting
static final String KEY_COLOR_MODE_SATURATED = "color_mode_saturated";
// TODO have a real key for "automatic" rather than just re-using "saturated"
@VisibleForTesting
static final String KEY_COLOR_MODE_AUTOMATIC = "color_mode_saturated";
private ColorDisplayController mController;
@@ -74,7 +77,9 @@ public class ColorModePreferenceFragment extends RadioButtonPickerFragment {
new ColorModeCandidateInfo(c.getString(R.string.color_mode_option_boosted),
KEY_COLOR_MODE_BOOSTED),
new ColorModeCandidateInfo(c.getString(R.string.color_mode_option_saturated),
KEY_COLOR_MODE_SATURATED)
KEY_COLOR_MODE_SATURATED),
new ColorModeCandidateInfo(c.getString(R.string.color_mode_option_automatic),
KEY_COLOR_MODE_AUTOMATIC)
);
}

View File

@@ -73,13 +73,15 @@ public class ColorModePreferenceFragmentTest {
when(mFragment.getContext()).thenReturn(RuntimeEnvironment.application);
List<? extends CandidateInfo> candidates = mFragment.getCandidates();
assertThat(candidates.size()).isEqualTo(3);
assertThat(candidates.size()).isEqualTo(4);
assertThat(candidates.get(0).getKey())
.isEqualTo(ColorModePreferenceFragment.KEY_COLOR_MODE_NATURAL);
assertThat(candidates.get(1).getKey())
.isEqualTo(ColorModePreferenceFragment.KEY_COLOR_MODE_BOOSTED);
assertThat(candidates.get(2).getKey())
.isEqualTo(ColorModePreferenceFragment.KEY_COLOR_MODE_SATURATED);
assertThat(candidates.get(3).getKey())
.isEqualTo(ColorModePreferenceFragment.KEY_COLOR_MODE_AUTOMATIC);
}
@Test