Ensuring that the dock state is opposite of the nav bar. am: c54c748ede
am: b1bf36532a
Change-Id: Idb843bf5c5885639d4e8620fba3da84cbb566d53
This commit is contained in:
@@ -222,6 +222,13 @@ public class RecentsView extends FrameLayout {
|
|||||||
return mBackgroundScrim;
|
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.
|
* Returns whether the last task launched was in the freeform stack or not.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -45,10 +45,14 @@ import java.util.ArrayList;
|
|||||||
* Represents the dock regions for each orientation.
|
* Represents the dock regions for each orientation.
|
||||||
*/
|
*/
|
||||||
class DockRegion {
|
class DockRegion {
|
||||||
public static TaskStack.DockState[] PHONE_LANDSCAPE = {
|
// The phone landscape dock states correspond to the opposite end of the screen that the nav bar
|
||||||
// We only allow docking to the left for now on small devices
|
// appears
|
||||||
|
public static TaskStack.DockState[] PHONE_LANDSCAPE_LEFT = {
|
||||||
TaskStack.DockState.LEFT
|
TaskStack.DockState.LEFT
|
||||||
};
|
};
|
||||||
|
public static TaskStack.DockState[] PHONE_LANDSCAPE_RIGHT = {
|
||||||
|
TaskStack.DockState.RIGHT
|
||||||
|
};
|
||||||
public static TaskStack.DockState[] PHONE_PORTRAIT = {
|
public static TaskStack.DockState[] PHONE_PORTRAIT = {
|
||||||
// We only allow docking to the top for now on small devices
|
// We only allow docking to the top for now on small devices
|
||||||
TaskStack.DockState.TOP
|
TaskStack.DockState.TOP
|
||||||
@@ -113,10 +117,17 @@ public class RecentsViewTouchHandler {
|
|||||||
boolean isLandscape = mRv.getResources().getConfiguration().orientation ==
|
boolean isLandscape = mRv.getResources().getConfiguration().orientation ==
|
||||||
Configuration.ORIENTATION_LANDSCAPE;
|
Configuration.ORIENTATION_LANDSCAPE;
|
||||||
RecentsConfiguration config = Recents.getConfiguration();
|
RecentsConfiguration config = Recents.getConfiguration();
|
||||||
TaskStack.DockState[] dockStates = isLandscape ?
|
if (config.isLargeScreen) {
|
||||||
(config.isLargeScreen ? DockRegion.TABLET_LANDSCAPE : DockRegion.PHONE_LANDSCAPE) :
|
return isLandscape ? DockRegion.TABLET_LANDSCAPE : DockRegion.TABLET_PORTRAIT;
|
||||||
(config.isLargeScreen ? DockRegion.TABLET_PORTRAIT : DockRegion.PHONE_PORTRAIT);
|
} else {
|
||||||
return dockStates;
|
if (isLandscape) {
|
||||||
|
return mRv.isNavBarOnRight()
|
||||||
|
? DockRegion.PHONE_LANDSCAPE_LEFT
|
||||||
|
: DockRegion.PHONE_LANDSCAPE_RIGHT;
|
||||||
|
} else {
|
||||||
|
return DockRegion.PHONE_PORTRAIT;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user