Fix vertical size when using new headers
For the new headers, we shouldn't be looking at quick_qs_offset_header. Instead, use 48dp for QQS offset. This is needed because with combined headers, the height of the header is always the same. Without this CL, in some devices, there's a lot of blank space under the header, because the system expects them to be larger. Test: manual, multiple devices and screen sizes Bug: 215584502 Change-Id: Ic6f4c45eb4e21891a073f11bb328497a7807edac
This commit is contained in:
@@ -407,7 +407,7 @@
|
||||
<dimen name="match_parent">-1px</dimen>
|
||||
|
||||
<!-- Height of status bar in split shade mode - visible only on large screens -->
|
||||
<dimen name="large_screen_shade_header_height">@*android:dimen/quick_qs_offset_height</dimen>
|
||||
<dimen name="large_screen_shade_header_height">48dp</dimen>
|
||||
<dimen name="large_screen_shade_header_min_height">@dimen/qs_header_row_min_height</dimen>
|
||||
<dimen name="large_screen_shade_header_left_padding">@dimen/qs_horizontal_margin</dimen>
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
android:id="@+id/privacy_container">
|
||||
<Layout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_height="@dimen/large_screen_shade_header_min_height"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/date"
|
||||
app:layout_constraintBottom_toBottomOf="@id/date"
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
android:id="@+id/privacy_container">
|
||||
<Layout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_height="@dimen/large_screen_shade_header_min_height"
|
||||
app:layout_constraintStart_toEndOf="@id/date"
|
||||
app:layout_constraintEnd_toEndOf="@id/end_guide"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
||||
@@ -29,6 +29,7 @@ import android.widget.FrameLayout;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.qs.customize.QSCustomizer;
|
||||
import com.android.systemui.util.LargeScreenUtils;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
|
||||
@@ -52,6 +53,7 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
|
||||
private boolean mQsDisabled;
|
||||
private int mContentHorizontalPadding = -1;
|
||||
private boolean mClippingEnabled;
|
||||
private boolean mUseCombinedHeaders;
|
||||
|
||||
public QSContainerImpl(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
@@ -66,6 +68,10 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
|
||||
setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
|
||||
}
|
||||
|
||||
void setUseCombinedHeaders(boolean useCombinedHeaders) {
|
||||
mUseCombinedHeaders = useCombinedHeaders;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOverlappingRendering() {
|
||||
return false;
|
||||
@@ -143,9 +149,15 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
|
||||
|
||||
void updateResources(QSPanelController qsPanelController,
|
||||
QuickStatusBarHeaderController quickStatusBarHeaderController) {
|
||||
int topPadding = QSUtils.getQsHeaderSystemIconsAreaHeight(mContext);
|
||||
if (mUseCombinedHeaders
|
||||
&& !LargeScreenUtils.shouldUseLargeScreenShadeHeader(mContext.getResources())) {
|
||||
topPadding = mContext.getResources()
|
||||
.getDimensionPixelSize(R.dimen.large_screen_shade_header_height);
|
||||
}
|
||||
mQSPanelContainer.setPaddingRelative(
|
||||
mQSPanelContainer.getPaddingStart(),
|
||||
QSUtils.getQsHeaderSystemIconsAreaHeight(mContext),
|
||||
topPadding,
|
||||
mQSPanelContainer.getPaddingEnd(),
|
||||
mQSPanelContainer.getPaddingBottom());
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ import android.content.res.Configuration;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.systemui.flags.FeatureFlags;
|
||||
import com.android.systemui.flags.Flags;
|
||||
import com.android.systemui.plugins.FalsingManager;
|
||||
import com.android.systemui.qs.dagger.QSScope;
|
||||
import com.android.systemui.statusbar.policy.ConfigurationController;
|
||||
@@ -37,7 +39,6 @@ public class QSContainerImplController extends ViewController<QSContainerImpl> {
|
||||
private final ConfigurationController mConfigurationController;
|
||||
private final FalsingManager mFalsingManager;
|
||||
private final NonInterceptingScrollView mQSPanelContainer;
|
||||
|
||||
private final ConfigurationController.ConfigurationListener mConfigurationListener =
|
||||
new ConfigurationController.ConfigurationListener() {
|
||||
@Override
|
||||
@@ -65,13 +66,15 @@ public class QSContainerImplController extends ViewController<QSContainerImpl> {
|
||||
QSPanelController qsPanelController,
|
||||
QuickStatusBarHeaderController quickStatusBarHeaderController,
|
||||
ConfigurationController configurationController,
|
||||
FalsingManager falsingManager) {
|
||||
FalsingManager falsingManager,
|
||||
FeatureFlags featureFlags) {
|
||||
super(view);
|
||||
mQsPanelController = qsPanelController;
|
||||
mQuickStatusBarHeaderController = quickStatusBarHeaderController;
|
||||
mConfigurationController = configurationController;
|
||||
mFalsingManager = falsingManager;
|
||||
mQSPanelContainer = mView.getQSPanelContainer();
|
||||
view.setUseCombinedHeaders(featureFlags.isEnabled(Flags.COMBINED_QS_HEADERS));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -288,8 +288,15 @@ public class QuickStatusBarHeader extends FrameLayout {
|
||||
}
|
||||
|
||||
MarginLayoutParams qqsLP = (MarginLayoutParams) mHeaderQsPanel.getLayoutParams();
|
||||
qqsLP.topMargin = largeScreenHeaderActive || !mUseCombinedQSHeader ? mContext.getResources()
|
||||
.getDimensionPixelSize(R.dimen.qqs_layout_margin_top) : qsOffsetHeight;
|
||||
if (largeScreenHeaderActive) {
|
||||
qqsLP.topMargin = mContext.getResources()
|
||||
.getDimensionPixelSize(R.dimen.qqs_layout_margin_top);
|
||||
} else if (!mUseCombinedQSHeader) {
|
||||
qqsLP.topMargin = qsOffsetHeight;
|
||||
} else {
|
||||
qqsLP.topMargin = mContext.getResources()
|
||||
.getDimensionPixelSize(R.dimen.large_screen_shade_header_min_height);
|
||||
}
|
||||
mHeaderQsPanel.setLayoutParams(qqsLP);
|
||||
|
||||
updateBatteryMode();
|
||||
|
||||
@@ -246,6 +246,8 @@ class LargeScreenShadeHeaderController @Inject constructor(
|
||||
qsCarrierGroup.updateTextAppearance(R.style.TextAppearance_QS_Status_Carriers)
|
||||
if (header is MotionLayout) {
|
||||
loadConstraints()
|
||||
header.minHeight = resources
|
||||
.getDimensionPixelSize(R.dimen.large_screen_shade_header_min_height)
|
||||
lastInsets?.let { updateConstraintsForInsets(header, it) }
|
||||
}
|
||||
updateResources()
|
||||
|
||||
@@ -1289,8 +1289,15 @@ public final class NotificationPanelViewController {
|
||||
|
||||
mLargeScreenShadeHeaderHeight =
|
||||
mResources.getDimensionPixelSize(R.dimen.large_screen_shade_header_height);
|
||||
mQuickQsHeaderHeight = mUseLargeScreenShadeHeader ? mLargeScreenShadeHeaderHeight :
|
||||
SystemBarUtils.getQuickQsOffsetHeight(mView.getContext());
|
||||
// TODO: When the flag is eventually removed, it means that we have a single view that is
|
||||
// the same height in QQS and in Large Screen (large_screen_shade_header_height). Eventually
|
||||
// the concept of largeScreenHeader or quickQsHeader will disappear outside of the class
|
||||
// that controls the view as the offset needs to be the same regardless.
|
||||
if (mUseLargeScreenShadeHeader || mFeatureFlags.isEnabled(Flags.COMBINED_QS_HEADERS)) {
|
||||
mQuickQsHeaderHeight = mLargeScreenShadeHeaderHeight;
|
||||
} else {
|
||||
mQuickQsHeaderHeight = SystemBarUtils.getQuickQsOffsetHeight(mView.getContext());
|
||||
}
|
||||
int topMargin = mUseLargeScreenShadeHeader ? mLargeScreenShadeHeaderHeight :
|
||||
mResources.getDimensionPixelSize(R.dimen.notification_panel_margin_top);
|
||||
mLargeScreenShadeHeaderController.setLargeScreenActive(mUseLargeScreenShadeHeader);
|
||||
|
||||
Reference in New Issue
Block a user