am ea38e678: Show history of battery level.

Merge commit 'ea38e678537cf740b5f30c1d69c7a332e98cdd2c'

* commit 'ea38e678537cf740b5f30c1d69c7a332e98cdd2c':
  Show history of battery level.
This commit is contained in:
Dianne Hackborn
2010-06-11 12:57:17 -07:00
committed by Android Git Automerger
18 changed files with 597 additions and 2675 deletions

View File

@@ -1,144 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/topLayout"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:id="@+id/graphLayout"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Spinner
android:id="@+id/typeSpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:entries="@array/battery_history_type_spinner" />
<Spinner
android:id="@+id/whichSpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:entries="@array/battery_history_which_spinner" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/messageText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textSize="17dp"
android:visibility="gone" />
<com.android.settings.battery_history.GraphableButton
android:id="@+id/button0"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="4dp"
android:layout_weight="1" />
<com.android.settings.battery_history.GraphableButton
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="4dp"
android:layout_weight="1" />
<com.android.settings.battery_history.GraphableButton
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="4dp"
android:layout_weight="1" />
<com.android.settings.battery_history.GraphableButton
android:id="@+id/button3"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="4dp"
android:layout_weight="1" />
<com.android.settings.battery_history.GraphableButton
android:id="@+id/button4"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="4dp"
android:layout_weight="1" />
<com.android.settings.battery_history.GraphableButton
android:id="@+id/button5"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="4dp"
android:layout_weight="1" />
<com.android.settings.battery_history.GraphableButton
android:id="@+id/button6"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="4dp"
android:layout_weight="1" />
<com.android.settings.battery_history.GraphableButton
android:id="@+id/button7"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="4dp"
android:layout_weight="1" />
</LinearLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:id="@+id/textLayout"
android:visibility="gone"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/detailsText"
android:layout_width="match_parent"
android:textSize="17dp"
android:layout_height="1000dp"/>
</ScrollView>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 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.
-->
<com.android.settings.fuelgauge.BatteryHistoryChart
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:id="@+android:id/battery_history_chart"
android:paddingRight="?android:attr/scrollbarSize"
android:textAppearance="?android:attr/textAppearanceMedium"
android:shadowRadius="4"
android:shadowColor="?android:attr/colorBackground"
android:shadowDx="2"
android:shadowDy="2">
</com.android.settings.fuelgauge.BatteryHistoryChart>

View File

@@ -1,60 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
* Copyright (C) 2008 Google Inc.
*
* 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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1">
<ListView android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawSelectorOnTop="false"
android:fastScrollEnabled="true" />
<TextView android:id="@android:id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/no_running_services"
android:textAppearance="?android:attr/textAppearanceLarge" />
</FrameLayout>
<view class="com.android.settings.applications.RunningServices$LinearColorBar"
android:id="@+id/color_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="4dp">
<TextView android:id="@+id/foregroundText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceSmallInverse"
android:color="?android:attr/textColorPrimaryInverse"
android:singleLine="true" />
<TextView android:id="@+id/backgroundText"
android:layout_gravity="center_vertical|right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:textAppearance="?android:attr/textAppearanceSmallInverse"
android:color="?android:attr/textColorPrimaryInverse"
android:singleLine="true" />
</view>
</LinearLayout>

View File

@@ -1,86 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2008, 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"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:orientation="vertical"
android:gravity="fill" >
<ImageView android:id="@+id/separator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="?android:attr/listDivider"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
android:paddingRight="6dip"
android:paddingLeft="6dip"
android:gravity="center_vertical" >
<ImageView android:id="@+id/icon"
android:layout_width="@android:dimen/app_icon_size"
android:layout_height="@android:dimen/app_icon_size"
android:layout_marginLeft="5dip"
android:layout_marginRight="11dip"
android:layout_gravity="center_vertical"
android:scaleType="fitCenter"/>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:orientation="horizontal"
android:baselineAlignedChildIndex="0"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold"
android:singleLine="true"
android:ellipsize="marquee"
android:layout_marginBottom="2dip" />
<TextView android:id="@+id/size"
android:layout_gravity="center_vertical|right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<TextView android:id="@+id/description"
android:layout_marginTop="-4dip"
android:layout_gravity="center_vertical|left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="4dip"
android:singleLine="true"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@@ -285,23 +285,6 @@
<item>2</item>
</string-array>
<!-- Match with constants in BatteryHistory class -->
<string-array name="battery_history_type_spinner">
<item>CPU usage</item>
<item>Network usage</item>
<item>GPS usage</item>
<item>Sensor usage</item>
<item>Partial wake usage</item>
<item>Other usage</item>
</string-array>
<!-- Match with constants in BatteryStats class -->
<string-array name="battery_history_which_spinner">
<item>Since last unplugged</item>
<item>Total since boot</item>
<item>Total in all time</item>
</string-array>
<!-- Display options for UsageStats class -->
<string-array name="usage_stats_display_order_types">
<item>Usage Time</item>

