summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2014-06-26 13:48:55 -0700
committerFabrice Di Meglio <fdimeglio@google.com>2014-06-26 14:04:11 -0700
commit200cca4c1d849ba4c62674fcfd32c621805b2bd4 (patch)
treefb01e60b3f6b52c6afa89a9e9021aaa8bf361a1f
parentc0ac943eb6d7271f95f5a2e5345692f6c5a35f18 (diff)
downloadpackages_apps_Settings-200cca4c1d849ba4c62674fcfd32c621805b2bd4.zip
packages_apps_Settings-200cca4c1d849ba4c62674fcfd32c621805b2bd4.tar.gz
packages_apps_Settings-200cca4c1d849ba4c62674fcfd32c621805b2bd4.tar.bz2
Fix icon size for Data Usage / Battery Stats / Process Stats
- remove padding from app_percentage_item and apply it correctly on its containers - wrap app_percentage_item into preference_app_percentage for having correct padding o nProcessStatsPreference and PowerGaugePreference Change-Id: I290c92959f51a33a1edb49435cd0bd1e6cd9afa3
-rw-r--r--res/layout/app_percentage_item.xml8
-rw-r--r--res/layout/data_usage_item.xml4
-rw-r--r--res/layout/preference_app_percentage.xml25
-rw-r--r--res/layout/process_stats_details.xml6
-rwxr-xr-xres/values/dimens.xml3
-rw-r--r--src/com/android/settings/applications/ProcessStatsPreference.java2
-rw-r--r--src/com/android/settings/fuelgauge/PowerGaugePreference.java2
7 files changed, 36 insertions, 14 deletions
diff --git a/res/layout/app_percentage_item.xml b/res/layout/app_percentage_item.xml
index 695201e..9f5ae55 100644
--- a/res/layout/app_percentage_item.xml
+++ b/res/layout/app_percentage_item.xml
@@ -18,20 +18,18 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
- android:paddingStart="?android:attr/listPreferredItemPaddingStart"
- android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingTop="8dip"
android:paddingBottom="8dip"
android:columnCount="3">
<ImageView
android:id="@android:id/icon"
- android:layout_width="@dimen/app_icon_size"
- android:layout_height="@dimen/app_icon_size"
+ android:layout_width="@android:dimen/app_icon_size"
+ android:layout_height="@android:dimen/app_icon_size"
android:layout_gravity="center"
+ android:scaleType="fitXY"
android:layout_rowSpan="3"
android:layout_marginEnd="8dip"
- android:scaleType="centerInside"
android:contentDescription="@null" />
<TextView
diff --git a/res/layout/data_usage_item.xml b/res/layout/data_usage_item.xml
index fac3c6b..6f496d5 100644
--- a/res/layout/data_usage_item.xml
+++ b/res/layout/data_usage_item.xml
@@ -16,7 +16,9 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+ android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
<include layout="@layout/app_percentage_item" />
diff --git a/res/layout/preference_app_percentage.xml b/res/layout/preference_app_percentage.xml
new file mode 100644
index 0000000..7dc9d46
--- /dev/null
+++ b/res/layout/preference_app_percentage.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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="match_parent"
+ android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+ android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
+
+ <include layout="@layout/app_percentage_item" />
+
+</LinearLayout>
diff --git a/res/layout/process_stats_details.xml b/res/layout/process_stats_details.xml
index 0a68da0..fac9e97 100644
--- a/res/layout/process_stats_details.xml
+++ b/res/layout/process_stats_details.xml
@@ -27,15 +27,15 @@
android:layout_height="match_parent"
android:paddingTop="5dip"
android:paddingBottom="5dip"
- android:orientation="vertical">
+ android:orientation="vertical"
+ android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+ android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
<include layout="@layout/app_percentage_item" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:paddingStart="?android:attr/listPreferredItemPaddingStart"
- android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:orientation="vertical">
<!-- Force stop and report buttons -->
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 7a52de4..de53006 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -90,9 +90,6 @@
<!-- Default text size for caption preview samples. Uses dp rather than sp because captions are not scaled. -->
<dimen name="caption_preview_text_size">48dp</dimen>
- <!-- Dashboard image tile size -->
- <dimen name="app_icon_size">24dp</dimen>
-
<!-- ActionBar height -->
<dimen name="actionbar_size">56dip</dimen>
diff --git a/src/com/android/settings/applications/ProcessStatsPreference.java b/src/com/android/settings/applications/ProcessStatsPreference.java
index eeec796..197f00a 100644
--- a/src/com/android/settings/applications/ProcessStatsPreference.java
+++ b/src/com/android/settings/applications/ProcessStatsPreference.java
@@ -47,7 +47,7 @@ public class ProcessStatsPreference extends Preference {
public ProcessStatsPreference(Context context, AttributeSet attrs, int defStyleAttr,
int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
- setLayoutResource(R.layout.app_percentage_item);
+ setLayoutResource(R.layout.preference_app_percentage);
}
public void init(Drawable icon, ProcStatsEntry entry) {
diff --git a/src/com/android/settings/fuelgauge/PowerGaugePreference.java b/src/com/android/settings/fuelgauge/PowerGaugePreference.java
index a3237b3..990b654 100644
--- a/src/com/android/settings/fuelgauge/PowerGaugePreference.java
+++ b/src/com/android/settings/fuelgauge/PowerGaugePreference.java
@@ -37,7 +37,7 @@ public class PowerGaugePreference extends Preference {
public PowerGaugePreference(Context context, Drawable icon, BatteryEntry info) {
super(context);
- setLayoutResource(R.layout.app_percentage_item);
+ setLayoutResource(R.layout.preference_app_percentage);
setIcon(icon != null ? icon : new ColorDrawable(0));
mInfo = info;
}