Cherish: sAdd BatteryBar customizations [2/2]

Change-Id: I6ffcb245db5479e8d818cc31ceb573e17e38f0bb
Signed-off-by: Shubham Singh <coolsks94@gmail.com>
Signed-off-by: SagarMakhar <sagarmakhar@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
cphelps76
2016-10-09 14:20:15 +02:00
committed by Hưng Phan
parent 80cf5bd3f0
commit 8b39f35bbd
5 changed files with 392 additions and 0 deletions

View File

@@ -213,4 +213,42 @@
<item>1</item>
<item>0</item>
</string-array>
<!-- Battery bar -->
<string-array name="battery_bar_entries">
<item>@string/battery_bar_location_hide</item>
<item>@string/battery_bar_location_statusbar</item>
<item>@string/battery_bar_location_top_navbar</item>
<item>@string/battery_bar_location_bottom_navbar</item>
</string-array>
<string-array name="battery_bar_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</string-array>
<string-array name="battery_bar_no_navbar_entries">
<item>@string/battery_bar_location_hide</item>
<item>@string/battery_bar_location_statusbar</item>
</string-array>
<string-array name="battery_bar_no_navbar_values" translatable="false">
<item>0</item>
<item>1</item>
</string-array>
<string-array name="battery_bar_style_entries" translatable="false">
<item>@string/battery_bar_style_regular</item>
<item>@string/battery_bar_style_center_mirrored</item>
<item>@string/battery_bar_style_reversed</item>
</string-array>
<string-array name="battery_bar_style_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
</resources>

View File

@@ -394,4 +394,30 @@
<string name="status_bar_toggle_brightness">Brightness control</string>
<string name="status_bar_toggle_brightness_summary">Adjust brightness by sliding across the status bar</string>
<!-- Battery Bar -->
<string name="battery_bar_title">Battery bar</string>
<string name="battery_bar_summary">Display and customize battery bar near status bar or navigation bar</string>
<string name="battery_bar">Battery bar location</string>
<string name="battery_bar_no_navbar">Battery bar location</string>
<string name="battery_bar_location_hide">Hide</string>
<string name="battery_bar_location_statusbar">Statusbar</string>
<string name="battery_bar_location_top_navbar">Top of navbar</string>
<string name="battery_bar_location_bottom_navbar">Bottom of navbar</string>
<string name="battery_bar_color">Battery bar color</string>
<string name="battery_bar_charging_color">Battery bar charging color</string>
<string name="battery_bar_battery_low_color">Battery bar low battery color</string>
<string name="battery_bar_cat">Battery bar style</string>
<string name="battery_bar_style_title">Battery bar alignment</string>
<string name="battery_bar_thickness_title">Battery bar thickness</string>
<string name="battery_bar_animate_title">Charging animation</string>
<string name="battery_bar_style_regular">Regular</string>
<string name="battery_bar_style_center_mirrored">Center-mirrored</string>
<string name="battery_bar_style_reversed">Reversed</string>
<string name="battery_bar_use_charging_color">Custom charging color</string>
<string name="battery_bar_blend_color_title">Blend colors</string>
<string name="battery_bar_blend_color_summary">Blend full/empty colors corresponding to battery percentage</string>
<string name="battery_bar_blend_color_reverse_title">Reverse color direction</string>
<string name="battery_bar_blend_color_reverse_summary_off">Full &#8594; empty: red &#8592; green &#8592; blue &#8592; red</string>
<string name="battery_bar_blend_color_reverse_summary_on">Full &#8594; empty: red &#8594; green &#8594; blue &#8594; red</string>
</resources>

83
res/xml/battery_bar.xml Normal file
View File

@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2018 AospExtended ROM Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen
android:title="@string/battery_bar_title"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<ListPreference
android:key="statusbar_battery_bar_list"
android:title="@string/battery_bar"
android:entries="@array/battery_bar_entries"
android:entryValues="@array/battery_bar_values" />
<ListPreference
android:key="statusbar_battery_bar_no_navbar_list"
android:title="@string/battery_bar_no_navbar"
android:entries="@array/battery_bar_no_navbar_entries"
android:entryValues="@array/battery_bar_no_navbar_values" />
<net.margaritov.preference.colorpicker.ColorPickerPreference
android:key="statusbar_battery_bar_color"
android:title="@string/battery_bar_color"
android:defaultValue="0xffffff" />
<net.margaritov.preference.colorpicker.ColorPickerPreference
android:key="statusbar_battery_bar_battery_low_color"
android:title="@string/battery_bar_battery_low_color"
android:defaultValue="0xffffff" />
<net.margaritov.preference.colorpicker.ColorPickerPreference
android:key="statusbar_battery_bar_enable_charging_color"
android:title="@string/battery_bar_use_charging_color"
android:defaultValue="true" />
<net.margaritov.preference.colorpicker.ColorPickerPreference
android:key="statusbar_battery_bar_charging_color"
android:title="@string/battery_bar_charging_color"
android:defaultValue="0xffffff"
android:dependency="statusbar_battery_bar_enable_charging_color" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="statusbar_battery_bar_blend_color"
android:title="@string/battery_bar_blend_color_title"
android:summary="@string/battery_bar_blend_color_summary"
android:defaultValue="false" />
<con.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="statusbar_battery_bar_blend_color_reverse"
android:title="@string/battery_bar_blend_color_reverse_title"
android:summaryOn="@string/battery_bar_blend_color_reverse_summary_on"
android:summaryOff="@string/battery_bar_blend_color_reverse_summary_off"
android:dependency="statusbar_battery_bar_blend_color"
android:defaultValue="false" />
<ListPreference
android:key="statusbar_battery_bar_style"
android:title="@string/battery_bar_style_title"
android:entries="@array/battery_bar_style_entries"
android:entryValues="@array/battery_bar_style_values" />
<con.cherish.settings.preferences.CustomSeekBarPreference
android:key="statusbar_battery_bar_thickness"
android:title="@string/battery_bar_thickness_title"
android:max="4"
settings:min="1"
settings:units="dp"
android:persistent="false" />
<SwitchPreference
android:key="statusbar_battery_bar_animate"
android:title="@string/battery_bar_animate_title" />
</PreferenceScreen>

View File

@@ -80,6 +80,11 @@
android:targetPackage="com.android.systemui"
android:targetClass="com.android.systemui.tuner.StatusbarItemsActivity" />
</Preference>
<Preference
android:key="battery_bar_category"
android:fragment="com.cherish.settings.fragments.BatteryBar"
android:title="@string/battery_bar_title" />
</PreferenceCategory>