Update RBC UI with latest strings

Get rid of the slider (no longer need labels)

Test: Manual
Bug: 182922255
Change-Id: Ib3d0c8ad823af55848f2526f3377ff11b4196f54
diff --git a/res/layout/preference_labeled_continuous_slider.xml b/res/layout/preference_labeled_continuous_slider.xml
deleted file mode 100644
index 00e8796..0000000
--- a/res/layout/preference_labeled_continuous_slider.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2021 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:minHeight="?android:attr/listPreferredItemHeight"
-              android:gravity="center_vertical"
-              android:layout_width="match_parent"
-              android:layout_height="wrap_content"
-              android:orientation="vertical"
-              android:paddingStart="56dp"
-              android:paddingEnd="8dp"
-              android:paddingTop="16dp"
-              android:paddingBottom="16dp">
-
-    <TextView
-        android:id="@android:id/title"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:paddingBottom="16dp"
-        android:layout_marginStart="16dp"
-        android:maxLines="1"
-        android:textAppearance="@android:style/TextAppearance.Material.Subhead"
-        android:textColor="?android:attr/textColorPrimary" />
-
-    <SeekBar
-        android:id="@*android:id/seekbar"
-        android:layout_gravity="center_vertical"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"/>
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:paddingTop="8dp"
-        android:orientation="horizontal">
-
-        <TextView
-            android:id="@android:id/text1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginStart="16dp"
-            android:layout_weight="1"
-            android:maxLines="1"
-            android:textAlignment="viewStart"/>
-
-        <TextView
-            android:id="@android:id/text2"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginEnd="16dp"
-            android:layout_weight="1"
-            android:maxLines="1"
-            android:textAlignment="viewEnd"/>
-    </LinearLayout>
-</LinearLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 7e10006..c3fdfa0 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -5334,15 +5334,17 @@
     <!-- Summary shown for tritanomaly (blue-yellow color blindness) [CHAR LIMIT=45] -->
     <string name="daltonizer_mode_tritanomaly_summary">Blue-yellow</string>
 
-    <!-- Title for the accessibility preference and switch of the Reduce Brightness feature. [CHAR LIMIT=NONE] -->
-    <string name="reduce_bright_colors_preference_title">Reduce brightness</string>
+    <!-- Title for the accessibility preference of the Reduce Brightness feature. [CHAR LIMIT=NONE] -->
+    <string name="reduce_bright_colors_preference_title">Extra dim</string>
+    <!-- Title for the activation switch of the Reduce Brightness feature. [CHAR LIMIT=NONE] -->
+    <string name="reduce_bright_colors_switch_title">Make screen extra dim</string>
     <!-- Summary for the accessibility preference to configure Reduce Brightness feature. [CHAR LIMIT=NONE] -->
-    <string name="reduce_bright_colors_preference_summary" product="default">Make screen darker than your phone\u2019s minimum brightness</string>
+    <string name="reduce_bright_colors_preference_summary" product="default">Dim screen beyond your phone\u2019s minimum brightness</string>
     <!-- Summary for the accessibility preference to configure Reduce Brightness feature. [CHAR LIMIT=NONE] -->
-    <string name="reduce_bright_colors_preference_summary" product="tablet">Make screen darker than your tablet\u2019s minimum brightness</string>
+    <string name="reduce_bright_colors_preference_summary" product="tablet">Dim screen beyond your tablet\u2019s minimum brightness</string>
     <!-- Subtitle that describes Reduce Brightness. [CHAR LIMIT=NONE] -->
     <string name="reduce_bright_colors_preference_subtitle" product="default">
