Loading packages/SystemUI/res/layout/quick_settings_tile_battery.xml +2 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="top" Loading @@ -27,6 +28,7 @@ android:layout_height="32dp" android:padding="3dp" android:layout_gravity="top|center_horizontal" systemui:frameColor="@color/qs_batterymeter_frame_color" /> <TextView style="@style/TextAppearance.QuickSettings.TileView" Loading packages/SystemUI/res/values/attrs.xml +3 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,9 @@ <attr name="decayTime" format="integer" /> <attr name="orientation" /> </declare-styleable> <declare-styleable name="BatteryMeterView"> <attr name="frameColor" format="color" /> </declare-styleable> <attr name="orientation"> <enum name="horizontal" value="0" /> <enum name="vertical" value="1" /> Loading packages/SystemUI/res/values/colors.xml +1 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ <color name="batterymeter_frame_color">#66FFFFFF</color><!-- 40% white --> <color name="batterymeter_charge_color">#FFFFFFFF</color> <color name="batterymeter_bolt_color">#FFFFFFFF</color> <color name="qs_batterymeter_frame_color">#FF404040</color> <color name="status_bar_clock_color">#FFFFFFFF</color> <drawable name="notification_item_background_color">#ff111111</drawable> <drawable name="notification_item_background_color_pressed">#ff454545</drawable> Loading packages/SystemUI/src/com/android/systemui/BatteryMeterView.java +6 −1 Original line number Diff line number Diff line Loading @@ -178,6 +178,10 @@ public class BatteryMeterView extends View implements DemoMode { super(context, attrs, defStyle); final Resources res = context.getResources(); TypedArray atts = context.obtainStyledAttributes(attrs, R.styleable.BatteryMeterView, defStyle, 0); final int frameColor = atts.getColor(R.styleable.BatteryMeterView_frameColor, res.getColor(R.color.batterymeter_frame_color)); TypedArray levels = res.obtainTypedArray(R.array.batterymeter_color_levels); TypedArray colors = res.obtainTypedArray(R.array.batterymeter_color_values); Loading @@ -189,12 +193,13 @@ public class BatteryMeterView extends View implements DemoMode { } levels.recycle(); colors.recycle(); atts.recycle(); mShowPercent = ENABLE_PERCENT && 0 != Settings.System.getInt( context.getContentResolver(), "status_bar_show_battery_percent", 0); mWarningString = context.getString(R.string.battery_meter_very_low_overlay_symbol); mFramePaint = new Paint(Paint.ANTI_ALIAS_FLAG); mFramePaint.setColor(res.getColor(R.color.batterymeter_frame_color)); mFramePaint.setColor(frameColor); mFramePaint.setDither(true); mFramePaint.setStrokeWidth(0); mFramePaint.setStyle(Paint.Style.FILL_AND_STROKE); Loading Loading
packages/SystemUI/res/layout/quick_settings_tile_battery.xml +2 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="top" Loading @@ -27,6 +28,7 @@ android:layout_height="32dp" android:padding="3dp" android:layout_gravity="top|center_horizontal" systemui:frameColor="@color/qs_batterymeter_frame_color" /> <TextView style="@style/TextAppearance.QuickSettings.TileView" Loading
packages/SystemUI/res/values/attrs.xml +3 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,9 @@ <attr name="decayTime" format="integer" /> <attr name="orientation" /> </declare-styleable> <declare-styleable name="BatteryMeterView"> <attr name="frameColor" format="color" /> </declare-styleable> <attr name="orientation"> <enum name="horizontal" value="0" /> <enum name="vertical" value="1" /> Loading
packages/SystemUI/res/values/colors.xml +1 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ <color name="batterymeter_frame_color">#66FFFFFF</color><!-- 40% white --> <color name="batterymeter_charge_color">#FFFFFFFF</color> <color name="batterymeter_bolt_color">#FFFFFFFF</color> <color name="qs_batterymeter_frame_color">#FF404040</color> <color name="status_bar_clock_color">#FFFFFFFF</color> <drawable name="notification_item_background_color">#ff111111</drawable> <drawable name="notification_item_background_color_pressed">#ff454545</drawable> Loading
packages/SystemUI/src/com/android/systemui/BatteryMeterView.java +6 −1 Original line number Diff line number Diff line Loading @@ -178,6 +178,10 @@ public class BatteryMeterView extends View implements DemoMode { super(context, attrs, defStyle); final Resources res = context.getResources(); TypedArray atts = context.obtainStyledAttributes(attrs, R.styleable.BatteryMeterView, defStyle, 0); final int frameColor = atts.getColor(R.styleable.BatteryMeterView_frameColor, res.getColor(R.color.batterymeter_frame_color)); TypedArray levels = res.obtainTypedArray(R.array.batterymeter_color_levels); TypedArray colors = res.obtainTypedArray(R.array.batterymeter_color_values); Loading @@ -189,12 +193,13 @@ public class BatteryMeterView extends View implements DemoMode { } levels.recycle(); colors.recycle(); atts.recycle(); mShowPercent = ENABLE_PERCENT && 0 != Settings.System.getInt( context.getContentResolver(), "status_bar_show_battery_percent", 0); mWarningString = context.getString(R.string.battery_meter_very_low_overlay_symbol); mFramePaint = new Paint(Paint.ANTI_ALIAS_FLAG); mFramePaint.setColor(res.getColor(R.color.batterymeter_frame_color)); mFramePaint.setColor(frameColor); mFramePaint.setDither(true); mFramePaint.setStrokeWidth(0); mFramePaint.setStyle(Paint.Style.FILL_AND_STROKE); Loading