Fix weight of media to be 1 in landscape

Also, fix content margins in QuickQSPanel to properly align media.

Test: manual
Fixes: 191686143
Change-Id: Ic5a4a53ac4c65eb386058eadfdbad2adb2a353e1
This commit is contained in:
Fabian Kozynski
2021-06-22 15:03:39 -04:00
parent 184c61395e
commit dec30a7f95
3 changed files with 6 additions and 3 deletions

View File

@@ -297,7 +297,7 @@ public class QSContainerImpl extends FrameLayout {
// start margin of next page).
qsPanelController.setPageMargin(mSideMargins);
} else if (view == mHeader) {
// No content padding for the header.
quickStatusBarHeaderController.setContentMargins(mContentPadding, mContentPadding);
} else {
view.setPaddingRelative(
mContentPadding,

View File

@@ -425,7 +425,7 @@ public class QSPanel extends LinearLayout implements Tunable {
LinearLayout.LayoutParams layoutParams = (LayoutParams) hostView.getLayoutParams();
layoutParams.height = ViewGroup.LayoutParams.WRAP_CONTENT;
layoutParams.width = horizontal ? 0 : ViewGroup.LayoutParams.MATCH_PARENT;
layoutParams.weight = horizontal ? 1.2f : 0;
layoutParams.weight = horizontal ? 1f : 0;
// Add any bottom margin, such that the total spacing is correct. This is only
// necessary if the view isn't horizontal, since otherwise the padding is
// carried in the parent of this view (to ensure correct vertical alignment)

View File

@@ -177,7 +177,6 @@ class QuickStatusBarHeaderController extends ViewController<QuickStatusBarHeader
mView.onAttach(mIconManager, mQSExpansionPathInterpolator);
mDemoModeController.addCallback(mDemoModeReceiver);
mHeaderQsPanelController.setContentMargins(0, 0);
}
@Override
@@ -253,6 +252,10 @@ class QuickStatusBarHeaderController extends ViewController<QuickStatusBarHeader
return mMicCameraIndicatorsEnabled || mLocationIndicatorsEnabled;
}
public void setContentMargins(int marginStart, int marginEnd) {
mHeaderQsPanelController.setContentMargins(marginStart, marginEnd);
}
private static class ClockDemoModeReceiver implements DemoMode {
private Clock mClockView;