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

Commit aafe9ac0 authored by Jason Chang's avatar Jason Chang Committed by Android (Google) Code Review
Browse files

Merge "Fix refresh in Gestures, not reflecting the changes after toggling...

Merge "Fix refresh in Gestures, not reflecting the changes after toggling on/off one-handed mode" into sc-dev
parents 7f353492 858bda81
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
    <ImageView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:scaleType="centerCrop"
        android:scaleType="centerInside"
        android:cropToPadding="true"
        android:src="@drawable/one_handed_guideline"
        android:contentDescription="@null" />
+2 −2
Original line number Diff line number Diff line
@@ -11280,8 +11280,8 @@
    <!-- Title text for swiping downwards on the bottom of the screen for notifications [CHAR LIMIT=60]-->
    <string name="swipe_bottom_to_notifications_title">Swipe for notifications</string>
    <!-- Summary text for swiping downwards on the bottom of the screen for notifications [CHAR LIMIT=80]-->
    <string name="swipe_bottom_to_notifications_summary">Swipe down on the bottom edge of the screen to show your notifications</string>
    <!-- Summary text for swiping downwards on the bottom of the screen for notifications [CHAR LIMIT=NONE]-->
    <string name="swipe_bottom_to_notifications_summary">Swipe down on the bottom edge of the screen to show your notifications.\nYou can\'t use one-handed mode when this feature is turned on.</string>
    <!-- Preference and settings suggestion title text for one handed [CHAR LIMIT=60] -->
    <string name="one_handed_title">One-Handed mode</string>
+7 −5
Original line number Diff line number Diff line
@@ -20,11 +20,13 @@
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:title="@string/swipe_bottom_to_notifications_title">

    <com.android.settings.widget.VideoPreference
        android:title="@string/swipe_bottom_to_notifications_title"
        settings:animation="@raw/gesture_fingerprint_swipe"
        settings:preview="@drawable/gesture_fingerprint_swipe"
        settings:controller="com.android.settings.widget.VideoPreferenceController"/>
    <com.android.settingslib.widget.LayoutPreference
        android:key="one_handed_header"
        android:layout="@layout/one_handed_header"
        android:persistent="false"
        android:selectable="false"
        settings:allowDividerBelow="false"
        settings:searchable="false"/>

    <SwitchPreference
        android:key="gesture_swipe_bottom_to_notification"
+2 −4
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.settings.gestures;

import android.content.Context;
import android.os.SystemProperties;

import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
@@ -28,15 +27,13 @@ import com.android.settings.core.TogglePreferenceController;
 **/
public class OneHandedEnablePreferenceController extends TogglePreferenceController {

    static final String SUPPORT_ONE_HANDED_MODE = "ro.support_one_handed_mode";

    public OneHandedEnablePreferenceController(Context context, String key) {
        super(context, key);
    }

    @Override
    public int getAvailabilityStatus() {
        return SystemProperties.getBoolean(SUPPORT_ONE_HANDED_MODE, false)
        return OneHandedSettingsUtils.isSupportOneHandedMode()
                ? BasePreferenceController.AVAILABLE
                : BasePreferenceController.UNSUPPORTED_ON_DEVICE;
    }
@@ -45,6 +42,7 @@ public class OneHandedEnablePreferenceController extends TogglePreferenceControl
    public boolean setChecked(boolean isChecked) {
        OneHandedSettingsUtils.setSettingsOneHandedModeEnabled(mContext,
                isChecked);
        OneHandedSettingsUtils.setSwipeDownNotificationEnabled(mContext, !isChecked);
        return true;
    }

+1 −3
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.settings.gestures;

import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.SystemProperties;

import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
@@ -52,8 +51,7 @@ public class OneHandedSettings extends DashboardFragment {
            new BaseSearchIndexProvider(R.xml.one_handed_settings) {
                @Override
                protected boolean isPageSearchEnabled(Context context) {
                    return SystemProperties.getBoolean(
                            OneHandedEnablePreferenceController.SUPPORT_ONE_HANDED_MODE, false);
                    return OneHandedSettingsUtils.isSupportOneHandedMode();
                }
            };
}
Loading