QS Visuals work
Mostly just resizing and placement of things. Change-Id: I28dbe22b0b0633bbe2bd484879e29349510dde29
This commit is contained in:
@@ -18,10 +18,20 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:padding="@dimen/qs_panel_padding"
|
||||
android:paddingEnd="@dimen/qs_panel_padding"
|
||||
android:visibility="invisible"
|
||||
android:background="@drawable/btn_borderless_rect" >
|
||||
android:background="@drawable/btn_borderless_rect"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@*android:id/up"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:padding="16dp"
|
||||
android:clickable="true"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:src="?android:attr/homeAsUpIndicator" />
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/title"
|
||||
@@ -37,4 +47,4 @@
|
||||
android:clickable="false"
|
||||
android:textAppearance="@style/TextAppearance.QS.DetailHeader" />
|
||||
|
||||
</com.android.keyguard.AlphaOptimizedLinearLayout>
|
||||
</com.android.keyguard.AlphaOptimizedLinearLayout>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
android:id="@android:id/icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="12dp" />
|
||||
android:layout_marginEnd="20dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:systemui="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_height="48dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
style="@style/BrightnessDialogContainer">
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/date_time_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="28dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:orientation="horizontal">
|
||||
@@ -115,7 +115,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:id="@+id/clock" />
|
||||
|
||||
<com.android.systemui.statusbar.policy.DateView
|
||||
@@ -123,7 +123,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:drawableStart="@drawable/header_dot"
|
||||
android:drawablePadding="6dp"
|
||||
android:singleLine="true"
|
||||
@@ -136,7 +136,7 @@
|
||||
android:id="@+id/alarm_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:drawablePadding="6dp"
|
||||
android:drawableStart="@drawable/ic_access_alarms_small"
|
||||
android:textColor="#64ffffff"
|
||||
@@ -152,9 +152,9 @@
|
||||
android:background="#0000"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false" />
|
||||
@@ -164,7 +164,7 @@
|
||||
layout="@layout/qs_detail_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginTop="28dp"
|
||||
/>
|
||||
|
||||
<com.android.systemui.statusbar.AlphaOptimizedImageView
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
<dimen name="close_handle_underlap">32dp</dimen>
|
||||
|
||||
<!-- Height of the status bar header bar -->
|
||||
<dimen name="status_bar_header_height">90dp</dimen>
|
||||
<dimen name="status_bar_header_height">80dp</dimen>
|
||||
|
||||
<!-- Height of the status bar header bar when expanded -->
|
||||
<dimen name="status_bar_header_height_expanded">116dp</dimen>
|
||||
|
||||
@@ -23,7 +23,7 @@ import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import android.widget.Space;
|
||||
import com.android.systemui.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -123,11 +123,14 @@ public class QuickQSPanel extends QSPanel {
|
||||
|
||||
@Override
|
||||
public void addTile(TileRecord tile) {
|
||||
tile.tileView.setLayoutParams(generateLayoutParams());
|
||||
addView(tile.tileView, getChildCount() - 1 /* Leave icon at end */);
|
||||
addView(tile.tileView, getChildCount() - 1 /* Leave icon at end */,
|
||||
generateLayoutParams());
|
||||
// Add a spacer.
|
||||
addView(new Space(mContext), getChildCount() - 1 /* Leave icon at end */,
|
||||
generateSpaceParams());
|
||||
}
|
||||
|
||||
private LayoutParams generateLayoutParams() {
|
||||
private LayoutParams generateSpaceParams() {
|
||||
int size = mContext.getResources().getDimensionPixelSize(R.dimen.qs_quick_tile_size);
|
||||
LayoutParams lp = new LayoutParams(0, size);
|
||||
lp.weight = 1;
|
||||
@@ -135,9 +138,30 @@ public class QuickQSPanel extends QSPanel {
|
||||
return lp;
|
||||
}
|
||||
|
||||
private LayoutParams generateLayoutParams() {
|
||||
int size = mContext.getResources().getDimensionPixelSize(R.dimen.qs_quick_tile_size);
|
||||
LayoutParams lp = new LayoutParams(size, size);
|
||||
lp.gravity = Gravity.CENTER;
|
||||
return lp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeTile(TileRecord tile) {
|
||||
removeView(tile.tileView);
|
||||
int childIndex = getChildIndex(tile.tileView);
|
||||
// Remove the tile.
|
||||
removeViewAt(childIndex);
|
||||
// Remove its spacer as well.
|
||||
removeViewAt(childIndex);
|
||||
}
|
||||
|
||||
private int getChildIndex(QSTileBaseView tileView) {
|
||||
final int N = getChildCount();
|
||||
for (int i = 0; i < N; i++) {
|
||||
if (getChildAt(i) == tileView) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,6 +35,7 @@ public abstract class BaseStatusBarHeader extends RelativeLayout implements
|
||||
|
||||
public abstract int getCollapsedHeight();
|
||||
public abstract int getExpandedHeight();
|
||||
|
||||
public abstract void setExpanded(boolean b);
|
||||
public abstract void setExpansion(float headerExpansionFraction);
|
||||
public abstract void setListening(boolean listening);
|
||||
|
||||
@@ -31,7 +31,6 @@ import android.widget.ImageView;
|
||||
import android.widget.Switch;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.android.keyguard.KeyguardStatusView;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.qs.QSPanel;
|
||||
@@ -74,6 +73,9 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements
|
||||
private float mDateTimeTranslation;
|
||||
private MultiUserSwitch mMultiUserSwitch;
|
||||
private ImageView mMultiUserAvatar;
|
||||
private View mQsDetailHeaderBack;
|
||||
|
||||
private final int[] mTmpInt2 = new int[2];
|
||||
|
||||
public QuickStatusBarHeader(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
@@ -87,6 +89,7 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements
|
||||
mDateTimeTranslation = mContext.getResources().getDimension(
|
||||
R.dimen.qs_date_anim_translation);
|
||||
mDateTimeGroup = (ViewGroup) findViewById(R.id.date_time_group);
|
||||
mDateTimeGroup.findViewById(R.id.empty_time_view).setVisibility(View.GONE);
|
||||
mExpandedGroup = (ViewGroup) findViewById(R.id.expanded_group);
|
||||
|
||||
mHeaderQsPanel = (QuickQSPanel) findViewById(R.id.quick_qs_panel);
|
||||
@@ -100,6 +103,7 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements
|
||||
|
||||
mQsDetailHeader = findViewById(R.id.qs_detail_header);
|
||||
mQsDetailHeader.setAlpha(0);
|
||||
mQsDetailHeaderBack = mQsDetailHeader.findViewById(com.android.internal.R.id.up);
|
||||
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);
|
||||
@@ -367,6 +371,15 @@ public class QuickStatusBarHeader extends BaseStatusBarHeader implements
|
||||
}
|
||||
});
|
||||
}
|
||||
mQsDetailHeaderBack.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
v.getLocationInWindow(mTmpInt2);
|
||||
mTmpInt2[0] += v.getWidth() / 2;
|
||||
mTmpInt2[1] += v.getHeight() / 2;
|
||||
mQsPanel.showDetailAdapter(false, null, mTmpInt2);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
mQsDetailHeader.setClickable(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user