Merge "Visual changes to QS header" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e19335a443
@@ -37,7 +37,7 @@
|
||||
android:layout_gravity="start"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.QS.TileLabel"
|
||||
android:textAppearance="@style/TextAppearance.QS.Status"
|
||||
systemui:datePattern="@string/abbrev_wday_month_day_no_year_alarm" />
|
||||
|
||||
<com.android.systemui.statusbar.phone.StatusIconContainer
|
||||
@@ -51,6 +51,7 @@
|
||||
android:id="@+id/batteryRemainingIcon"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
systemui:textAppearance="@style/TextAppearance.QS.Status"
|
||||
android:paddingEnd="2dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:systemui="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/system_icons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -32,5 +33,6 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:clipToPadding="false"
|
||||
android:clipChildren="false" />
|
||||
android:clipChildren="false"
|
||||
systemui:textAppearance="@style/TextAppearance.StatusBar.Clock" />
|
||||
</LinearLayout>
|
||||
@@ -38,6 +38,7 @@
|
||||
<attr name="frameColor" format="color" />
|
||||
<declare-styleable name="BatteryMeterView">
|
||||
<attr name="frameColor" />
|
||||
<attr name="textAppearance" format="reference"/>
|
||||
</declare-styleable>
|
||||
<declare-styleable name="Clock">
|
||||
<attr name="amPmStyle" format="enum">
|
||||
|
||||
@@ -413,7 +413,7 @@
|
||||
<!-- The height of the qs customize header. Should be (28dp - qs_tile_margin_top_bottom). -->
|
||||
<dimen name="qs_customize_header_min_height">40dp</dimen>
|
||||
<dimen name="qs_tile_margin_top">18dp</dimen>
|
||||
<dimen name="qs_tile_background_size">40dp</dimen>
|
||||
<dimen name="qs_tile_background_size">44dp</dimen>
|
||||
<dimen name="qs_quick_tile_size">48dp</dimen>
|
||||
<!-- Maximum width of quick quick settings panel. Defaults to MATCH_PARENT-->
|
||||
<dimen name="qs_quick_layout_width">-1px</dimen>
|
||||
@@ -424,7 +424,6 @@
|
||||
<dimen name="qs_page_indicator_height">8dp</dimen>
|
||||
<dimen name="qs_tile_icon_size">24dp</dimen>
|
||||
<dimen name="qs_tile_text_size">12sp</dimen>
|
||||
<dimen name="qs_carrier_info_text_size">14sp</dimen>
|
||||
<dimen name="qs_tile_divider_height">1dp</dimen>
|
||||
<dimen name="qs_panel_padding">16dp</dimen>
|
||||
<dimen name="qs_dual_tile_height">112dp</dimen>
|
||||
@@ -432,7 +431,6 @@
|
||||
<dimen name="qs_dual_tile_padding_horizontal">6dp</dimen>
|
||||
<dimen name="qs_tile_padding_top">14dp</dimen>
|
||||
<dimen name="qs_tile_padding_top_large_text">4dp</dimen>
|
||||
<dimen name="qs_tile_padding_below_icon">12dp</dimen>
|
||||
<dimen name="qs_tile_padding_bottom">16dp</dimen>
|
||||
<dimen name="qs_tile_spacing">4dp</dimen>
|
||||
<dimen name="qs_panel_padding_bottom">0dp</dimen>
|
||||
|
||||
@@ -222,13 +222,10 @@
|
||||
<item name="android:textSize">@dimen/celltile_rat_type_size</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.QS.CarrierInfo">
|
||||
<item name="android:fontFamily">@*android:string/config_headlineFontFamily</item>
|
||||
<item name="android:textSize">@dimen/qs_carrier_info_text_size</item>
|
||||
<style name="TextAppearance.QS.Status" parent="TextAppearance.QS.TileLabel.Secondary">
|
||||
<item name="android:fontFamily">@*android:string/config_bodyFontFamily</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.QS.Status" parent="TextAppearance.QS.TileLabel.Secondary" />
|
||||
|
||||
<style name="TextAppearance.AppOpsDialog" />
|
||||
|
||||
<style name="TextAppearance.AppOpsDialog.Title">
|
||||
|
||||
@@ -47,6 +47,8 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.StyleRes;
|
||||
|
||||
import com.android.settingslib.Utils;
|
||||
import com.android.settingslib.graph.ThemedBatteryDrawable;
|
||||
import com.android.systemui.plugins.DarkIconDispatcher;
|
||||
@@ -86,6 +88,7 @@ public class BatteryMeterView extends LinearLayout implements
|
||||
|
||||
private BatteryController mBatteryController;
|
||||
private SettingObserver mSettingObserver;
|
||||
private final @StyleRes int mPercentageStyleId;
|
||||
private int mTextColor;
|
||||
private int mLevel;
|
||||
private int mShowPercentMode = MODE_DEFAULT;
|
||||
@@ -132,6 +135,7 @@ public class BatteryMeterView extends LinearLayout implements
|
||||
defStyle, 0);
|
||||
final int frameColor = atts.getColor(R.styleable.BatteryMeterView_frameColor,
|
||||
context.getColor(R.color.meter_background_color));
|
||||
mPercentageStyleId = atts.getResourceId(R.styleable.BatteryMeterView_textAppearance, 0);
|
||||
mDrawable = new ThemedBatteryDrawable(context, frameColor);
|
||||
atts.recycle();
|
||||
|
||||
@@ -402,6 +406,9 @@ public class BatteryMeterView extends LinearLayout implements
|
||||
if (!showing) {
|
||||
mBatteryPercentView = loadPercentView();
|
||||
if (mTextColor != 0) mBatteryPercentView.setTextColor(mTextColor);
|
||||
if (mPercentageStyleId != 0) { // Only set if specified as attribute
|
||||
mBatteryPercentView.setTextAppearance(mPercentageStyleId);
|
||||
}
|
||||
updatePercentText();
|
||||
addView(mBatteryPercentView,
|
||||
new ViewGroup.LayoutParams(
|
||||
@@ -440,7 +447,6 @@ public class BatteryMeterView extends LinearLayout implements
|
||||
scaledLayoutParams.setMargins(0, 0, 0, marginBottom);
|
||||
|
||||
mBatteryIconView.setLayoutParams(scaledLayoutParams);
|
||||
FontSizeUtils.updateFontSize(mBatteryPercentView, R.dimen.qs_time_expanded_size);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -44,7 +44,6 @@ public class QSIconViewImpl extends QSIconView {
|
||||
|
||||
protected final View mIcon;
|
||||
protected final int mIconSizePx;
|
||||
protected final int mTilePaddingBelowIconPx;
|
||||
private boolean mAnimationEnabled = true;
|
||||
private int mState = -1;
|
||||
private int mTint;
|
||||
@@ -54,7 +53,6 @@ public class QSIconViewImpl extends QSIconView {
|
||||
|
||||
final Resources res = context.getResources();
|
||||
mIconSizePx = res.getDimensionPixelSize(R.dimen.qs_tile_icon_size);
|
||||
mTilePaddingBelowIconPx = res.getDimensionPixelSize(R.dimen.qs_tile_padding_below_icon);
|
||||
|
||||
mIcon = createIcon();
|
||||
addView(mIcon);
|
||||
@@ -73,7 +71,7 @@ public class QSIconViewImpl extends QSIconView {
|
||||
final int w = MeasureSpec.getSize(widthMeasureSpec);
|
||||
final int iconSpec = exactly(mIconSizePx);
|
||||
mIcon.measure(MeasureSpec.makeMeasureSpec(w, getIconMeasureMode()), iconSpec);
|
||||
setMeasuredDimension(w, mIcon.getMeasuredHeight() + mTilePaddingBelowIconPx);
|
||||
setMeasuredDimension(w, mIcon.getMeasuredHeight());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -80,7 +80,6 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView {
|
||||
// Default to Quick Tile padding, and QSTileView will specify its own padding.
|
||||
int padding = context.getResources().getDimensionPixelSize(R.dimen.qs_quick_tile_padding);
|
||||
mIconFrame = new FrameLayout(context);
|
||||
mIconFrame.setForegroundGravity(Gravity.CENTER);
|
||||
int size = context.getResources().getDimensionPixelSize(R.dimen.qs_quick_tile_size);
|
||||
addView(mIconFrame, new LayoutParams(size, size));
|
||||
mBg = new ImageView(getContext());
|
||||
@@ -93,14 +92,14 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView {
|
||||
int bgSize = context.getResources().getDimensionPixelSize(R.dimen.qs_tile_background_size);
|
||||
d.setIntrinsicHeight(bgSize);
|
||||
d.setIntrinsicWidth(bgSize);
|
||||
mBg.setScaleType(ScaleType.FIT_CENTER);
|
||||
mBg.setImageDrawable(d);
|
||||
mIconFrame.addView(mBg, ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(bgSize, bgSize, Gravity.CENTER);
|
||||
mIconFrame.addView(mBg, lp);
|
||||
mBg.setLayoutParams(lp);
|
||||
mIcon = icon;
|
||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
params.setMargins(0, padding, 0, padding);
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
Gravity.CENTER);
|
||||
mIconFrame.addView(mIcon, params);
|
||||
mIconFrame.setClipChildren(false);
|
||||
mIconFrame.setClipToPadding(false);
|
||||
|
||||
Reference in New Issue
Block a user