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

Commit acc8c184 authored by Thecrazyskull's avatar Thecrazyskull Committed by Bruno Martins
Browse files

Launcher3: Double tap on home screen to turn off screen



Co-authored-by: default avatarHikari-no-Tenshi <kyryljan.serhij@gmail.com>
Co-authored-by: default avatarLuca Stefani <luca.stefani.ge1@gmail.com>
Change-Id: I554c005d5e523aca0842c78a353686e86af1a7f2
parent 64794259
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -101,6 +101,7 @@ import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.HapticFeedbackConstants;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.widget.AnalogClock;
import android.widget.TextClock;
@@ -1318,6 +1319,12 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer,
                .playPlaceholderDismissAnim(this, splitDismissEvent);
    }

    @Override
    public void onSleepEvent(MotionEvent ev) {
        super.onSleepEvent(ev);
        SystemUiProxy.INSTANCE.get(this).onSleepEvent(ev);
    }

    @Override
    public OverviewActionsView<?> getActionsView() {
        return mActionsView;
+8 −0
Original line number Diff line number Diff line
@@ -419,6 +419,14 @@ class SystemUiProxy @Inject constructor(
        }
    }

    @MainThread
    fun onSleepEvent(event: MotionEvent) {
        Preconditions.assertUIThread()
        executeWithErrorLog({ "Failed call onSleepEvent with arg: $event" }) {
            systemUiProxy?.onSleepEvent(event)
        }
    }

    fun onStatusBarTrackpadEvent(event: MotionEvent) =
        executeWithErrorLog({ "Failed call onStatusBarTrackpadEvent with arg: $event" }) {
            systemUiProxy?.onStatusBarTrackpadEvent(event)
+4 −0
Original line number Diff line number Diff line
@@ -47,6 +47,10 @@
    <string name="drawer_open_keyboard_title">Swipe to start search</string>
    <string name="drawer_open_keyboard_summary">Open keyboard whenever app drawer becomes visible</string>

    <!-- Sleep gesture -->
    <string name="pref_sleep_gesture_title">Double tap to sleep</string>
    <string name="pref_sleep_gesture_summary">Double tap empty space on home screen to turn off the screen</string>

    <!-- Trust apps -->
    <string name="trust_apps_manager_name">Hidden &amp; Protected apps</string>
    <string name="trust_apps_auth_manager">Unlock to manage the hidden and protected apps</string>
+7 −0
Original line number Diff line number Diff line
@@ -26,6 +26,13 @@
        android:summaryOn="@string/settings_lock_layout_summary_on"
        android:summaryOff="@string/settings_lock_layout_summary_off" />

    <SwitchPreferenceCompat
        android:defaultValue="false"
        android:key="pref_sleep_gesture"
        android:persistent="true"
        android:title="@string/pref_sleep_gesture_title"
        android:summary="@string/pref_sleep_gesture_summary" />

    <com.android.launcher3.settings.NotificationDotsPreference
        android:key="pref_icon_badging"
        android:title="@string/notification_dots_title"
+5 −0
Original line number Diff line number Diff line
@@ -2673,6 +2673,11 @@ public class Launcher extends StatefulActivity<LauncherState>
        // Overridden
    }

    /** To be overrideden by subclasses */
    public void onSleepEvent(MotionEvent ev) {
        // Overridden
    }

    public void closeOpenViews() {
        closeOpenViews(true);
    }
Loading