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

Commit 4a05b290 authored by Anna Galusza's avatar Anna Galusza Committed by Android (Google) Code Review
Browse files

Merge "UI fixes (back arrow, blue switch bar, append whether Talkback is on to...

Merge "UI fixes (back arrow, blue switch bar, append whether Talkback is on to summary), Talkback no longer disabled when preference is tapped, fixes SettingsPreferenceFragment to not check parent class to determine whether to show options menu."
parents 3b14483e 0285c806
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@
    <attr name="switchBarTheme" format="reference" />
    <attr name="switchBarMarginStart" format="dimension" />
    <attr name="switchBarMarginEnd" format="dimension" />
    <attr name="switchBarBackgroundColor" format="color" />

    <attr name="preferenceBackgroundColor" format="color" />

+5 −3
Original line number Diff line number Diff line
@@ -3750,8 +3750,10 @@
    <string name="vision_settings_description">Adjust these settings now to assist you through the remainder of the set up process. You can adjust them any time in device settings.</string>
    <!-- Title for the accessibility preference category of accessibility services. [CHAR LIMIT=25] -->
    <string name="accessibility_services_title">Services</string>
    <!-- Summary for the Talkback Accessibility Service. Lets the user know that Talkback is a screenreader and that it is usually most helpful to blind and low vision users. [CHAR_LIMIT=none] -->
    <string name="talkback_summary">Screenreader tool primarily for people with blindness and low vision</string>
    <!-- Title for the Talkback Accessibility Service. Displayed on the Accessibility Settings screen in Setup Wizard. [CHAR_LIMIT=25] -->
    <string name="talkback_title">Talkback</string>
    <!-- Summary for the Talkback Accessibility Service. Lets the user know that Talkback is a screenreader and that it is usually most helpful to blind and low vision users and whether the service is on. [CHAR_LIMIT=none] -->
    <string name="talkback_summary">Screenreader tool primarily for people with blindness and low vision\n<xliff:g id="service_state" example="On">%1$s</xliff:g></string>
    <!-- Title for the accessibility preference category of system related preferences. [CHAR LIMIT=25] -->
    <string name="accessibility_system_title">System</string>
    <!-- Title for the accessibility preference category of display related preferences. [CHAR LIMIT=25] -->
@@ -3761,7 +3763,7 @@
    <!-- Title for the accessibility preference screen to enable screen magnification. [CHAR LIMIT=35] -->
    <string name="accessibility_screen_magnification_title">Magnification gestures</string>
    <!-- Summary for the accessibility preference screen to enable screen magnification. [CHAR LIMIT=none] -->
    <string name="accessibility_screen_magnification_summary">Zoom in and out by triple-tapping the screen with one finger.\n\nWhile zoomed in, you can:\n<ul><li>Pan: Drag two or more fingers across the screen.</li>\n<li>Adjust zoom level: Pinch two or more fingers together or spread them apart.</li>\n<li>Temporariliy magnify: Triple-tap, hold, and drag your finger to explore different parts of the screen. Lift your finger to return to our previous state.</li></ul>\n\nTriple-tap for magnification works everywhere except the keyboard and navigation bar.</string>
    <string name="accessibility_screen_magnification_summary">Zoom in and out by triple-tapping the screen with one finger.\n\nWhile zoomed in, you can:\n<ul><li>Pan: Drag two or more fingers across the screen.</li>\n<li>Adjust zoom level: Pinch two or more fingers together or spread them apart.</li>\n<li>Temporariliy magnify: Triple-tap, hold, and drag your finger to explore different parts of the screen. Lift your finger to return to your previous state.</li></ul>\n\nTriple-tap for magnification works everywhere except the keyboard and navigation bar.</string>
    <!-- Title for the preference to enable the global geture that turns on accessibility. [CHAR LIMIT=35] -->
    <string name="accessibility_global_gesture_preference_title">Accessibility shortcut</string>
    <!-- Summary for the preference to enable the global geture that turns on accessibility (on state). [CHAR LIMIT=60] -->
+8 −1
Original line number Diff line number Diff line
@@ -118,7 +118,11 @@
        <item name="android:colorPrimary">@color/material_blue_700</item>
        <item name="android:colorPrimaryDark">@color/material_blue_700</item>
        <item name="preferenceTheme">@style/PreferenceTheme</item>
        <item name="switchBarTheme">@style/ThemeOverlay.SwitchBar.Settings</item>
        <item name="switchBarTheme">@style/SetupWizardAccessibilitySwitchBarTheme</item>
    </style>

    <style name="SetupWizardAccessibilitySwitchBarTheme" parent="ThemeOverlay.SwitchBar.Settings">
        <item name="switchBarBackgroundColor">@color/material_blue_500</item>
    </style>

    <!-- Theme with no local references, used by AccountPreferenceBase where we have to inflate
@@ -180,11 +184,13 @@
    <style name="ThemeOverlay.SwitchBar.Settings" parent="@android:style/ThemeOverlay.Material.Dark.ActionBar">
        <item name="switchBarMarginStart">@dimen/switchbar_margin_start</item>
        <item name="switchBarMarginEnd">@dimen/switchbar_margin_end</item>
        <item name="switchBarBackgroundColor">@color/switchbar_background_color</item>
    </style>

    <style name="ThemeOverlay.SwitchBar.SubSettings" parent="@android:style/ThemeOverlay.Material.Dark.ActionBar">
        <item name="switchBarMarginStart">@dimen/switchbar_subsettings_margin_start</item>
        <item name="switchBarMarginEnd">@dimen/switchbar_subsettings_margin_end</item>
        <item name="switchBarBackgroundColor">@color/switchbar_background_color</item>
    </style>

    <style name="Theme.DialogWhenLarge" parent="@*android:style/Theme.Material.Settings.DialogWhenLarge">
@@ -237,6 +243,7 @@
    <style name="ThemeOverlay.SwitchBar" parent="@android:style/ThemeOverlay">
        <!-- Used by controls, e.g. CheckBox, ProgressBar, etc. -->
        <item name="android:colorAccent">@color/switch_accent_color</item>
        <item name="switchBarBackgroundColor">@color/switchbar_background_color</item>
    </style>

    <style name="Theme.ConfirmDeviceCredentials" parent="Theme.SubSettings">
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@

    <Preference
        android:key="talkback_preference"
        android:summary="@string/talkback_summary"
        android:title="@string/talkback_title"
        android:persistent="true" />

</PreferenceScreen>
+13 −1
Original line number Diff line number Diff line
@@ -52,6 +52,12 @@ import java.util.UUID;
public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceFragment
        implements DialogCreatable {

    /**
     * The Help Uri Resource key. This can be passed as an extra argument when creating the
     * Fragment.
     **/
    public static final String HELP_URI_RESOURCE_KEY = "help_uri_resource";

    private static final String TAG = "SettingsPreference";

    private static final int DELAY_HIGHLIGHT_DURATION_MILLIS = 600;
@@ -101,7 +107,13 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF
        }

        // Prepare help url and enable menu if necessary
        int helpResource = getHelpResource();
        Bundle arguments = getArguments();
        int helpResource;
        if (arguments != null && arguments.containsKey(HELP_URI_RESOURCE_KEY)) {
            helpResource = arguments.getInt(HELP_URI_RESOURCE_KEY);
        } else {
            helpResource = getHelpResource();
        }
        if (helpResource != 0) {
            mHelpUri = getResources().getString(helpResource);
        }
Loading