Merge "VolumeDialogImpl: Respect multiple visible rows in landscape" am: ef9dfbfa4a am: 82130c3a9f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2047823 Change-Id: I4e47e89b888255563d1efe634b5c6b6ec4d16534 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -378,11 +378,13 @@ public class VolumeDialogImpl implements VolumeDialog,
|
|||||||
|
|
||||||
// The ringer and rows container has extra height at the top to fit the expanded ringer
|
// The ringer and rows container has extra height at the top to fit the expanded ringer
|
||||||
// drawer. This area should not be touchable unless the ringer drawer is open.
|
// drawer. This area should not be touchable unless the ringer drawer is open.
|
||||||
|
// In landscape the ringer expands to the left and it has to be ensured that if there
|
||||||
|
// are multiple rows they are touchable.
|
||||||
if (view == mTopContainer && !mIsRingerDrawerOpen) {
|
if (view == mTopContainer && !mIsRingerDrawerOpen) {
|
||||||
if (!isLandscape()) {
|
if (!isLandscape()) {
|
||||||
y += getRingerDrawerOpenExtraSize();
|
y += getRingerDrawerOpenExtraSize();
|
||||||
} else {
|
} else if (getRingerDrawerOpenExtraSize() > getVisibleRowsExtraSize()) {
|
||||||
x += getRingerDrawerOpenExtraSize();
|
x += (getRingerDrawerOpenExtraSize() - getVisibleRowsExtraSize());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1968,6 +1970,21 @@ public class VolumeDialogImpl implements VolumeDialog,
|
|||||||
return (mRingerCount - 1) * mRingerDrawerItemSize;
|
return (mRingerCount - 1) * mRingerDrawerItemSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the size of the additionally visible rows next to the default stream.
|
||||||
|
* An additional row is visible for example while receiving a voice call.
|
||||||
|
*/
|
||||||
|
private int getVisibleRowsExtraSize() {
|
||||||
|
VolumeRow activeRow = getActiveRow();
|
||||||
|
int visibleRows = 0;
|
||||||
|
for (final VolumeRow row : mRows) {
|
||||||
|
if (shouldBeVisibleH(row, activeRow)) {
|
||||||
|
visibleRows++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (visibleRows - 1) * (mDialogWidth + mRingerRowsPadding);
|
||||||
|
}
|
||||||
|
|
||||||
private void updateBackgroundForDrawerClosedAmount() {
|
private void updateBackgroundForDrawerClosedAmount() {
|
||||||
if (mRingerAndDrawerContainerBackground == null) {
|
if (mRingerAndDrawerContainerBackground == null) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user