Merge "Fix weight of media to be 1 in landscape" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-06-23 08:46:40 +00:00
committed by Android (Google) Code Review
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). // start margin of next page).
qsPanelController.setPageMargin(mSideMargins); qsPanelController.setPageMargin(mSideMargins);
} else if (view == mHeader) { } else if (view == mHeader) {
// No content padding for the header. quickStatusBarHeaderController.setContentMargins(mContentPadding, mContentPadding);
} else { } else {
view.setPaddingRelative( view.setPaddingRelative(
mContentPadding, mContentPadding,

View File

@@ -425,7 +425,7 @@ public class QSPanel extends LinearLayout implements Tunable {
LinearLayout.LayoutParams layoutParams = (LayoutParams) hostView.getLayoutParams(); LinearLayout.LayoutParams layoutParams = (LayoutParams) hostView.getLayoutParams();
layoutParams.height = ViewGroup.LayoutParams.WRAP_CONTENT; layoutParams.height = ViewGroup.LayoutParams.WRAP_CONTENT;
layoutParams.width = horizontal ? 0 : ViewGroup.LayoutParams.MATCH_PARENT; 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 // 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 // necessary if the view isn't horizontal, since otherwise the padding is
// carried in the parent of this view (to ensure correct vertical alignment) // 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); mView.onAttach(mIconManager, mQSExpansionPathInterpolator);
mDemoModeController.addCallback(mDemoModeReceiver); mDemoModeController.addCallback(mDemoModeReceiver);
mHeaderQsPanelController.setContentMargins(0, 0);
} }
@Override @Override
@@ -253,6 +252,10 @@ class QuickStatusBarHeaderController extends ViewController<QuickStatusBarHeader
return mMicCameraIndicatorsEnabled || mLocationIndicatorsEnabled; return mMicCameraIndicatorsEnabled || mLocationIndicatorsEnabled;
} }
public void setContentMargins(int marginStart, int marginEnd) {
mHeaderQsPanelController.setContentMargins(marginStart, marginEnd);
}
private static class ClockDemoModeReceiver implements DemoMode { private static class ClockDemoModeReceiver implements DemoMode {
private Clock mClockView; private Clock mClockView;