Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 952f9894 authored by Sally Yuen's avatar Sally Yuen Committed by Android (Google) Code Review
Browse files

Merge "Update RBC UI with latest strings" into sc-dev

parents e4fc48f3 d5029fc8
Loading
Loading
Loading
Loading
+0 −68
Original line number Original line Diff line number Diff line
<?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>
+7 −9
Original line number Original line Diff line number Diff line
@@ -5366,15 +5366,17 @@
    <!-- Summary shown for tritanomaly (blue-yellow color blindness) [CHAR LIMIT=45] -->
    <!-- Summary shown for tritanomaly (blue-yellow color blindness) [CHAR LIMIT=45] -->
    <string name="daltonizer_mode_tritanomaly_summary">Blue-yellow</string>
    <string name="daltonizer_mode_tritanomaly_summary">Blue-yellow</string>
    <!-- Title for the accessibility preference and switch of the Reduce Brightness feature. [CHAR LIMIT=NONE] -->
    <!-- Title for the accessibility preference of the Reduce Brightness feature. [CHAR LIMIT=NONE] -->
    <string name="reduce_bright_colors_preference_title">Reduce brightness</string>
    <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] -->
    <!-- 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] -->
    <!-- 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] -->
    <!-- Subtitle that describes Reduce Brightness. [CHAR LIMIT=NONE] -->
    <string name="reduce_bright_colors_preference_subtitle" product="default">
    <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:
        This can be helpful when:
        <ol>
        <ol>
            <li>\u00a0Your phone\u2019s default minimum brightness is still too bright</li>
            <li>\u00a0Your phone\u2019s default minimum brightness is still too bright</li>
@@ -5394,10 +5396,6 @@
    </string>
    </string>
    <!-- Title for setting the brightness intensity of the display using Reduce Brightness. [CHAR LIMIT=NONE] -->
    <!-- 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>
    <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] -->
    <!-- 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>
    <string name="reduce_bright_colors_persist_preference_title">Keep on after device restarts</string>
+2 −5
Original line number Original line Diff line number Diff line
@@ -17,16 +17,13 @@


<PreferenceScreen
<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:persistent="false"
    android:persistent="false"
    android:title="@string/reduce_bright_colors_preference_title">
    android:title="@string/reduce_bright_colors_preference_title">


    <com.android.settings.widget.LabeledContinuousSeekBarPreference
    <com.android.settings.widget.SeekBarPreference
        android:key="rbc_intensity"
        android:key="rbc_intensity"
        android:persistent="false"
        android:persistent="false"
        android:title="@string/reduce_bright_colors_intensity_preference_title"
        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"/>


    <SwitchPreference
    <SwitchPreference
        android:key="rbc_persist"
        android:key="rbc_persist"
+2 −0
Original line number Original line Diff line number Diff line
@@ -80,6 +80,8 @@ public class ToggleReduceBrightColorsPreferenceFragment extends ToggleFeaturePre
        };
        };


        final View view = super.onCreateView(inflater, container, savedInstanceState);
        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();
        updateGeneralCategoryOrder();
        return view;
        return view;
    }
    }
+0 −44
Original line number Original line Diff line number Diff line
/*
 * 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);
    }
}