-        <![CDATA[Make your screen darker so it\u2019s more comfortable to read.<br/><br/>
+        <![CDATA[Make your screen dimmer so it\u2019s more comfortable to read.<br/><br/>
         This can be helpful when:
         <ol>
             <li>\u00a0Your phone\u2019s default minimum brightness is still too bright</li>
@@ -5362,10 +5364,6 @@
     </string>
     <!-- Title for setting the brightness intensity of the display using Reduce Brightness. [CHAR LIMIT=NONE] -->
     <string name="reduce_bright_colors_intensity_preference_title">Intensity</string>
-    <!-- Start label for setting the brightness intensity of the display using Reduce Brightness. [CHAR LIMIT=50] -->
-    <string name="reduce_bright_colors_intensity_preference_start_label">Slightly darker</string>
-    <!-- End label for setting the brightness intensity of the display using Reduce Brightness. [CHAR LIMIT=NONE] -->
-    <string name="reduce_bright_colors_intensity_preference_end_label">Darkest</string>
     <!-- Title for setting whether the Reduce Brightness activation state persists across reboots. [CHAR LIMIT=NONE] -->
     <string name="reduce_bright_colors_persist_preference_title">Keep on after device restarts</string>
 
diff --git a/res/xml/reduce_bright_colors_settings.xml b/res/xml/reduce_bright_colors_settings.xml
index 17e8b02..b9ca854 100644
--- a/res/xml/reduce_bright_colors_settings.xml
+++ b/res/xml/reduce_bright_colors_settings.xml
@@ -17,16 +17,13 @@
 
 <PreferenceScreen
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:settings="http://schemas.android.com/apk/res-auto"
     android:persistent="false"
     android:title="@string/reduce_bright_colors_preference_title">
 
-    <com.android.settings.widget.LabeledContinuousSeekBarPreference
+    <com.android.settings.widget.SeekBarPreference
         android:key="rbc_intensity"
         android:persistent="false"
-        android:title="@string/reduce_bright_colors_intensity_preference_title"
-        settings:textStart="@string/reduce_bright_colors_intensity_preference_start_label"
-        settings:textEnd="@string/reduce_bright_colors_intensity_preference_end_label"/>
+        android:title="@string/reduce_bright_colors_intensity_preference_title"/>
 
     <SwitchPreference
         android:key="rbc_persist"
diff --git a/src/com/android/settings/accessibility/ToggleReduceBrightColorsPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleReduceBrightColorsPreferenceFragment.java
index f65bd62..61459c4 100644
--- a/src/com/android/settings/accessibility/ToggleReduceBrightColorsPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleReduceBrightColorsPreferenceFragment.java
@@ -80,6 +80,8 @@
         };
 
         final View view = super.onCreateView(inflater, container, savedInstanceState);
+        // Parent sets the title when creating the view, so set it after calling super
+        mToggleServiceSwitchPreference.setTitle(R.string.reduce_bright_colors_switch_title);
         updateGeneralCategoryOrder();
         return view;
     }
diff --git a/src/com/android/settings/widget/LabeledContinuousSeekBarPreference.java b/src/com/android/settings/widget/LabeledContinuousSeekBarPreference.java
deleted file mode 100644
index e269818..0000000
--- a/src/com/android/settings/widget/LabeledContinuousSeekBarPreference.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.widget;
-
-import android.content.Context;
-import android.util.AttributeSet;
-
-import com.android.settings.R;
-
-/** A continuous labeled slider preference */
-public class LabeledContinuousSeekBarPreference extends LabeledSeekBarPreference {
-    public LabeledContinuousSeekBarPreference(Context context) {
-        this(context, null);
-    }
-
-    public LabeledContinuousSeekBarPreference(Context context, AttributeSet attrs) {
-       this(context, attrs, 0);
-    }
-
-    public LabeledContinuousSeekBarPreference(Context context, AttributeSet attrs,
-            int defStyleAttr) {
-        this(context, attrs, defStyleAttr, 0);
-    }
-
-    public LabeledContinuousSeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr,
-            int defStyleRes) {
-        super(context, attrs, defStyleAttr, defStyleRes);
-        setLayoutResource(R.layout.preference_labeled_continuous_slider);
-    }
-}