Loading packages/SystemUI/res/values/dimens.xml +2 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ <dimen name="navigation_bar_size">@*android:dimen/navigation_bar_height</dimen> <!-- Minimum swipe distance to catch the swipe gestures to invoke assist or switch tasks. --> <dimen name="navigation_bar_min_swipe_distance">48dp</dimen> <!-- The distance from a side of device of the navigation bar to start an edge swipe --> <dimen name="navigation_bar_edge_swipe_threshold">60dp</dimen> <!-- thickness (height) of the dead zone at the top of the navigation bar, reducing false presses on navbar buttons; approx 2mm --> Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBackAction.java +5 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,11 @@ public class NavigationBackAction extends NavigationGestureAction { super(navigationBarView, service); } @Override public boolean allowHitTargetToMoveOverDrag() { return true; } @Override public boolean canPerformAction() { return mProxySender.getBackButtonAlpha() > 0; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +8 −2 Original line number Diff line number Diff line Loading @@ -154,6 +154,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav private QuickScrubAction mQuickScrubAction; private QuickStepAction mQuickStepAction; private NavigationBackAction mBackAction; private QuickSwitchAction mQuickSwitchAction; /** * Helper that is responsible for showing the right toast when a disallowed activity operation Loading Loading @@ -326,9 +327,10 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav mQuickScrubAction = new QuickScrubAction(this, mOverviewProxyService); mQuickStepAction = new QuickStepAction(this, mOverviewProxyService); mBackAction = new NavigationBackAction(this, mOverviewProxyService); mQuickSwitchAction = new QuickSwitchAction(this, mOverviewProxyService); mDefaultGestureMap = new NavigationGestureAction[] { mQuickStepAction, null /* swipeDownAction*/, null /* swipeLeftAction */, mQuickScrubAction mQuickScrubAction, null /* swipeLeftEdgeAction */, null /* swipeRightEdgeAction */ }; mPrototypeController = new NavigationPrototypeController(mHandler, mContext); Loading Loading @@ -359,7 +361,9 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav getNavigationActionFromType(assignedMap[0], mDefaultGestureMap[0]), getNavigationActionFromType(assignedMap[1], mDefaultGestureMap[1]), getNavigationActionFromType(assignedMap[2], mDefaultGestureMap[2]), getNavigationActionFromType(assignedMap[3], mDefaultGestureMap[3])); getNavigationActionFromType(assignedMap[3], mDefaultGestureMap[3]), getNavigationActionFromType(assignedMap[4], mDefaultGestureMap[4]), getNavigationActionFromType(assignedMap[5], mDefaultGestureMap[5])); } } Loading @@ -372,6 +376,8 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav return mQuickScrubAction; case NavigationPrototypeController.ACTION_BACK: return mBackAction; case NavigationPrototypeController.ACTION_QUICKSWITCH: return mQuickSwitchAction; default: return defaultAction; } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationGestureAction.java +4 −4 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ public abstract class NavigationGestureAction { /** * @return whether or not to move the button that started gesture over with user input drag */ public boolean requiresDragWithHitTarget() { public boolean allowHitTargetToMoveOverDrag() { return false; } Loading @@ -139,9 +139,9 @@ public abstract class NavigationGestureAction { * Tell if action is enabled. Compared to {@link #canPerformAction()} this is based on settings * if the action is disabled for a particular gesture. For example a back action can be enabled * however if there is nothing to back to then {@link #canPerformAction()} should return false. * In this way if the action requires {@link #requiresDragWithHitTarget()} then if enabled, the * button can be dragged with a large dampening factor during the gesture but will not activate * the action. * In this way if the action requires {@link #allowHitTargetToMoveOverDrag()} then if enabled, * the button can be dragged with a large dampening factor during the gesture but will not * activate the action. * @return true if this action is enabled and can run */ public abstract boolean isEnabled(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationPrototypeController.java +2 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import android.os.Handler; import android.provider.Settings; import android.provider.Settings.SettingNotFoundException; import android.util.Log; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading @@ -46,6 +45,7 @@ public class NavigationPrototypeController extends ContentObserver { static final int ACTION_QUICKSTEP = 1; static final int ACTION_QUICKSCRUB = 2; static final int ACTION_BACK = 3; static final int ACTION_QUICKSWITCH = 4; private OnPrototypeChangedListener mListener; Loading @@ -53,7 +53,7 @@ public class NavigationPrototypeController extends ContentObserver { * Each index corresponds to a different action set in QuickStepController * {@see updateSwipeLTRBackSetting} */ private int[] mActionMap = new int[4]; private int[] mActionMap = new int[6]; private final Context mContext; Loading Loading
packages/SystemUI/res/values/dimens.xml +2 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ <dimen name="navigation_bar_size">@*android:dimen/navigation_bar_height</dimen> <!-- Minimum swipe distance to catch the swipe gestures to invoke assist or switch tasks. --> <dimen name="navigation_bar_min_swipe_distance">48dp</dimen> <!-- The distance from a side of device of the navigation bar to start an edge swipe --> <dimen name="navigation_bar_edge_swipe_threshold">60dp</dimen> <!-- thickness (height) of the dead zone at the top of the navigation bar, reducing false presses on navbar buttons; approx 2mm --> Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBackAction.java +5 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,11 @@ public class NavigationBackAction extends NavigationGestureAction { super(navigationBarView, service); } @Override public boolean allowHitTargetToMoveOverDrag() { return true; } @Override public boolean canPerformAction() { return mProxySender.getBackButtonAlpha() > 0; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +8 −2 Original line number Diff line number Diff line Loading @@ -154,6 +154,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav private QuickScrubAction mQuickScrubAction; private QuickStepAction mQuickStepAction; private NavigationBackAction mBackAction; private QuickSwitchAction mQuickSwitchAction; /** * Helper that is responsible for showing the right toast when a disallowed activity operation Loading Loading @@ -326,9 +327,10 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav mQuickScrubAction = new QuickScrubAction(this, mOverviewProxyService); mQuickStepAction = new QuickStepAction(this, mOverviewProxyService); mBackAction = new NavigationBackAction(this, mOverviewProxyService); mQuickSwitchAction = new QuickSwitchAction(this, mOverviewProxyService); mDefaultGestureMap = new NavigationGestureAction[] { mQuickStepAction, null /* swipeDownAction*/, null /* swipeLeftAction */, mQuickScrubAction mQuickScrubAction, null /* swipeLeftEdgeAction */, null /* swipeRightEdgeAction */ }; mPrototypeController = new NavigationPrototypeController(mHandler, mContext); Loading Loading @@ -359,7 +361,9 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav getNavigationActionFromType(assignedMap[0], mDefaultGestureMap[0]), getNavigationActionFromType(assignedMap[1], mDefaultGestureMap[1]), getNavigationActionFromType(assignedMap[2], mDefaultGestureMap[2]), getNavigationActionFromType(assignedMap[3], mDefaultGestureMap[3])); getNavigationActionFromType(assignedMap[3], mDefaultGestureMap[3]), getNavigationActionFromType(assignedMap[4], mDefaultGestureMap[4]), getNavigationActionFromType(assignedMap[5], mDefaultGestureMap[5])); } } Loading @@ -372,6 +376,8 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav return mQuickScrubAction; case NavigationPrototypeController.ACTION_BACK: return mBackAction; case NavigationPrototypeController.ACTION_QUICKSWITCH: return mQuickSwitchAction; default: return defaultAction; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationGestureAction.java +4 −4 Original line number Diff line number Diff line Loading @@ -112,7 +112,7 @@ public abstract class NavigationGestureAction { /** * @return whether or not to move the button that started gesture over with user input drag */ public boolean requiresDragWithHitTarget() { public boolean allowHitTargetToMoveOverDrag() { return false; } Loading @@ -139,9 +139,9 @@ public abstract class NavigationGestureAction { * Tell if action is enabled. Compared to {@link #canPerformAction()} this is based on settings * if the action is disabled for a particular gesture. For example a back action can be enabled * however if there is nothing to back to then {@link #canPerformAction()} should return false. * In this way if the action requires {@link #requiresDragWithHitTarget()} then if enabled, the * button can be dragged with a large dampening factor during the gesture but will not activate * the action. * In this way if the action requires {@link #allowHitTargetToMoveOverDrag()} then if enabled, * the button can be dragged with a large dampening factor during the gesture but will not * activate the action. * @return true if this action is enabled and can run */ public abstract boolean isEnabled(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationPrototypeController.java +2 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import android.os.Handler; import android.provider.Settings; import android.provider.Settings.SettingNotFoundException; import android.util.Log; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; Loading @@ -46,6 +45,7 @@ public class NavigationPrototypeController extends ContentObserver { static final int ACTION_QUICKSTEP = 1; static final int ACTION_QUICKSCRUB = 2; static final int ACTION_BACK = 3; static final int ACTION_QUICKSWITCH = 4; private OnPrototypeChangedListener mListener; Loading @@ -53,7 +53,7 @@ public class NavigationPrototypeController extends ContentObserver { * Each index corresponds to a different action set in QuickStepController * {@see updateSwipeLTRBackSetting} */ private int[] mActionMap = new int[4]; private int[] mActionMap = new int[6]; private final Context mContext; Loading