Show time remaining / to charge.

Rework the battery graph to include the time remaining or
time to charge.

Change-Id: Ib26b761cb10e01f5f3aa4189db10d44b8ce62f89
This commit is contained in:
Dianne Hackborn
2014-04-23 17:14:15 -07:00
parent 4f700a3b3c
commit 0be7598cb8
9 changed files with 269 additions and 137 deletions

View File

@@ -16,13 +16,15 @@
<com.android.settings.fuelgauge.BatteryHistoryChart
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.android.settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:minHeight="128dp"
android:gravity="center_vertical"
android:id="@+android:id/battery_history_chart"
android:paddingEnd="?android:attr/scrollbarSize"
android:textAppearance="?android:attr/textAppearanceMedium"
app:headerAppearance="?android:attr/textAppearanceMedium"
android:shadowRadius="4"
android:shadowColor="?android:attr/colorBackground"
android:shadowDx="2"

View File

@@ -41,6 +41,8 @@
<attr name="android:shadowDy" />
<!-- Radius of the shadow. -->
<attr name="android:shadowRadius" />
<!-- Text color, typeface, size, and style of header. -->
<attr name="headerAppearance" format="reference" />
</declare-styleable>
<declare-styleable name="PercentageBarChart">

View File

@@ -3279,6 +3279,27 @@
<!-- Used to show an amount of time in the form "m minutes, s seconds" in BatteryHistory -->
<string name="battery_history_minutes_no_seconds"><xliff:g id="minutes">%1$d</xliff:g>m</string>
<!-- [CHAR LIMIT=20] Used to show an amount of time in the form "d days" in BatteryHistory -->
<string name="battery_history_days_only"><xliff:g id="days">%1$d</xliff:g>d</string>
<!-- [CHAR LIMIT=20] Used to show an amount of time in the form "d days, h hours" in BatteryHistory -->
<string name="battery_history_days_and_hours"><xliff:g id="days">%1$d</xliff:g>d
<xliff:g id="hours">%2$d</xliff:g>h</string>
<!-- [CHAR LIMIT=20] Used to show an amount of time in the form "h hours" in BatteryHistory -->
<string name="battery_history_hours_only"><xliff:g id="hours">%1$d</xliff:g>h</string>
<!-- [CHAR LIMIT=20] Used to show an amount of time in the form "h hours, m minutes" in BatteryHistory -->
<string name="battery_history_hours_and_minutes"><xliff:g id="hours">%1$d</xliff:g>h
<xliff:g id="minutes">%2$d</xliff:g>m</string>
<!-- [CHAR LIMIT=20] Used to show an amount of time in the form "m minutes" in BatteryHistory -->
<string name="battery_history_minutes_only"><xliff:g id="minutes">%1$d</xliff:g>m</string>
<!-- [CHAR LIMIT=20] Used to show an amount of time in the form "m minutes, s seconds" in BatteryHistory -->
<string name="battery_history_minutes_and_seconds"><xliff:g id="minutes">%1$d</xliff:g>m
<xliff:g id="seconds">%2$d</xliff:g>s</string>
<!-- XXX remove? Strings used for displaying usage statistics -->
<string name="usage_stats_label">Usage statistics</string>
@@ -3562,8 +3583,13 @@
<string name="power_usage_summary">What has been using the battery</string>
<!-- Message to show when battery usage data is not available [CHAR LIMIT=30] -->
<string name="power_usage_not_available">Battery usage data isn\'t available.</string>
<!-- Display the battery level and status [CHAR_LIMIT=30] -->
<string name="power_usage_level_and_status"><xliff:g id="level">%1$s</xliff:g> - <xliff:g id="status">%2$s</xliff:g></string>
<!-- Display the battery level and status [CHAR_LIMIT=60] -->
<string name="power_usage_level_and_status"><xliff:g id="level">%1$s</xliff:g>
- <xliff:g id="status">%2$s</xliff:g></string>
<!-- Display time remaining until battery is discharged [CHAR_LIMIT=60] -->
<string name="power_discharge_remaining"><xliff:g id="remain">%1$s</xliff:g> remaining</string>
<!-- Display time remaining until battery is charged [CHAR_LIMIT=60] -->
<string name="power_charge_remaining"><xliff:g id="until_charged">%1$s</xliff:g> to charge</string>
<!-- Battery usage since unplugged -->
<string name="battery_since_unplugged">Battery use since unplugged</string>
<!-- Battery usage since user reset the stats -->

View File

@@ -17,9 +17,4 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/power_usage_summary_title"
android:key="app_list">
<Preference
style="?android:attr/preferenceInformationStyle"
android:key="battery_status"
android:persistent="false"
/>
</PreferenceScreen>