android:clipChildren="false"
android:clipToPadding="false"
android:paddingTop="0dp"
- android:paddingEnd="8dp"
- android:paddingStart="16dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<include
android:id="@+id/date_time_alarm_group"
layout="@layout/status_bar_alarm_group"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="8dp"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="8dp"
android:gravity="end">
<com.android.systemui.statusbar.phone.MultiUserSwitch
android:padding="14dp" />
</LinearLayout>
+ <include layout="@layout/qs_divider"
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_gravity="bottom" />
+
</com.android.systemui.qs.QSFooter>
package com.android.systemui.qs;
import android.content.Context;
-import android.graphics.Canvas;
-import android.graphics.Paint;
import android.graphics.Point;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
-import com.android.settingslib.Utils;
import com.android.systemui.R;
import com.android.systemui.qs.customize.QSCustomizer;
private QSFooter mQSFooter;
private int mGutterHeight;
private View mBackground;
+ private float mFullElevation;
public QSContainerImpl(Context context, AttributeSet attrs) {
super(context, attrs);
mQSFooter = findViewById(R.id.qs_footer);
mBackground = findViewById(R.id.qs_background);
mGutterHeight = getContext().getResources().getDimensionPixelSize(R.dimen.qs_gutter_height);
+ mFullElevation = mQSPanel.getElevation();
}
@Override
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
- updateBottom();
+ updateExpansion();
}
/**
*/
public void setHeightOverride(int heightOverride) {
mHeightOverride = heightOverride;
- updateBottom();
+ updateExpansion();
}
- public void updateBottom() {
+ public void updateExpansion() {
int height = calculateContainerHeight();
- setBottom(getTop() + height + mGutterHeight);
+ int gutterHeight = Math.round(mQsExpansion * mGutterHeight);
+ setBottom(getTop() + height + gutterHeight);
mQSDetail.setBottom(getTop() + height);
- mBackground.setBottom(mQSDetail.getBottom());
+ mBackground.setBottom(getTop() + height);
// Pin QS Footer to the bottom of the panel.
mQSFooter.setTranslationY(height - mQSFooter.getHeight());
+
+ float elevation = mQsExpansion * mFullElevation;
+ mQSDetail.setElevation(elevation);
+ mBackground.setElevation(elevation);
+ mQSFooter.setElevation(elevation);
+ mQSPanel.setElevation(elevation);
}
protected int calculateContainerHeight() {
int heightOverride = mHeightOverride != -1 ? mHeightOverride : getMeasuredHeight();
return mQSCustomizer.isCustomizing() ? mQSCustomizer.getHeight()
- : (int) (mQsExpansion * (heightOverride - mHeader.getHeight()))
+ : Math.round(mQsExpansion * (heightOverride - mHeader.getHeight()))
+ mHeader.getHeight();
}
public void setExpansion(float expansion) {
mQsExpansion = expansion;
- updateBottom();
+ updateExpansion();
+ }
+
+ public void setGutterEnabled(boolean gutterEnabled) {
+ if (gutterEnabled == (mGutterHeight != 0)) {
+ return;
+ }
+ if (gutterEnabled) {
+ mGutterHeight = getContext().getResources().getDimensionPixelSize(
+ R.dimen.qs_gutter_height);
+ } else {
+ mGutterHeight = 0;
+ }
+ updateExpansion();
}
}
import com.android.systemui.Interpolators;
import com.android.systemui.R;
import com.android.systemui.R.id;
-import com.android.systemui.R.style;
import com.android.systemui.plugins.qs.QS;
import com.android.systemui.qs.customize.QSCustomizer;
import com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer;
return mHeader;
}
+ @Override
+ public void setHasNotifications(boolean hasNotifications) {
+ mContainer.setGutterEnabled(hasNotifications);
+ }
+
public void setPanelView(HeightListener panelView) {
mPanelView = panelView;
}
public void notifyCustomizeChanged() {
// The customize state changed, so our height changed.
- mContainer.updateBottom();
+ mContainer.updateExpansion();
mQSPanel.setVisibility(!mQSCustomizer.isCustomizing() ? View.VISIBLE : View.INVISIBLE);
mHeader.setVisibility(!mQSCustomizer.isCustomizing() ? View.VISIBLE : View.INVISIBLE);
mFooter.setVisibility(!mQSCustomizer.isCustomizing() ? View.VISIBLE : View.INVISIBLE);
}
public int getQsMinExpansionHeight() {
- return mHeader.getHeight() + mGutterHeight;
+ return mHeader.getHeight();
}
@Override