Screen Resolution: add space for 4-digit values
Add logic that composes screen resolution string with non-breaking spaces. Now setting page will show "1 080 x 1 280" instead of "1080 x 1280" Test: atest -c <SETTINGS_APP_PATH>/tests/unit/src/com/android/settings/display/ScreenResolutionFragmentTest.java Test: verified on device Flag: EXEMPT no API change Bug: 385895191 Change-Id: I9a4bbd7c20e8c700dee6e997a36d4fda69f4d780
This commit is contained in:
@@ -110,4 +110,28 @@ public class ScreenResolutionFragmentTest {
|
||||
|
||||
assertThat(preference.getSummary().toString().contentEquals(summary)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testResolutionString_widthAndHeightAboveThreshold() {
|
||||
String result = ScreenResolutionFragment.getResolutionString(1080, 1280);
|
||||
assertThat(result).isEqualTo("1\u00A0080\u00A0x\u00A01\u00A0280");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testResolutionString_widthAboveThreshold_heightBelowThreshold() {
|
||||
String result = ScreenResolutionFragment.getResolutionString(1080, 980);
|
||||
assertThat(result).isEqualTo("1\u00A0080\u00A0x\u00A0980");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testResolutionString_widthBelowThreshold_heightBelowThreshold() {
|
||||
String result = ScreenResolutionFragment.getResolutionString(980, 980);
|
||||
assertThat(result).isEqualTo("980\u00A0x\u00A0980");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testResolutionString_widthBelowThreshold_heightAboveThreshold() {
|
||||
String result = ScreenResolutionFragment.getResolutionString(980, 1080);
|
||||
assertThat(result).isEqualTo("980\u00A0x\u00A01\u00A0080");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user