Some updates to QS prototype based on new mocks
Change-Id: Ic9c0cfcb77f558fa82edb4dc39406ce95b031b35
diff --git a/packages/SystemUI/res/layout/qs_customize_panel.xml b/packages/SystemUI/res/layout/qs_customize_panel.xml
index 59fed5b..f430fa5 100644
--- a/packages/SystemUI/res/layout/qs_customize_panel.xml
+++ b/packages/SystemUI/res/layout/qs_customize_panel.xml
@@ -19,14 +19,13 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
- android:paddingBottom="@dimen/navigation_bar_size"
android:background="@drawable/qs_customizer_background"
android:gravity="center_horizontal">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="?android:attr/colorPrimary">
+ android:background="@drawable/notification_header_bg">
<LinearLayout
android:id="@+id/drag_buttons"
@@ -72,8 +71,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:navigationContentDescription="@*android:string/action_bar_up_description"
- style="?android:attr/toolbarStyle"
- android:background="?android:attr/colorPrimary" />
+ android:background="@drawable/notification_header_bg"
+ style="?android:attr/toolbarStyle" />
</FrameLayout>
<com.android.systemui.tuner.AutoScrollView
@@ -105,4 +104,10 @@
android:elevation="@dimen/fab_elevation"
android:background="@drawable/fab_background" />
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/navigation_bar_size"
+ android:layout_gravity="bottom"
+ android:background="#ff000000" />
+
</com.android.systemui.qs.customize.QSCustomizer>
diff --git a/packages/SystemUI/res/layout/quick_status_bar_expanded_header.xml b/packages/SystemUI/res/layout/quick_status_bar_expanded_header.xml
index 0b8da83..6187070 100644
--- a/packages/SystemUI/res/layout/quick_status_bar_expanded_header.xml
+++ b/packages/SystemUI/res/layout/quick_status_bar_expanded_header.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
-** Copyright 2015, The Android Open Source Project
+** Copyright 2012, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
@@ -32,55 +32,21 @@
android:focusable="true"
>
+ <com.android.systemui.qs.QuickQSPanel
+ android:id="@+id/quick_qs_panel"
+ android:background="#0000"
+ android:layout_width="142dp"
+ android:layout_height="match_parent"
+ android:layout_alignParentEnd="true" />
+
<LinearLayout
android:id="@+id/expanded_group"
- android:layout_width="match_parent"
+ android:layout_width="wrap_content"
android:layout_height="match_parent"
- android:paddingEnd="12dp"
- android:orientation="horizontal">
-
- <com.android.systemui.statusbar.AlphaOptimizedButton android:id="@+id/alarm_status"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="4dp"
- android:drawablePadding="6dp"
- android:drawableStart="@drawable/ic_access_alarms_small"
- android:textColor="#64ffffff"
- android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
- android:paddingEnd="6dp"
- android:paddingStart="6dp"
- android:paddingTop="16dp"
- android:paddingBottom="16dp"
- android:background="?android:attr/selectableItemBackground"
- android:visibility="gone"
- />
-
- <com.android.systemui.statusbar.policy.DateView android:id="@+id/date"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:singleLine="true"
- android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
- android:layout_below="@id/clock"
- systemui:datePattern="EEE"
- android:gravity="center_vertical"
- android:textSize="20sp"
- android:paddingTop="16dp"
- android:layout_marginBottom="@dimen/clock_collapsed_bottom_margin" />
-
- <include layout="@layout/split_clock_view"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_marginStart="16dp"
- android:layout_marginTop="16dp"
- android:id="@+id/clock"
- />
-
- <Space
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1" />
-
+ android:clipChildren="false"
+ android:clipToPadding="false"
+ android:orientation="horizontal"
+ android:layout_alignParentEnd="true">
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
android:id="@+id/settings_button_container"
android:layout_width="48dp"
@@ -105,8 +71,57 @@
android:src="@drawable/tuner" />
</com.android.systemui.statusbar.AlphaOptimizedFrameLayout>
+
+ <ImageView
+ android:layout_width="48dp"
+ android:layout_height="match_parent"
+ android:src="@drawable/ic_expand_less"
+ android:tint="@android:color/white" />
</LinearLayout>
+ <FrameLayout
+ android:id="@+id/date_group"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/clock_collapsed_bottom_margin"
+ android:layout_alignParentBottom="true">
+ <com.android.systemui.statusbar.policy.DateView android:id="@+id/date_collapsed"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:singleLine="true"
+ android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
+ android:layout_below="@id/clock"
+ systemui:datePattern="@string/abbrev_wday_month_day_no_year_alarm"
+ />
+ </FrameLayout>
+
+ <include layout="@layout/split_clock_view"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_above="@id/date_group"
+ android:id="@+id/clock"
+ />
+
+ <com.android.systemui.statusbar.AlphaOptimizedButton android:id="@+id/alarm_status"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_toEndOf="@id/date_group"
+ android:layout_marginBottom="4dp"
+ android:drawablePadding="6dp"
+ android:drawableStart="@drawable/ic_access_alarms_small"
+ android:textColor="#64ffffff"
+ android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
+ android:paddingEnd="6dp"
+ android:paddingStart="6dp"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:background="?android:attr/selectableItemBackground"
+ android:visibility="gone"
+ />
+
<include
android:id="@+id/qs_detail_header"
layout="@layout/qs_detail_header"
@@ -115,12 +130,6 @@
android:layout_alignParentBottom="true"
/>
- <com.android.systemui.qs.QuickQSPanel
- android:id="@+id/quick_qs_panel"
- android:background="#0000"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
-
<com.android.systemui.statusbar.AlphaOptimizedImageView
android:id="@+id/qs_detail_header_progress"
android:src="@drawable/indeterminate_anim"
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 5661657..cbc92f2 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -125,6 +125,7 @@
<dimen name="pull_span_min">25dp</dimen>
<dimen name="qs_tile_height">88dp</dimen>
+ <dimen name="qs_new_tile_height">100dp</dimen>
<dimen name="qs_quick_actions_height">88dp</dimen>
<dimen name="qs_quick_actions_padding">25dp</dimen>
<dimen name="qs_page_indicator_size">12dp</dimen>
diff --git a/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java b/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
index 32c906e..0e4a4e5 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java
@@ -75,8 +75,6 @@
@Override
public void setTileVisibility(TileRecord tile, int visibility) {
tile.tileView.setVisibility(visibility);
-// // TODO: Do something smarter here.
-// distributeTiles();
}
@Override
@@ -104,8 +102,7 @@
for (int i = 0; i < NT; i++) {
TileRecord tile = mTiles.get(i);
if (tile.tile.getTileType() == QSTileView.QS_TYPE_QUICK) {
- tile.tileView.setType(QSTileView.QS_TYPE_QUICK);
- mFirstPage.mQuickQuickTiles.addView(tile.tileView);
+ // Don't show any quick tiles for now.
continue;
}
if (mPages.get(index).isFull()) {
@@ -161,6 +158,7 @@
protected void onFinishInflate() {
super.onFinishInflate();
mQuickQuickTiles = (LinearLayout) findViewById(R.id.quick_tile_layout);
+ mQuickQuickTiles.setVisibility(View.GONE);
mTilePage = (TilePage) findViewById(R.id.tile_page);
// Less rows on first page, because it needs room for the quick tiles.
mTilePage.mMaxRows = 3;
@@ -176,7 +174,7 @@
}
public static class TilePage extends TileLayout {
- private int mMaxRows = 4;
+ private int mMaxRows = 3;
public TilePage(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -188,6 +186,11 @@
mMaxRows = maxRows;
}
+ @Override
+ protected int getCellHeight() {
+ return mContext.getResources().getDimensionPixelSize(R.dimen.qs_new_tile_height);
+ }
+
private void clear() {
if (DEBUG) Log.d(TAG, "Clearing page");
removeAllViews();
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java
index 53d0402..a2d9ef0 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java
@@ -60,7 +60,7 @@
if (tile.getTileType() == QSTileView.QS_TYPE_QUICK) {
quickTiles.add(tile);
}
- if (quickTiles.size() == 4) {
+ if (quickTiles.size() == 2) {
break;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/TileLayout.java b/packages/SystemUI/src/com/android/systemui/qs/TileLayout.java
index b8342e2..12a099d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/TileLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/TileLayout.java
@@ -67,7 +67,7 @@
public void updateResources() {
final Resources res = mContext.getResources();
final int columns = Math.max(1, res.getInteger(R.integer.quick_settings_num_columns));
- mCellHeight = res.getDimensionPixelSize(R.dimen.qs_tile_height);
+ mCellHeight = getCellHeight();
mCellWidth = (int) (mCellHeight * TILE_ASPECT);
mLargeCellHeight = mAllowDual ? res.getDimensionPixelSize(R.dimen.qs_dual_tile_height)
: mCellHeight;
@@ -79,6 +79,10 @@
}
}
+ protected int getCellHeight() {
+ return mContext.getResources().getDimensionPixelSize(R.dimen.qs_tile_height);
+ }
+
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
final int width = MeasureSpec.getSize(widthMeasureSpec);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/NonPagedTileLayout.java b/packages/SystemUI/src/com/android/systemui/qs/customize/NonPagedTileLayout.java
index 012633c..1669278 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/customize/NonPagedTileLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/customize/NonPagedTileLayout.java
@@ -61,6 +61,7 @@
protected void onFinishInflate() {
super.onFinishInflate();
mQuickTiles = (QuickTileLayout) findViewById(R.id.quick_tile_layout);
+ mQuickTiles.setVisibility(View.GONE);
TilePage page = (PagedTileLayout.TilePage) findViewById(R.id.tile_page);
page.setMaxRows(3 /* First page only gets 3 */);
mPages.add(page);
@@ -107,12 +108,12 @@
for (int i = 0; i < NT; i++) {
TileRecord tile = mTiles.get(i);
if (tile.tile.getTileType() == QSTileView.QS_TYPE_QUICK) {
- tile.tileView.setType(QSTileView.QS_TYPE_QUICK);
- mQuickTiles.addView(tile.tileView);
+ // Ignore quick tiles for now.
continue;
}
mPages.get(index).addTile(tile);
- if (mPages.get(index).isFull()) {
+ // Keep everything in one layout for now.
+ if (false && mPages.get(index).isFull()) {
if (++index == mPages.size()) {
LayoutInflater inflater = LayoutInflater.from(mContext);
inflater.inflate(R.layout.horizontal_divider, this);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
index 601961b..fe8d78b 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java
@@ -84,7 +84,7 @@
TypedValue value = new TypedValue();
mContext.getTheme().resolveAttribute(android.R.attr.homeAsUpIndicator, value, true);
mToolbar.setNavigationIcon(
- getResources().getDrawable(value.resourceId, mContext.getTheme()));
+ getResources().getDrawable(R.drawable.ic_close_white, mContext.getTheme()));
mToolbar.setNavigationOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
@@ -193,7 +193,8 @@
@Override
public void onClick(View v) {
if (mFab == v) {
- // TODO: Show list of tiles.
+ SystemUIDialog dialog = new SystemUIDialog(mContext);
+ dialog.show();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
index 01f0667..662dbd9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStatusBarHeader.java
@@ -20,7 +20,9 @@
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
+import android.graphics.Rect;
import android.graphics.drawable.Animatable;
+import android.graphics.drawable.RippleDrawable;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
@@ -28,6 +30,7 @@
import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
+
import com.android.systemui.R;
import com.android.systemui.qs.QSPanel;
import com.android.systemui.qs.QSTile;
@@ -86,6 +89,20 @@
mQsDetailHeaderTitle = (TextView) mQsDetailHeader.findViewById(android.R.id.title);
mQsDetailHeaderSwitch = (Switch) mQsDetailHeader.findViewById(android.R.id.toggle);
mQsDetailHeaderProgress = (ImageView) findViewById(R.id.qs_detail_header_progress);
+
+ // RenderThread is doing more harm than good when touching the header (to expand quick
+ // settings), so disable it for this view
+ ((RippleDrawable) getBackground()).setForceSoftware(true);
+ ((RippleDrawable) mSettingsButton.getBackground()).setForceSoftware(true);
+
+ addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
+ @Override
+ public void onLayoutChange(View v, int left, int top, int right,
+ int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
+ setClipBounds(new Rect(getPaddingLeft(), 0, getWidth() - getPaddingRight(),
+ getHeight()));
+ }
+ });
}
@Override