View File

@@ -21,4 +21,25 @@
<declare-styleable name="IconPreferenceScreen">
<attr name="icon" format="reference" />
</declare-styleable>
<declare-styleable name="BatteryHistoryChart">
<!-- Base text color, typeface, size, and style. -->
<attr name="android:textAppearance" />
<!-- Text color. -->
<attr name="android:textColor" />
<!-- Size of the text. Recommended dimension type for text is "sp" for scaled-pixels (example: 15sp). -->
<attr name="android:textSize" />
<!-- Typeface (normal, sans, serif, monospace) for the text. -->
<attr name="android:typeface" />
<!-- Style (bold, italic, bolditalic) for the text. -->
<attr name="android:textStyle" />
<!-- Place a shadow of the specified color behind the text. -->
<attr name="android:shadowColor" />
<!-- Horizontal offset of the shadow. -->
<attr name="android:shadowDx" />
<!-- Vertical offset of the shadow. -->
<attr name="android:shadowDy" />
<!-- Radius of the shadow. -->
<attr name="android:shadowRadius" />
</declare-styleable>
</resources>

View File

@@ -429,8 +429,6 @@
<string name="device_info_label">Device info</string>
<!-- The title of the activity to see battery info. -->
<string name="battery_info_label">Battery info</string>
<!-- The title of the activity to see battery history. -->
<string name="battery_history_label">Battery history</string>
<!-- The title of the activity to adjust display settings -->
<string name="display_label">Display</string>
<!-- The title of the activity to see phone info -->
@@ -1792,19 +1790,6 @@ found in the list of installed applications.</string>
<string name="runningservices_settings_summary">View and control currently running services</string>
<!-- Label for a service item when it is restarting -->
<string name="service_restarting">Restarting</string>
<!-- Running services, body text when there are no services to show -->
<string name="no_running_services">No running services</string>
<!-- Running services, title of dialog to stop a service -->
<string name="confirm_stop_service">Stop service?</string>
<!-- Running services, message of dialog to stop a service -->
<string name="confirm_stop_service_msg">The service will no longer run until
started again. This may have undesirable
consequences on the application
<xliff:g id="application">%1$s</xliff:g>.</string>
<!-- Running services, button to stop a service -->
<string name="confirm_stop_stop">Stop</string>
<!-- Running services, button to cancel stopping of a service -->
<string name="confirm_stop_cancel">Cancel</string>
<!-- Running services, description for a service in the started state -->
<string name="service_started_by_app">Started by application.</string>
<!-- Running services, description for a service in the started state -->
@@ -1839,13 +1824,13 @@ found in the list of installed applications.</string>
<!-- Running service details, stop a service that has started itself. -->
<string name="service_stop">Stop</string>
<!-- Running service details, manage a service that is running for some other reason. -->
<string name="service_manage">Manage</string>
<string name="service_manage">Settings</string>
<!-- Running service details, default description for services that are started. -->
<string name="service_stop_description">This service was started by its
application. Stopping it may cause the application to misbehave.</string>
application. Stopping it may cause the application to fail.</string>
<!-- Running service details, default description for services that are managed. -->
<string name="service_manage_description"><xliff:g id="client_name">%1$s</xliff:g>:
currently in use. You can manage your settings to stop it.</string>
currently in use. Touch Settings to control it.</string>
<!-- Description of the main process in the details. -->
<string name="main_running_process_description">Main process that is in use.</string>
<!-- Message that a process's service is in use. -->
@@ -1995,39 +1980,6 @@ found in the list of installed applications.</string>
the final name for Gadgets/Widgets, so please translate both for now. -->
<string name="widget_picker_title">Choose widget</string>
<!-- Used to display "Details for UID 1234" in BatteryHistory -->
<string name="battery_history_details_for">Details for UID <xliff:g id="number" example="1234">%d</xliff:g></string>
<!-- Used to name a set of apps that share a user id in BatteryHistory -->
<string name="battery_history_uid">UID <xliff:g id="user_id">%1$d</xliff:g></string>
<!-- Used as a title for the network usage details screen in BatteryHistory -->
<string name="battery_history_network_usage">Network usage details for <xliff:g id="app_name">%1$s</xliff:g>:</string>
<!-- Used to show the number of bytes received by an app over the network in BatteryHistory -->
<string name="battery_history_bytes_received">Bytes received: <xliff:g id="bytes">%1$d</xliff:g></string>
<!-- Used to show the number of bytes sent by an app over the network in BatteryHistory -->
<string name="battery_history_bytes_sent">Bytes sent: <xliff:g id="bytes">%1$d</xliff:g></string>
<!-- Used to show the number of bytes sent and received by an app over the network in BatteryHistory -->
<string name="battery_history_bytes_total">Total bytes: <xliff:g id="bytes">%1$d</xliff:g></string>
<!-- Used as a title for the cpu usage details screen in BatteryHistory -->
<string name="battery_history_cpu_usage">CPU usage details for <xliff:g id="app_name">%1$s</xliff:g>:</string>
<!-- Used to show the time spent in user code for a given app in BatteryHistory -->
<string name="battery_history_user_time">User time: </string>
<!-- Used to show the time spent in system code for a given app in BatteryHistory -->
<string name="battery_history_system_time">System time: </string>
<!-- Used to show the time spent in user or system code for a given app in BatteryHistory -->
<string name="battery_history_total_time">Total time: </string>
<!-- Used to show the number of times an app has been started in BatteryHistory -->
<string name="battery_history_starts">Starts: <xliff:g id="starts">%1$d</xliff:g></string>
<!-- Used to show an amount of time in the form "d days, h hours, m minutes, s seconds" in BatteryHistory -->
<string name="battery_history_days"><xliff:g id="days">%1$d</xliff:g>d <xliff:g id="hours">%2$d</xliff:g>h <xliff:g id="minutes">%3$d</xliff:g>m <xliff:g id="seconds">%4$d</xliff:g>s</string>
@@ -2039,52 +1991,7 @@ found in the list of installed applications.</string>
<!-- Used to show an amount of time in the form "s seconds" in BatteryHistory -->
<string name="battery_history_seconds"><xliff:g id="seconds">%1$d</xliff:g>s</string>
<!-- Used to head a list of packages that share a given user id BatteryHistory -->
<string name="battery_history_packages_sharing_this_uid">Packages sharing this UID:</string>
<!-- Used when no battery data available in BatteryHistory -->
<string name="battery_history_no_data">No battery usage data available</string>
<!-- Used for Sensor detail screen in BatteryHistory -->
<string name="battery_history_sensor">Sensor:</string>
<!-- Used for Wakelock detail screen in BatteryHistory -->
<string name="battery_history_wakelock">Partial Wakelock:</string>
<!-- Used for Sensor detail screen in BatteryHistory -->
<string name="battery_history_used_by_packages">Sensor used by packages:</string>
<!-- Used for Sensor detail screen in BatteryHistory -->
<string name="battery_history_sensor_usage">Used <xliff:g id="count">%1$d</xliff:g> times by <xliff:g id="package">%2$s</xliff:g></string>
<!-- Used for Sensor detail screen in BatteryHistory -->
<string name="battery_history_sensor_usage_multi">Used <xliff:g id="count">%1$d</xliff:g> times by one of:</string>
<!-- Used for label of awake bar in BatteryHistory -->
<string name="battery_history_awake_label">Running</string>
<!-- Used for label of screen on bar in BatteryHistory -->
<string name="battery_history_screen_on_label">Screen on</string>
<!-- Used for label of phone on bar in BatteryHistory -->
<string name="battery_history_phone_on_label">Phone on</string>
<!-- Used for awake time message in BatteryHistory -->
<string name="battery_history_awake">Time spent without sleeping:</string>
<!-- Used for Screen on time message in BatteryHistory -->
<string name="battery_history_screen_on">Time spent with screen on:</string>
<!-- Used for Phone on time message in BatteryHistory -->
<string name="battery_history_phone_on">Time spent with phone on:</string>
<!-- Used for Screen on time message in BatteryHistory -->
<string name="battery_history_screen_on_battery">On battery:</string>
<!-- XXX remove? Used for Screen on time message in BatteryHistory -->
<string name="battery_history_screen_on_plugged">Plugged in:</string>
<!-- XXX remove? Strings used for displaying usage statistics -->
<string name="usage_stats_label">Usage statistics</string>
@@ -2151,6 +2058,8 @@ found in the list of installed applications.</string>
<string name="battery_since_unplugged">Battery use since unplugged</string>
<!-- Battery usage since user reset the stats -->
<string name="battery_since_reset">Battery use since reset</string>
<!-- Battery usage on battery duration -->
<string name="battery_stats_on_battery"><xliff:g id="time">%1$s</xliff:g> on battery</string>
<!-- Battery usage duration -->
<string name="battery_stats_duration"><xliff:g id="time">%1$s</xliff:g> since unplugged</string>
<!-- Battery usage during last unplugged period -->