Loading packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +7 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,13 @@ public class RecentsView extends FrameLayout { return mBackgroundScrim; } /** * Returns whether the nav bar is on the right. */ public boolean isNavBarOnRight() { return mSystemInsets.right > 0; } /** * Returns whether the last task launched was in the freeform stack or not. */ Loading packages/SystemUI/src/com/android/systemui/recents/views/RecentsViewTouchHandler.java +17 −6 Original line number Diff line number Diff line Loading @@ -45,10 +45,14 @@ import java.util.ArrayList; * Represents the dock regions for each orientation. */ class DockRegion { public static TaskStack.DockState[] PHONE_LANDSCAPE = { // We only allow docking to the left for now on small devices // The phone landscape dock states correspond to the opposite end of the screen that the nav bar // appears public static TaskStack.DockState[] PHONE_LANDSCAPE_LEFT = { TaskStack.DockState.LEFT }; public static TaskStack.DockState[] PHONE_LANDSCAPE_RIGHT = { TaskStack.DockState.RIGHT }; public static TaskStack.DockState[] PHONE_PORTRAIT = { // We only allow docking to the top for now on small devices TaskStack.DockState.TOP Loading Loading @@ -113,10 +117,17 @@ public class RecentsViewTouchHandler { boolean isLandscape = mRv.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; RecentsConfiguration config = Recents.getConfiguration(); TaskStack.DockState[] dockStates = isLandscape ? (config.isLargeScreen ? DockRegion.TABLET_LANDSCAPE : DockRegion.PHONE_LANDSCAPE) : (config.isLargeScreen ? DockRegion.TABLET_PORTRAIT : DockRegion.PHONE_PORTRAIT); return dockStates; if (config.isLargeScreen) { return isLandscape ? DockRegion.TABLET_LANDSCAPE : DockRegion.TABLET_PORTRAIT; } else { if (isLandscape) { return mRv.isNavBarOnRight() ? DockRegion.PHONE_LANDSCAPE_LEFT : DockRegion.PHONE_LANDSCAPE_RIGHT; } else { return DockRegion.PHONE_PORTRAIT; } } } /** Loading Loading
packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +7 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,13 @@ public class RecentsView extends FrameLayout { return mBackgroundScrim; } /** * Returns whether the nav bar is on the right. */ public boolean isNavBarOnRight() { return mSystemInsets.right > 0; } /** * Returns whether the last task launched was in the freeform stack or not. */ Loading
packages/SystemUI/src/com/android/systemui/recents/views/RecentsViewTouchHandler.java +17 −6 Original line number Diff line number Diff line Loading @@ -45,10 +45,14 @@ import java.util.ArrayList; * Represents the dock regions for each orientation. */ class DockRegion { public static TaskStack.DockState[] PHONE_LANDSCAPE = { // We only allow docking to the left for now on small devices // The phone landscape dock states correspond to the opposite end of the screen that the nav bar // appears public static TaskStack.DockState[] PHONE_LANDSCAPE_LEFT = { TaskStack.DockState.LEFT }; public static TaskStack.DockState[] PHONE_LANDSCAPE_RIGHT = { TaskStack.DockState.RIGHT }; public static TaskStack.DockState[] PHONE_PORTRAIT = { // We only allow docking to the top for now on small devices TaskStack.DockState.TOP Loading Loading @@ -113,10 +117,17 @@ public class RecentsViewTouchHandler { boolean isLandscape = mRv.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; RecentsConfiguration config = Recents.getConfiguration(); TaskStack.DockState[] dockStates = isLandscape ? (config.isLargeScreen ? DockRegion.TABLET_LANDSCAPE : DockRegion.PHONE_LANDSCAPE) : (config.isLargeScreen ? DockRegion.TABLET_PORTRAIT : DockRegion.PHONE_PORTRAIT); return dockStates; if (config.isLargeScreen) { return isLandscape ? DockRegion.TABLET_LANDSCAPE : DockRegion.TABLET_PORTRAIT; } else { if (isLandscape) { return mRv.isNavBarOnRight() ? DockRegion.PHONE_LANDSCAPE_LEFT : DockRegion.PHONE_LANDSCAPE_RIGHT; } else { return DockRegion.PHONE_PORTRAIT; } } } /** Loading