Strings updates for the new version of High contrast text.

These strings may be replaced again after our UX Writing team provides
new strings for the final public release.

Bug: 384791485
Test: observe new strings; see http://b/384791485#comment2
Flag: EXEMPT strings changes
Change-Id: I5359bc3d6faca84238fe00801a5d68e5ef8ffc2f
This commit is contained in:
Daniel Norman
2024-12-18 20:40:30 +00:00
parent 74b1086f23
commit d6e53163fd
5 changed files with 12 additions and 11 deletions

View File

@@ -5415,8 +5415,10 @@
<string name="accessibility_toggle_high_text_contrast_preference_title">High contrast text</string> <string name="accessibility_toggle_high_text_contrast_preference_title">High contrast text</string>
<!-- Summary for the accessibility preference to high contrast text. [CHAR LIMIT=NONE] --> <!-- Summary for the accessibility preference to high contrast text. [CHAR LIMIT=NONE] -->
<string name="accessibility_toggle_high_text_contrast_preference_summary">Change text color to black or white. Maximizes contrast with the background.</string> <string name="accessibility_toggle_high_text_contrast_preference_summary">Change text color to black or white. Maximizes contrast with the background.</string>
<!-- Content for the notification to high contrast text. [CHAR LIMIT=NONE] --> <!-- Title for the notification that high contrast text has been replaced. [CHAR LIMIT=NONE] -->
<string name="accessibility_notification_high_contrast_text_content">High contrast text has a new look and feel.</string> <string name="accessibility_notification_high_contrast_text_title">High contrast text has been replaced</string>
<!-- Text content for the notification that high contrast text has been replaced. [CHAR LIMIT=NONE] -->
<string name="accessibility_notification_high_contrast_text_content">Try Maximize text contrast instead. Find it in Settings.</string>
<!-- Action for the notification to high contrast text. [CHAR LIMIT=35] --> <!-- Action for the notification to high contrast text. [CHAR LIMIT=35] -->
<string name="accessibility_notification_high_contrast_text_action">Open Settings</string> <string name="accessibility_notification_high_contrast_text_action">Open Settings</string>
<!-- Title for the accessibility preference to high contrast text. [CHAR LIMIT=35] --> <!-- Title for the accessibility preference to high contrast text. [CHAR LIMIT=35] -->

View File

@@ -33,8 +33,8 @@
<SwitchPreferenceCompat <SwitchPreferenceCompat
android:key="toggle_high_text_contrast_preference" android:key="toggle_high_text_contrast_preference"
android:persistent="false" android:persistent="false"
android:summary="@string/accessibility_toggle_high_text_contrast_preference_summary" android:title="@string/accessibility_toggle_maximize_text_contrast_preference_title"
android:title="@string/accessibility_toggle_high_text_contrast_preference_title" android:summary="@string/accessibility_toggle_maximize_text_contrast_preference_summary"
settings:controller= settings:controller=
"com.android.settings.accessibility.HighTextContrastPreferenceController" /> "com.android.settings.accessibility.HighTextContrastPreferenceController" />

View File

@@ -56,8 +56,8 @@
<SwitchPreferenceCompat <SwitchPreferenceCompat
android:key="toggle_high_text_contrast_preference" android:key="toggle_high_text_contrast_preference"
android:persistent="false" android:persistent="false"
android:summary="@string/accessibility_toggle_high_text_contrast_preference_summary" android:title="@string/accessibility_toggle_maximize_text_contrast_preference_title"
android:title="@string/accessibility_toggle_high_text_contrast_preference_title" /> android:summary="@string/accessibility_toggle_maximize_text_contrast_preference_summary" />
<com.android.settings.accessibility.TextReadingResetPreference <com.android.settings.accessibility.TextReadingResetPreference
android:key="reset" android:key="reset"

View File

@@ -49,7 +49,7 @@ import java.lang.annotation.RetentionPolicy;
public class HighContrastTextMigrationReceiver extends BroadcastReceiver { public class HighContrastTextMigrationReceiver extends BroadcastReceiver {
private static final String TAG = HighContrastTextMigrationReceiver.class.getSimpleName(); private static final String TAG = HighContrastTextMigrationReceiver.class.getSimpleName();
@VisibleForTesting @VisibleForTesting
static final String NOTIFICATION_CHANNEL = "high_contrast_text_notification_channel"; static final String NOTIFICATION_CHANNEL = "accessibility_notification_channel";
@VisibleForTesting @VisibleForTesting
static final String ACTION_RESTORED = static final String ACTION_RESTORED =
"com.android.settings.accessibility.ACTION_HIGH_CONTRAST_TEXT_RESTORED"; "com.android.settings.accessibility.ACTION_HIGH_CONTRAST_TEXT_RESTORED";
@@ -120,7 +120,7 @@ public class HighContrastTextMigrationReceiver extends BroadcastReceiver {
NOTIFICATION_CHANNEL) NOTIFICATION_CHANNEL)
.setSmallIcon(R.drawable.ic_settings_24dp) .setSmallIcon(R.drawable.ic_settings_24dp)
.setContentTitle(context.getString( .setContentTitle(context.getString(
R.string.accessibility_toggle_high_text_contrast_preference_title)) R.string.accessibility_notification_high_contrast_text_title))
.setContentText(context.getString( .setContentText(context.getString(
R.string.accessibility_notification_high_contrast_text_content)) R.string.accessibility_notification_high_contrast_text_content))
.setAutoCancel(true); .setAutoCancel(true);
@@ -149,8 +149,7 @@ public class HighContrastTextMigrationReceiver extends BroadcastReceiver {
context.getSystemService(NotificationManager.class); context.getSystemService(NotificationManager.class);
NotificationChannel notificationChannel = new NotificationChannel( NotificationChannel notificationChannel = new NotificationChannel(
NOTIFICATION_CHANNEL, NOTIFICATION_CHANNEL,
context.getString( context.getString(R.string.accessibility_settings),
R.string.accessibility_toggle_high_text_contrast_preference_title),
NotificationManager.IMPORTANCE_LOW); NotificationManager.IMPORTANCE_LOW);
notificationManager.createNotificationChannel(notificationChannel); notificationManager.createNotificationChannel(notificationChannel);
notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build()); notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build());

View File

@@ -203,7 +203,7 @@ public class HighContrastTextMigrationReceiverTest {
ShadowNotification shadowNotification = Shadows.shadowOf(notification); ShadowNotification shadowNotification = Shadows.shadowOf(notification);
assertThat(shadowNotification.getContentTitle()).isEqualTo(mContext.getString( assertThat(shadowNotification.getContentTitle()).isEqualTo(mContext.getString(
R.string.accessibility_toggle_high_text_contrast_preference_title)); R.string.accessibility_notification_high_contrast_text_title));
assertThat(shadowNotification.getContentText()).isEqualTo( assertThat(shadowNotification.getContentText()).isEqualTo(
mContext.getString(R.string.accessibility_notification_high_contrast_text_content)); mContext.getString(R.string.accessibility_notification_high_contrast_text_content));