Merge "Consider screen insets when setting smallestWidthDp" into tm-dev am: fc447969a9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17147681 Change-Id: I75931322cecc30ac1e82270b395a24c0a5066c7b
This commit is contained in:
@@ -532,7 +532,9 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int getSmallestWidthDp(Rect bounds) {
|
private int getSmallestWidthDp(Rect bounds) {
|
||||||
final int minWidth = Math.min(bounds.width(), bounds.height());
|
mTempRect.set(bounds);
|
||||||
|
mTempRect.inset(getDisplayInsets(mContext));
|
||||||
|
final int minWidth = Math.min(mTempRect.width(), mTempRect.height());
|
||||||
final float density = mContext.getResources().getDisplayMetrics().density;
|
final float density = mContext.getResources().getDisplayMetrics().density;
|
||||||
return (int) (minWidth / density);
|
return (int) (minWidth / density);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user