Merge "Move bottom padding from ScrollView to child" into tm-dev
This commit is contained in:
@@ -139,12 +139,11 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
|
||||
|
||||
void updateResources(QSPanelController qsPanelController,
|
||||
QuickStatusBarHeaderController quickStatusBarHeaderController) {
|
||||
int bottomPadding = getResources().getDimensionPixelSize(R.dimen.qs_panel_padding_bottom);
|
||||
mQSPanelContainer.setPaddingRelative(
|
||||
mQSPanelContainer.getPaddingStart(),
|
||||
QSUtils.getQsHeaderSystemIconsAreaHeight(mContext),
|
||||
mQSPanelContainer.getPaddingEnd(),
|
||||
bottomPadding);
|
||||
mQSPanelContainer.getPaddingBottom());
|
||||
|
||||
int horizontalMargins = getResources().getDimensionPixelSize(R.dimen.qs_horizontal_margin);
|
||||
int horizontalPadding = getResources().getDimensionPixelSize(
|
||||
|
||||
@@ -362,11 +362,11 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
protected void updatePadding() {
|
||||
final Resources res = mContext.getResources();
|
||||
int paddingTop = res.getDimensionPixelSize(R.dimen.qs_panel_padding_top);
|
||||
// Bottom padding only when there's a new footer with its height.
|
||||
int paddingBottom = res.getDimensionPixelSize(R.dimen.qs_panel_padding_bottom);
|
||||
setPaddingRelative(getPaddingStart(),
|
||||
paddingTop,
|
||||
getPaddingEnd(),
|
||||
getPaddingBottom());
|
||||
paddingBottom);
|
||||
}
|
||||
|
||||
void addOnConfigurationChangedListener(OnConfigurationChangedListener listener) {
|
||||
|
||||
@@ -57,6 +57,7 @@ class QSContainerImplTest : SysuiTestCase() {
|
||||
|
||||
@Test
|
||||
fun testContainerBottomPadding() {
|
||||
val originalPadding = qsPanelContainer.paddingBottom
|
||||
qsContainer.updateResources(
|
||||
qsPanelController,
|
||||
quickStatusBarHeaderController
|
||||
@@ -66,7 +67,7 @@ class QSContainerImplTest : SysuiTestCase() {
|
||||
anyInt(),
|
||||
anyInt(),
|
||||
anyInt(),
|
||||
eq(mContext.resources.getDimensionPixelSize(R.dimen.footer_actions_height))
|
||||
eq(originalPadding)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -150,6 +150,14 @@ class QSPanelTest : SysuiTestCase() {
|
||||
assertThat(footer.isVisibleToUser).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testBottomPadding() {
|
||||
val padding = 10
|
||||
context.orCreateTestableResources.addOverride(R.dimen.qs_panel_padding_bottom, padding)
|
||||
qsPanel.updatePadding()
|
||||
assertThat(qsPanel.paddingBottom).isEqualTo(padding)
|
||||
}
|
||||
|
||||
private infix fun View.isLeftOf(other: View): Boolean {
|
||||
val rect = Rect()
|
||||
getBoundsOnScreen(rect)
|
||||
|
||||
Reference in New Issue
Block a user