From 98d08581386c25da3d89a8536b8bab8ad2eebf4b Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Wed, 14 Aug 2019 14:55:27 -0700 Subject: Update the string on how to exit pinning mode in gesture navigation Bug: 139438042 Test: Back gesture in screen pinning mode Change-Id: Ia21e0324cb9a78c6664f4ba787189c6a2423a03d Merged-In: Ia21e0324cb9a78c6664f4ba787189c6a2423a03d --- packages/SystemUI/res/values/strings.xml | 2 ++ .../android/systemui/statusbar/phone/NavigationBarView.java | 4 +++- .../android/systemui/statusbar/phone/ScreenPinningNotify.java | 10 ++++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index fab724267e3f..19e682b4b6a4 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -1386,6 +1386,8 @@ buttons To unpin this screen, touch & hold Back and Home buttons + + To unpin this screen, swipe up & hold Got it diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java index f689a3eadf58..a2740c8dc322 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -17,6 +17,7 @@ package com.android.systemui.statusbar.phone; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON; +import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_HOME_DISABLED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED; @@ -920,7 +921,8 @@ public class NavigationBarView extends FrameLayout implements } public void showPinningEscapeToast() { - mScreenPinningNotify.showEscapeToast(isRecentsButtonVisible()); + mScreenPinningNotify.showEscapeToast( + mNavBarMode == NAV_BAR_MODE_GESTURAL, isRecentsButtonVisible()); } public boolean isVertical() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScreenPinningNotify.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScreenPinningNotify.java index f8731b4980d9..071e00d08d67 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScreenPinningNotify.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScreenPinningNotify.java @@ -51,7 +51,7 @@ public class ScreenPinningNotify { } /** Show a toast that describes the gesture the user should use to escape pinned mode. */ - public void showEscapeToast(boolean isRecentsButtonVisible) { + public void showEscapeToast(boolean isGestureNavEnabled, boolean isRecentsButtonVisible) { long showToastTime = SystemClock.elapsedRealtime(); if ((showToastTime - mLastShowToastTime) < SHOW_TOAST_MINIMUM_INTERVAL) { Slog.i(TAG, "Ignore toast since it is requested in very short interval."); @@ -60,9 +60,11 @@ public class ScreenPinningNotify { if (mLastToast != null) { mLastToast.cancel(); } - mLastToast = makeAllUserToastAndShow(isRecentsButtonVisible - ? R.string.screen_pinning_toast - : R.string.screen_pinning_toast_recents_invisible); + mLastToast = makeAllUserToastAndShow(isGestureNavEnabled + ? R.string.screen_pinning_toast_gesture_nav + : isRecentsButtonVisible + ? R.string.screen_pinning_toast + : R.string.screen_pinning_toast_recents_invisible); mLastShowToastTime = showToastTime; } -- cgit v1.2.3-59-g8ed1b