diff options
author | d34d <clark@cyngn.com> | 2016-05-12 10:39:24 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-05-19 12:52:32 -0700 |
commit | e3ddac3a775d2e8808da40d302794e9b50016d9b (patch) | |
tree | e913473f3dafd2e098432098161b2a84635e3e5d /packages | |
parent | b7583ae4c856162aeac18f4169cfa1d06aa641a8 (diff) | |
download | frameworks_base-e3ddac3a775d2e8808da40d302794e9b50016d9b.zip frameworks_base-e3ddac3a775d2e8808da40d302794e9b50016d9b.tar.gz frameworks_base-e3ddac3a775d2e8808da40d302794e9b50016d9b.tar.bz2 |
SysUI: Adjust battery dimensions for better look
Make some minor tweaks to the new vector based batter meter to get
it even closer to stock look.
Change-Id: I80fcdefb2578352bef5ca35ad902556b204de322
Diffstat (limited to 'packages')
6 files changed, 14 insertions, 12 deletions
diff --git a/packages/SystemUI/res/drawable/ic_battery_portrait_frame.xml b/packages/SystemUI/res/drawable/ic_battery_portrait_frame.xml index 3327f53..f530727 100644 --- a/packages/SystemUI/res/drawable/ic_battery_portrait_frame.xml +++ b/packages/SystemUI/res/drawable/ic_battery_portrait_frame.xml @@ -27,6 +27,6 @@ <path android:name="frame" android:fillColor="@color/batterymeter_frame_color" - android:pathData="M19,2v20L5,22V2H19z" /> + android:pathData="M19,2v19H5V2H19z" /> </vector>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/status_bar.xml b/packages/SystemUI/res/layout/status_bar.xml index 51f7df7..d5e799a 100644 --- a/packages/SystemUI/res/layout/status_bar.xml +++ b/packages/SystemUI/res/layout/status_bar.xml @@ -118,7 +118,7 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:singleLine="true" - android:paddingStart="7dp" + android:paddingStart="3dp" android:gravity="center_vertical|start" /> </com.android.keyguard.AlphaOptimizedLinearLayout> diff --git a/packages/SystemUI/res/layout/system_icons.xml b/packages/SystemUI/res/layout/system_icons.xml index 2acf611..1f3f810 100644 --- a/packages/SystemUI/res/layout/system_icons.xml +++ b/packages/SystemUI/res/layout/system_icons.xml @@ -34,14 +34,14 @@ <!-- battery must be padded below to match assets --> <com.android.systemui.BatteryMeterView android:id="@+id/battery" - android:layout_height="19dp" - android:layout_width="19dp" + android:layout_height="18dp" + android:layout_width="18dp" android:layout_marginBottom="@dimen/battery_margin_bottom" android:layout_marginStart="@dimen/signal_cluster_battery_padding"/> <com.android.systemui.DockBatteryMeterView android:id="@+id/dock_battery" - android:layout_height="19dp" - android:layout_width="19dp" + android:layout_height="18dp" + android:layout_width="18dp" android:layout_marginBottom="@dimen/battery_margin_bottom" android:layout_marginStart="@dimen/signal_cluster_battery_padding" android:visibility="gone"/> diff --git a/packages/SystemUI/res/values/cm_strings.xml b/packages/SystemUI/res/values/cm_strings.xml index 940c440..1dea2d9 100644 --- a/packages/SystemUI/res/values/cm_strings.xml +++ b/packages/SystemUI/res/values/cm_strings.xml @@ -260,9 +260,9 @@ <string name="play_queue_extention">Show play queue</string> <!-- Path data for portrait battery --> - <string name="battery_portrait_path_full" translatable="false">M19,22v-20L5,2V22H19z</string> - <string name="battery_portrait_path_empty" translatable="false">M19,22v0.0L5,22V22H19z</string> - <string name="battery_portrait_clip_path" translatable="false">M5,22V4h4V2h6v2h4v18L5,22z</string> + <string name="battery_portrait_path_full" translatable="false">M 5 2 H 19 V 21 H 5 V 2 Z</string> + <string name="battery_portrait_path_empty" translatable="false">M 5 21 H 19 V 21 H 5 V 21 Z</string> + <string name="battery_portrait_clip_path" translatable="false">M6,21V4h3V2h6v2h3v17H6z</string> <!-- Path data for landscape battery --> <string name="battery_landscape_path_full" translatable="false">M 1 4 H 25 V 20 H 1 V 4 Z</string> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 03ea73c..a7efccd 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -531,7 +531,7 @@ <dimen name="fake_shadow_size">8dp</dimen> <!-- Padding between signal cluster and battery icon --> - <dimen name="signal_cluster_battery_padding">7dp</dimen> + <dimen name="signal_cluster_battery_padding">3dp</dimen> <!-- Padding for signal cluster and battery icon when there are not icons in signal cluster --> <dimen name="no_signal_cluster_battery_padding">3dp</dimen> diff --git a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java index 7f29333..cfb8396 100755 --- a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java +++ b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java @@ -676,8 +676,10 @@ public class BatteryMeterView extends View implements DemoMode, if (mWidth <= 0 || mHeight <=0) return; final float widthDiv2 = mWidth / 2f; - mTextAndBoltPaint.setTextSize(widthDiv2); - mWarningTextPaint.setTextSize(widthDiv2); + // text size is width / 2 - 2dp for wiggle room + final float textSize = widthDiv2 - getResources().getDisplayMetrics().density * 2; + mTextAndBoltPaint.setTextSize(textSize); + mWarningTextPaint.setTextSize(textSize); int pLeft = getPaddingLeft(); Rect iconBounds = new Rect(pLeft, 0, pLeft + mWidth, mHeight); |