Add new battery usage design required string and dimesions
Bug: 183921876
Test: make SettingsRoboTests
Test: make SettingsGoogleRoboTests
Change-Id: I82fed0a38168aba47e8267ab4a5fa072d54dce67
diff --git a/res/layout/battery_chart_graph.xml b/res/layout/battery_chart_graph.xml
new file mode 100644
index 0000000..ed21586
--- /dev/null
+++ b/res/layout/battery_chart_graph.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:settings="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingStart="?android:attr/listPreferredItemPaddingEnd"
+ android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/chart_summary"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="45dp"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ settings:textColor="?android:attr/textColorSecondary"
+ android:text="@string/battery_usage_chart_graph_hint" />
+
+ <com.android.settings.fuelgauge.BatteryChartView
+ android:id="@+id/battery_chart"
+ android:layout_width="match_parent"
+ android:layout_height="151dp"
+ android:layout_marginBottom="16dp"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ settings:textColor="?android:attr/textColorSecondary" />
+
+</LinearLayout>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index e0e0219..aca3322 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -446,4 +446,11 @@
<!-- Choose SIM Activity dimens -->
<dimen name="subtitle_bottom_padding">24dp</dimen>
+
+ <!-- Battery usage chart view component -->
+ <dimen name="chartview_divider_width">1dp</dimen>
+ <dimen name="chartview_divider_height">4dp</dimen>
+ <dimen name="chartview_trapezoid_radius">2dp</dimen>
+ <dimen name="chartview_trapezoid_margin_start">1dp</dimen>
+ <dimen name="chartview_trapezoid_margin_bottom">2dp</dimen>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index fcf2f45..d06e8af 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -6348,6 +6348,21 @@
<!-- [CHAR_LIMIT=NONE] Battery percentage: Description for preference -->
<string name="battery_percentage_description">Show battery percentage in status bar</string>
+ <!-- [CHAR_LIMIT=NONE] Battery usage main screen chart graph hint -->
+ <string name="battery_usage_chart_graph_hint">Battery level for past 24 hr</string>
+ <!-- [CHAR_LIMIT=NONE] Battery app usage section header for past 24 hour -->
+ <string name="battery_app_usage_for_past_24">App usage for past 24 hr</string>
+ <!-- [CHAR_LIMIT=NONE] Battery system usage section header for past 24 hour -->
+ <string name="battery_system_usage_for_past_24">System usage for past 24 hr</string>
+ <!-- [CHAR_LIMIT=NONE] Battery system usage section header -->
+ <string name="battery_system_usage_for">System usage for</string>
+ <!-- [CHAR_LIMIT=NONE] Battery app usage section header -->
+ <string name="battery_app_usage_for">App usage for</string>
+ <!-- [CHAR_LIMIT=NONE] Battery usage section header for a specific time slot -->
+ <string name="battery_usage_time_am">am</string>
+ <!-- [CHAR_LIMIT=NONE] Battery usage section header for a specific time slot -->
+ <string name="battery_usage_time_pm">pm</string>
+
<!-- Process Stats strings -->
<skip />