android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical"
- android:elevation="4dp"
android:background="@drawable/qs_customizer_background"
android:gravity="center_horizontal">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/qs_detail_background"
- android:elevation="4dp"
android:clickable="true"
android:orientation="vertical"
android:paddingBottom="8dp"
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="48dp"
- android:elevation="4dp"
android:baselineAligned="false"
android:clickable="false"
android:clipChildren="false"
android:clipToPadding="false"
android:paddingTop="0dp"
- android:background="#00000000"
android:gravity="center_vertical"
android:orientation="horizontal">
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>
android:id="@+id/quick_settings_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:background="@drawable/qs_background_primary"
+ android:elevation="4dp"
android:clipToPadding="false"
android:clipChildren="false">
- <View
- android:id="@+id/qs_background"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/qs_background_primary"
- android:alpha="0.8"
- android:elevation="4dp" />
-
<com.android.systemui.qs.QSPanel
android:id="@+id/quick_settings_panel"
android:layout_marginTop="28dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:elevation="4dp"
- android:background="#00000000"
android:layout_marginBottom="48dp" />
<include layout="@layout/quick_status_bar_expanded_header" />
android:layout_height="@dimen/status_bar_header_height"
android:layout_gravity="@integer/notification_panel_layout_gravity"
android:baselineAligned="false"
- android:background="#00000000"
- android:elevation="4dp"
android:clickable="false"
android:clipChildren="false"
android:clipToPadding="false"
<dimen name="rounded_corner_radius">0dp</dimen>
<dimen name="rounded_corner_content_padding">0dp</dimen>
- <dimen name="qs_gutter_height">6dp</dimen>
-
<!-- Intended corner radius when drawing the mobile signal -->
<dimen name="stat_sys_mobile_signal_corner_radius">0.75dp</dimen>
protected float mQsExpansion;
private QSCustomizer mQSCustomizer;
private QSFooter mQSFooter;
- private int mGutterHeight;
- private View mBackground;
private float mFullElevation;
public QSContainerImpl(Context context, AttributeSet attrs) {
mHeader = findViewById(R.id.header);
mQSCustomizer = findViewById(R.id.qs_customize);
mQSFooter = findViewById(R.id.qs_footer);
- mBackground = findViewById(R.id.qs_background);
- mGutterHeight = getContext().getResources().getDimensionPixelSize(R.dimen.qs_gutter_height);
mFullElevation = mQSPanel.getElevation();
setClickable(true);
public void updateExpansion() {
int height = calculateContainerHeight();
- int gutterHeight = Math.round(mQsExpansion * mGutterHeight);
- setBottom(getTop() + height + gutterHeight);
+ setBottom(getTop() + height);
mQSDetail.setBottom(getTop() + height);
- 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() {
mQsExpansion = expansion;
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();
- }
}
private QSContainerImpl mContainer;
private int mLayoutDirection;
private QSFooter mFooter;
- private int mGutterHeight;
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
mHeader = view.findViewById(R.id.header);
mFooter = view.findViewById(R.id.qs_footer);
mContainer = view.findViewById(id.quick_settings_container);
- mGutterHeight = getContext().getResources().getDimensionPixelSize(R.dimen.qs_gutter_height);
mQSDetail.setQsPanel(mQSPanel, mHeader);
@Override
public void setHasNotifications(boolean hasNotifications) {
- mContainer.setGutterEnabled(hasNotifications);
}
public void setPanelView(HeightListener panelView) {
mContainer.setExpansion(expansion);
final float translationScaleY = expansion - 1;
if (!mHeaderAnimating) {
- int height = mHeader.getHeight() + mGutterHeight;
+ int height = mHeader.getHeight();
getView().setTranslationY(mKeyguardShowing ? (translationScaleY * height)
: headerTranslation);
}
LayoutParams layoutParams = (LayoutParams) mQSPanel.getLayoutParams();
int panelHeight = layoutParams.topMargin + layoutParams.bottomMargin +
+ mQSPanel.getMeasuredHeight();
- return panelHeight + getView().getPaddingBottom() + mGutterHeight;
+ return panelHeight + getView().getPaddingBottom();
} else {
- return getView().getMeasuredHeight() + mGutterHeight;
+ return getView().getMeasuredHeight();
}
}
@Override
public void setHeightOverride(int desiredHeight) {
- mContainer.setHeightOverride(desiredHeight - mGutterHeight);
+ mContainer.setHeightOverride(desiredHeight);
}
public int getQsMinExpansionHeight() {