Merge "Vertically center SCM-eligible on warm launch" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
cb3a43feaa
@@ -7922,9 +7922,17 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
// Above coordinates are in "@" space, now place "*" and "#" to screen space.
|
// Above coordinates are in "@" space, now place "*" and "#" to screen space.
|
||||||
final boolean fillContainer = resolvedBounds.equals(containingBounds);
|
final boolean fillContainer = resolvedBounds.equals(containingBounds);
|
||||||
final int screenPosX = fillContainer ? containerBounds.left : containerAppBounds.left;
|
final int screenPosX = fillContainer ? containerBounds.left : containerAppBounds.left;
|
||||||
final int screenPosY = mSizeCompatBounds == null
|
// If the activity is not in size compat mode, calculate vertical centering
|
||||||
|
// from the container and resolved bounds.
|
||||||
|
// If the activity is in size compat mode, calculate vertical centering
|
||||||
|
// from the container and size compat bounds.
|
||||||
|
// The container bounds contain the parent bounds offset in the display, for
|
||||||
|
// example when an activity is in the lower split of split screen.
|
||||||
|
final int screenPosY = (mSizeCompatBounds == null
|
||||||
? (containerBounds.height() - resolvedBounds.height()) / 2
|
? (containerBounds.height() - resolvedBounds.height()) / 2
|
||||||
: (containerBounds.height() - mSizeCompatBounds.height()) / 2;
|
: (containerBounds.height() - mSizeCompatBounds.height()) / 2)
|
||||||
|
+ containerBounds.top;
|
||||||
|
|
||||||
if (screenPosX != 0 || screenPosY != 0) {
|
if (screenPosX != 0 || screenPosY != 0) {
|
||||||
if (mSizeCompatBounds != null) {
|
if (mSizeCompatBounds != null) {
|
||||||
mSizeCompatBounds.offset(screenPosX, screenPosY);
|
mSizeCompatBounds.offset(screenPosX, screenPosY);
|
||||||
|
|||||||
Reference in New Issue
Block a user