Merge "Avoid re-launch button show after split switching" into tm-qpr-dev am: 2b9d5ac7cc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19095358 Change-Id: I02f267a7fffbe44d38645425ed1575430af0aa3a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -487,13 +487,25 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
|
|||||||
private DividerSnapAlgorithm getSnapAlgorithm(Context context, Rect rootBounds,
|
private DividerSnapAlgorithm getSnapAlgorithm(Context context, Rect rootBounds,
|
||||||
@Nullable Rect stableInsets) {
|
@Nullable Rect stableInsets) {
|
||||||
final boolean isLandscape = isLandscape(rootBounds);
|
final boolean isLandscape = isLandscape(rootBounds);
|
||||||
|
final Rect insets = stableInsets != null ? stableInsets : getDisplayInsets(context);
|
||||||
|
|
||||||
|
// Make split axis insets value same as the larger one to avoid bounds1 and bounds2
|
||||||
|
// have difference after split switching for solving issues on non-resizable app case.
|
||||||
|
if (isLandscape) {
|
||||||
|
final int largerInsets = Math.max(insets.left, insets.right);
|
||||||
|
insets.set(largerInsets, insets.top, largerInsets, insets.bottom);
|
||||||
|
} else {
|
||||||
|
final int largerInsets = Math.max(insets.top, insets.bottom);
|
||||||
|
insets.set(insets.left, largerInsets, insets.right, largerInsets);
|
||||||
|
}
|
||||||
|
|
||||||
return new DividerSnapAlgorithm(
|
return new DividerSnapAlgorithm(
|
||||||
context.getResources(),
|
context.getResources(),
|
||||||
rootBounds.width(),
|
rootBounds.width(),
|
||||||
rootBounds.height(),
|
rootBounds.height(),
|
||||||
mDividerSize,
|
mDividerSize,
|
||||||
!isLandscape,
|
!isLandscape,
|
||||||
stableInsets != null ? stableInsets : getDisplayInsets(context),
|
insets,
|
||||||
isLandscape ? DOCKED_LEFT : DOCKED_TOP /* dockSide */);
|
isLandscape ? DOCKED_LEFT : DOCKED_TOP /* dockSide */);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user