Merge "Fixing resolution announced by Talkback" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
d82f6583fb
@@ -3021,6 +3021,8 @@
|
|||||||
<string name="screen_resolution_option_full">Max resolution</string>
|
<string name="screen_resolution_option_full">Max resolution</string>
|
||||||
<!-- The footer message for switch screen resolution [CHAR LIMIT=NONE] -->
|
<!-- The footer message for switch screen resolution [CHAR LIMIT=NONE] -->
|
||||||
<string name="screen_resolution_footer">Max resolution uses more of your battery. Switching your resolution may cause some apps to restart.</string>
|
<string name="screen_resolution_footer">Max resolution uses more of your battery. Switching your resolution may cause some apps to restart.</string>
|
||||||
|
<!-- Screen resolution a11y message announced to replace 'x' in entry e.g. 600 by 800 [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="screen_resolution_delimiter_a11y"><xliff:g id="width">%1$s</xliff:g> by <xliff:g id="height">%2$s</xliff:g></string>
|
||||||
<!-- Display settings screen, Color mode settings title [CHAR LIMIT=30] -->
|
<!-- Display settings screen, Color mode settings title [CHAR LIMIT=30] -->
|
||||||
<string name="color_mode_title">Colors</string>
|
<string name="color_mode_title">Colors</string>
|
||||||
<!-- Display settings screen, Color mode option for "natural(sRGB) color" [CHAR LIMIT=45] -->
|
<!-- Display settings screen, Color mode option for "natural(sRGB) color" [CHAR LIMIT=45] -->
|
||||||
|
@@ -23,6 +23,7 @@ import android.graphics.Point;
|
|||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.hardware.display.DisplayManager;
|
import android.hardware.display.DisplayManager;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.text.SpannableString;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Display;
|
import android.view.Display;
|
||||||
@@ -32,6 +33,7 @@ import androidx.annotation.VisibleForTesting;
|
|||||||
import androidx.preference.PreferenceScreen;
|
import androidx.preference.PreferenceScreen;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
|
import com.android.settings.Utils;
|
||||||
import com.android.settings.core.instrumentation.SettingsStatsLog;
|
import com.android.settings.core.instrumentation.SettingsStatsLog;
|
||||||
import com.android.settings.search.BaseSearchIndexProvider;
|
import com.android.settings.search.BaseSearchIndexProvider;
|
||||||
import com.android.settings.widget.RadioButtonPickerFragment;
|
import com.android.settings.widget.RadioButtonPickerFragment;
|
||||||
@@ -58,7 +60,7 @@ public class ScreenResolutionFragment extends RadioButtonPickerFragment {
|
|||||||
private Display mDefaultDisplay;
|
private Display mDefaultDisplay;
|
||||||
private String[] mScreenResolutionOptions;
|
private String[] mScreenResolutionOptions;
|
||||||
private Set<Point> mResolutions;
|
private Set<Point> mResolutions;
|
||||||
private String[] mScreenResolutionSummaries;
|
private SpannableString[] mScreenResolutionSummaries;
|
||||||
|
|
||||||
private IllustrationPreference mImagePreference;
|
private IllustrationPreference mImagePreference;
|
||||||
private DisplayObserver mDisplayObserver;
|
private DisplayObserver mDisplayObserver;
|
||||||
@@ -84,12 +86,20 @@ public class ScreenResolutionFragment extends RadioButtonPickerFragment {
|
|||||||
mFullWidth = controller.getFullWidth();
|
mFullWidth = controller.getFullWidth();
|
||||||
Log.i(TAG, "mHighWidth:" + mHighWidth + "mFullWidth:" + mFullWidth);
|
Log.i(TAG, "mHighWidth:" + mHighWidth + "mFullWidth:" + mFullWidth);
|
||||||
mScreenResolutionSummaries =
|
mScreenResolutionSummaries =
|
||||||
new String[] {
|
new SpannableString[] {
|
||||||
mHighWidth + " x " + controller.getHighHeight(),
|
getResolutionSpannable(mHighWidth, controller.getHighHeight()),
|
||||||
mFullWidth + " x " + controller.getFullHeight()
|
getResolutionSpannable(mFullWidth, controller.getFullHeight())
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private SpannableString getResolutionSpannable(int width, int height) {
|
||||||
|
String resolutionString = width + " x " + height;
|
||||||
|
String accessibleText = mResources.getString(
|
||||||
|
R.string.screen_resolution_delimiter_a11y, width, height);
|
||||||
|
return Utils.createAccessibleSequence(resolutionString, accessibleText);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getPreferenceScreenResId() {
|
protected int getPreferenceScreenResId() {
|
||||||
return R.xml.screen_resolution_settings;
|
return R.xml.screen_resolution_settings;
|
||||||
|
Reference in New Issue
Block a user