Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java +1 −4 Original line number Diff line number Diff line Loading @@ -75,7 +75,6 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture private int mTouchDownY; private boolean mDownOnRecents; private VelocityTracker mVelocityTracker; private boolean mIsInScreenPinning; private boolean mNotificationsVisibleOnDown; private boolean mDockWindowEnabled; Loading Loading @@ -110,7 +109,6 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture public boolean onInterceptTouchEvent(MotionEvent event) { if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { mIsInScreenPinning = mNavigationBarView.inScreenPinning(); mNotificationsVisibleOnDown = !mStatusBar.isPresenterFullyCollapsed(); } if (!canHandleGestures()) { Loading Loading @@ -277,8 +275,7 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture } private boolean canHandleGestures() { return !mIsInScreenPinning && !mStatusBar.isKeyguardShowing() && !mNotificationsVisibleOnDown; return !mStatusBar.isKeyguardShowing() && !mNotificationsVisibleOnDown; } private int calculateDragMode() { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +20 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,13 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav private int mRotateBtnStyle = R.style.RotateButtonCCWStart90; /** * Helper that is responsible for showing the right toast when a disallowed activity operation * occurred. In pinned mode, we show instructions on how to break out of this mode, whilst in * fully locked mode we only show that unlocking is blocked. */ private ScreenPinningNotify mScreenPinningNotify; private class NavTransitionListener implements TransitionListener { private boolean mBackTransitioning; private boolean mHomeAppearing; Loading Loading @@ -286,6 +293,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav mConfiguration.updateFrom(context.getResources().getConfiguration()); reloadNavIcons(); mScreenPinningNotify = new ScreenPinningNotify(mContext); mBarTransitions = new NavigationBarTransitions(this); mButtonDispatchers.put(R.id.back, new ButtonDispatcher(R.id.back)); Loading Loading @@ -983,6 +991,18 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav mBarTransitions.reapplyDarkIntensity(); } public void showPinningEnterExitToast(boolean entering) { if (entering) { mScreenPinningNotify.showPinningStartToast(); } else { mScreenPinningNotify.showPinningExitToast(); } } public void showPinningEscapeToast() { mScreenPinningNotify.showEscapeToast(isRecentsButtonVisible()); } public boolean isVertical() { return mVertical; } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java +16 −2 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ public class QuickStepController implements GestureHelper { private AnimatorSet mTrackAnimator; private ButtonDispatcher mHitTarget; private View mCurrentNavigationBarView; private boolean mIsInScreenPinning; private final Handler mHandler = new Handler(); private final Rect mTrackRect = new Rect(); Loading Loading @@ -195,6 +196,7 @@ public class QuickStepController implements GestureHelper { case MotionEvent.ACTION_DOWN: { int x = (int) event.getX(); int y = (int) event.getY(); mIsInScreenPinning = mNavigationBarView.inScreenPinning(); // End any existing quickscrub animations before starting the new transition if (mTrackAnimator != null) { Loading Loading @@ -298,8 +300,8 @@ public class QuickStepController implements GestureHelper { // Proxy motion events to launcher if not handled by quick scrub // Proxy motion events up/cancel that would be sent after long press on any nav button if (!mQuickScrubActive && (mAllowGestureDetection || action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP)) { if (!mQuickScrubActive && !mIsInScreenPinning && (mAllowGestureDetection || action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP)) { proxyMotionEvents(event); } return mQuickScrubActive || mQuickStepStarted; Loading Loading @@ -382,6 +384,12 @@ public class QuickStepController implements GestureHelper { } private void startQuickStep(MotionEvent event) { if (mIsInScreenPinning) { mNavigationBarView.showPinningEscapeToast(); mAllowGestureDetection = false; return; } mQuickStepStarted = true; event.transform(mTransformGlobalMatrix); try { Loading @@ -407,6 +415,12 @@ public class QuickStepController implements GestureHelper { } private void startQuickScrub() { if (mIsInScreenPinning) { mNavigationBarView.showPinningEscapeToast(); mAllowGestureDetection = false; return; } if (!mQuickScrubActive) { mQuickScrubActive = true; mLightTrackColor = mContext.getColor(R.color.quick_step_track_background_light); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +5 −14 Original line number Diff line number Diff line Loading @@ -423,13 +423,6 @@ public class StatusBar extends SystemUI implements DemoMode, protected KeyguardViewMediator mKeyguardViewMediator; private ZenModeController mZenController; /** * Helper that is responsible for showing the right toast when a disallowed activity operation * occurred. In pinned mode, we show instructions on how to break out of this mode, whilst in * fully locked mode we only show that unlocking is blocked. */ private ScreenPinningNotify mScreenPinningNotify; // for disabling the status bar private int mDisabled1 = 0; private int mDisabled2 = 0; Loading Loading @@ -902,7 +895,6 @@ public class StatusBar extends SystemUI implements DemoMode, } catch (RemoteException ex) { // no window manager? good luck with that } mScreenPinningNotify = new ScreenPinningNotify(mContext); mStackScroller.setLongPressListener(mEntryManager.getNotificationLongClicker()); mStackScroller.setStatusBar(this); mStackScroller.setGroupManager(mGroupManager); Loading Loading @@ -2241,17 +2233,16 @@ public class StatusBar extends SystemUI implements DemoMode, @Override public void showPinningEnterExitToast(boolean entering) { if (entering) { mScreenPinningNotify.showPinningStartToast(); } else { mScreenPinningNotify.showPinningExitToast(); if (getNavigationBarView() != null) { getNavigationBarView().showPinningEnterExitToast(entering); } } @Override public void showPinningEscapeToast() { mScreenPinningNotify.showEscapeToast(getNavigationBarView() == null || getNavigationBarView().isRecentsButtonVisible()); if (getNavigationBarView() != null) { getNavigationBarView().showPinningEscapeToast(); } } boolean panelsEnabled() { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java +1 −4 Original line number Diff line number Diff line Loading @@ -75,7 +75,6 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture private int mTouchDownY; private boolean mDownOnRecents; private VelocityTracker mVelocityTracker; private boolean mIsInScreenPinning; private boolean mNotificationsVisibleOnDown; private boolean mDockWindowEnabled; Loading Loading @@ -110,7 +109,6 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture public boolean onInterceptTouchEvent(MotionEvent event) { if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { mIsInScreenPinning = mNavigationBarView.inScreenPinning(); mNotificationsVisibleOnDown = !mStatusBar.isPresenterFullyCollapsed(); } if (!canHandleGestures()) { Loading Loading @@ -277,8 +275,7 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture } private boolean canHandleGestures() { return !mIsInScreenPinning && !mStatusBar.isKeyguardShowing() && !mNotificationsVisibleOnDown; return !mStatusBar.isKeyguardShowing() && !mNotificationsVisibleOnDown; } private int calculateDragMode() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +20 −0 Original line number Diff line number Diff line Loading @@ -161,6 +161,13 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav private int mRotateBtnStyle = R.style.RotateButtonCCWStart90; /** * Helper that is responsible for showing the right toast when a disallowed activity operation * occurred. In pinned mode, we show instructions on how to break out of this mode, whilst in * fully locked mode we only show that unlocking is blocked. */ private ScreenPinningNotify mScreenPinningNotify; private class NavTransitionListener implements TransitionListener { private boolean mBackTransitioning; private boolean mHomeAppearing; Loading Loading @@ -286,6 +293,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav mConfiguration.updateFrom(context.getResources().getConfiguration()); reloadNavIcons(); mScreenPinningNotify = new ScreenPinningNotify(mContext); mBarTransitions = new NavigationBarTransitions(this); mButtonDispatchers.put(R.id.back, new ButtonDispatcher(R.id.back)); Loading Loading @@ -983,6 +991,18 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav mBarTransitions.reapplyDarkIntensity(); } public void showPinningEnterExitToast(boolean entering) { if (entering) { mScreenPinningNotify.showPinningStartToast(); } else { mScreenPinningNotify.showPinningExitToast(); } } public void showPinningEscapeToast() { mScreenPinningNotify.showEscapeToast(isRecentsButtonVisible()); } public boolean isVertical() { return mVertical; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java +16 −2 Original line number Diff line number Diff line Loading @@ -84,6 +84,7 @@ public class QuickStepController implements GestureHelper { private AnimatorSet mTrackAnimator; private ButtonDispatcher mHitTarget; private View mCurrentNavigationBarView; private boolean mIsInScreenPinning; private final Handler mHandler = new Handler(); private final Rect mTrackRect = new Rect(); Loading Loading @@ -195,6 +196,7 @@ public class QuickStepController implements GestureHelper { case MotionEvent.ACTION_DOWN: { int x = (int) event.getX(); int y = (int) event.getY(); mIsInScreenPinning = mNavigationBarView.inScreenPinning(); // End any existing quickscrub animations before starting the new transition if (mTrackAnimator != null) { Loading Loading @@ -298,8 +300,8 @@ public class QuickStepController implements GestureHelper { // Proxy motion events to launcher if not handled by quick scrub // Proxy motion events up/cancel that would be sent after long press on any nav button if (!mQuickScrubActive && (mAllowGestureDetection || action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP)) { if (!mQuickScrubActive && !mIsInScreenPinning && (mAllowGestureDetection || action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP)) { proxyMotionEvents(event); } return mQuickScrubActive || mQuickStepStarted; Loading Loading @@ -382,6 +384,12 @@ public class QuickStepController implements GestureHelper { } private void startQuickStep(MotionEvent event) { if (mIsInScreenPinning) { mNavigationBarView.showPinningEscapeToast(); mAllowGestureDetection = false; return; } mQuickStepStarted = true; event.transform(mTransformGlobalMatrix); try { Loading @@ -407,6 +415,12 @@ public class QuickStepController implements GestureHelper { } private void startQuickScrub() { if (mIsInScreenPinning) { mNavigationBarView.showPinningEscapeToast(); mAllowGestureDetection = false; return; } if (!mQuickScrubActive) { mQuickScrubActive = true; mLightTrackColor = mContext.getColor(R.color.quick_step_track_background_light); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +5 −14 Original line number Diff line number Diff line Loading @@ -423,13 +423,6 @@ public class StatusBar extends SystemUI implements DemoMode, protected KeyguardViewMediator mKeyguardViewMediator; private ZenModeController mZenController; /** * Helper that is responsible for showing the right toast when a disallowed activity operation * occurred. In pinned mode, we show instructions on how to break out of this mode, whilst in * fully locked mode we only show that unlocking is blocked. */ private ScreenPinningNotify mScreenPinningNotify; // for disabling the status bar private int mDisabled1 = 0; private int mDisabled2 = 0; Loading Loading @@ -902,7 +895,6 @@ public class StatusBar extends SystemUI implements DemoMode, } catch (RemoteException ex) { // no window manager? good luck with that } mScreenPinningNotify = new ScreenPinningNotify(mContext); mStackScroller.setLongPressListener(mEntryManager.getNotificationLongClicker()); mStackScroller.setStatusBar(this); mStackScroller.setGroupManager(mGroupManager); Loading Loading @@ -2241,17 +2233,16 @@ public class StatusBar extends SystemUI implements DemoMode, @Override public void showPinningEnterExitToast(boolean entering) { if (entering) { mScreenPinningNotify.showPinningStartToast(); } else { mScreenPinningNotify.showPinningExitToast(); if (getNavigationBarView() != null) { getNavigationBarView().showPinningEnterExitToast(entering); } } @Override public void showPinningEscapeToast() { mScreenPinningNotify.showEscapeToast(getNavigationBarView() == null || getNavigationBarView().isRecentsButtonVisible()); if (getNavigationBarView() != null) { getNavigationBarView().showPinningEscapeToast(); } } boolean panelsEnabled() { Loading