summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2010-11-17 15:21:18 -0800
committerAmith Yamasani <yamasani@google.com>2010-11-17 16:37:16 -0800
commit43a673053f2e9b1ace7ad9f32a58ae37f3e431d3 (patch)
tree95004921acaea7e12d63ca57a3bfa563b294a755
parent8ba83bf5ff70dca2c31c644c3fde7c9f5d7d92ea (diff)
downloadpackages_apps_settings-43a673053f2e9b1ace7ad9f32a58ae37f3e431d3.zip
packages_apps_settings-43a673053f2e9b1ace7ad9f32a58ae37f3e431d3.tar.gz
packages_apps_settings-43a673053f2e9b1ace7ad9f32a58ae37f3e431d3.tar.bz2
Use the new Preference:icon attribute and placeholder for showing icons on the left.
-rw-r--r--res/drawable-hdpi/nav_divider.pngbin1012 -> 320 bytes
-rw-r--r--res/drawable-mdpi/nav_divider.pngbin2846 -> 311 bytes
-rw-r--r--res/layout/account_preference.xml45
-rw-r--r--res/layout/preference_bluetooth.xml45
-rw-r--r--res/layout/preference_bluetooth_profile.xml46
-rw-r--r--src/com/android/settings/AccountPreference.java4
-rw-r--r--src/com/android/settings/bluetooth/BluetoothDevicePreference.java4
-rw-r--r--src/com/android/settings/bluetooth/BluetoothProfilePreference.java4
-rw-r--r--src/com/android/settings/bluetooth/DeviceProfilesSettings.java1
-rw-r--r--src/com/android/settings/fuelgauge/PowerGaugePreference.java2
-rw-r--r--src/com/android/settings/fuelgauge/PowerUsageSummary.java2
11 files changed, 17 insertions, 136 deletions
diff --git a/res/drawable-hdpi/nav_divider.png b/res/drawable-hdpi/nav_divider.png
index 7ca3e61..b1f035c 100644
--- a/res/drawable-hdpi/nav_divider.png
+++ b/res/drawable-hdpi/nav_divider.png
Binary files differ
diff --git a/res/drawable-mdpi/nav_divider.png b/res/drawable-mdpi/nav_divider.png
index c9413d7..f7ed6df 100644
--- a/res/drawable-mdpi/nav_divider.png
+++ b/res/drawable-mdpi/nav_divider.png
Binary files differ
diff --git a/res/layout/account_preference.xml b/res/layout/account_preference.xml
index 810c57a..5e2edc6 100644
--- a/res/layout/account_preference.xml
+++ b/res/layout/account_preference.xml
@@ -14,51 +14,8 @@
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:gravity="center_vertical"
- android:paddingLeft="16dip"
- android:paddingRight="?android:attr/scrollbarSize">
-
- <ImageView
- android:id="@+id/providerIcon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="5dip"
- android:layout_gravity="center" />
-
- <RelativeLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="6dip"
- android:layout_marginTop="6dip"
- android:layout_marginBottom="6dip"
- android:layout_weight="1">
-
- <TextView android:id="@+android:id/title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:textAppearance="?android:attr/textAppearanceMedium" />
-
- <TextView android:id="@+android:id/summary"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@android:id/title"
- android:layout_alignLeft="@android:id/title"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:maxLines="2" />
-
- </RelativeLayout>
-
- <ImageView
+<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/syncStatusIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="5dip"
- android:layout_marginRight="7dip"
android:layout_gravity="center" />
-
-</LinearLayout>
diff --git a/res/layout/preference_bluetooth.xml b/res/layout/preference_bluetooth.xml
index 531bdc3..ff1162e 100644
--- a/res/layout/preference_bluetooth.xml
+++ b/res/layout/preference_bluetooth.xml
@@ -17,49 +17,14 @@
<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:gravity="center_vertical"
- android:paddingLeft="16dip"
- android:paddingRight="?android:attr/scrollbarSize">
+ android:gravity="center_vertical">
- <ImageView
- android:id="@+id/btClass"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="12dip"
- android:layout_gravity="center_vertical" />
-
- <RelativeLayout
+ <LinearLayout android:id="@+id/profileIcons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginRight="6dip"
- android:layout_marginTop="6dip"
- android:layout_marginBottom="6dip"
- android:layout_weight="1">
-
- <!-- Device name -->
- <TextView android:id="@+android:id/title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:textAppearance="?android:attr/textAppearanceLarge" />
-
- <!-- Status summary -->
- <TextView android:id="@+android:id/summary"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@android:id/title"
- android:layout_alignLeft="@android:id/title"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:maxLines="2" />
-
- <LinearLayout android:id="@+id/profileIcons"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_centerVertical="true"
- android:layout_alignParentRight="true"
- />
- </RelativeLayout>
+ android:layout_centerVertical="true"
+ android:layout_alignParentRight="true"
+ />
<!-- Divider -->
<ImageView
diff --git a/res/layout/preference_bluetooth_profile.xml b/res/layout/preference_bluetooth_profile.xml
index 5ec0a47..03f598a 100644
--- a/res/layout/preference_bluetooth_profile.xml
+++ b/res/layout/preference_bluetooth_profile.xml
@@ -15,51 +15,9 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:minHeight="?android:attr/listPreferredItemHeight"
- android:gravity="center_vertical"
- android:paddingLeft="16dip"
- android:paddingRight="?android:attr/scrollbarSize">
-
- <ImageView
- android:id="@+id/profileIcon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="12dip"
- android:layout_gravity="center_vertical" />
-
- <RelativeLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="6dip"
- android:layout_marginTop="6dip"
- android:layout_marginBottom="6dip"
- android:layout_weight="1">
-
- <!-- Device name -->
- <TextView android:id="@+android:id/title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:textAppearance="?android:attr/textAppearanceLarge" />
-
- <!-- Status summary -->
- <TextView android:id="@+android:id/summary"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@android:id/title"
- android:layout_alignLeft="@android:id/title"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:maxLines="2" />
-
- <LinearLayout android:id="@+id/profileIcons"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_centerVertical="true"
- android:layout_alignParentRight="true"
- />
- </RelativeLayout>
+ android:gravity="center_vertical">
<!-- Divider -->
<ImageView
diff --git a/src/com/android/settings/AccountPreference.java b/src/com/android/settings/AccountPreference.java
index a860d1a..dc56334 100644
--- a/src/com/android/settings/AccountPreference.java
+++ b/src/com/android/settings/AccountPreference.java
@@ -49,7 +49,7 @@ public class AccountPreference extends Preference {
mAccount = account;
mAuthorities = authorities;
mProviderIcon = icon;
- setLayoutResource(R.layout.account_preference);
+ setWidgetLayoutResource(R.layout.account_preference);
setTitle(mAccount.name);
setSummary("");
// Add account info to the intent for AccountSyncSettings
@@ -72,7 +72,7 @@ public class AccountPreference extends Preference {
protected void onBindView(View view) {
super.onBindView(view);
setSummary(getSyncStatusMessage(mStatus));
- mProviderIconView = (ImageView) view.findViewById(R.id.providerIcon);
+ mProviderIconView = (ImageView) view.findViewById(android.R.id.icon);
mProviderIconView.setImageDrawable(mProviderIcon);
mSyncStatusIcon = (ImageView) view.findViewById(R.id.syncStatusIcon);
mSyncStatusIcon.setImageResource(getSyncStatusIcon(mStatus));
diff --git a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java
index 1f9408d..b54df08 100644
--- a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java
+++ b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java
@@ -64,7 +64,7 @@ public class BluetoothDevicePreference extends Preference implements
mCachedDevice = cachedDevice;
mAccessibleProfile = accessibleProfile;
- setLayoutResource(R.layout.preference_bluetooth);
+ setWidgetLayoutResource(R.layout.preference_bluetooth);
cachedDevice.registerCallback(this);
@@ -127,7 +127,7 @@ public class BluetoothDevicePreference extends Preference implements
super.onBindView(view);
- ImageView btClass = (ImageView) view.findViewById(R.id.btClass);
+ ImageView btClass = (ImageView) view.findViewById(android.R.id.icon);
btClass.setImageResource(mCachedDevice.getBtClassDrawable());
btClass.setAlpha(isEnabled() ? 255 : sDimAlpha);
diff --git a/src/com/android/settings/bluetooth/BluetoothProfilePreference.java b/src/com/android/settings/bluetooth/BluetoothProfilePreference.java
index c0df8a7..bd28995 100644
--- a/src/com/android/settings/bluetooth/BluetoothProfilePreference.java
+++ b/src/com/android/settings/bluetooth/BluetoothProfilePreference.java
@@ -48,7 +48,7 @@ public class BluetoothProfilePreference extends Preference implements OnClickLis
mProfile = profile;
- setLayoutResource(R.layout.preference_bluetooth_profile);
+ setWidgetLayoutResource(R.layout.preference_bluetooth_profile);
setExpanded(false);
}
@@ -73,7 +73,7 @@ public class BluetoothProfilePreference extends Preference implements OnClickLis
protected void onBindView(View view) {
super.onBindView(view);
- ImageView btProfile = (ImageView) view.findViewById(R.id.profileIcon);
+ ImageView btProfile = (ImageView) view.findViewById(android.R.id.icon);
btProfile.setImageDrawable(mProfileDrawable);
mProfileExpandView = (ImageView) view.findViewById(R.id.profileExpand);
diff --git a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
index d6f192a..780d261 100644
--- a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
+++ b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
@@ -295,6 +295,7 @@ public class DeviceProfilesSettings extends SettingsPreferenceFragment
CheckBoxPreference autoConnectPref = mAutoConnectPrefs.get(prof.toString());
if (autoConnectPref == null) {
autoConnectPref = new CheckBoxPreference(getActivity());
+ autoConnectPref.setLayoutResource(com.android.internal.R.layout.preference_child);
autoConnectPref.setKey(prof.toString() + AUTO_CONNECT_KEY_SUFFIX);
autoConnectPref.setTitle(getCheckBoxTitle(prof));
autoConnectPref.setOrder(getProfilePreferenceIndex(prof) + 1);
diff --git a/src/com/android/settings/fuelgauge/PowerGaugePreference.java b/src/com/android/settings/fuelgauge/PowerGaugePreference.java
index ad8c25b..00e397e 100644
--- a/src/com/android/settings/fuelgauge/PowerGaugePreference.java
+++ b/src/com/android/settings/fuelgauge/PowerGaugePreference.java
@@ -64,7 +64,7 @@ public class PowerGaugePreference extends Preference {
return mInfo;
}
- void setIcon(Drawable icon) {
+ void setPowerIcon(Drawable icon) {
mIcon = icon;
notifyChanged();
}
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index aae60eb..d1b5aef 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -734,7 +734,7 @@ public class PowerUsageSummary extends PreferenceFragment implements Runnable {
(PowerGaugePreference) findPreference(
Integer.toString(bs.uidObj.getUid()));
if (pgp != null) {
- pgp.setIcon(bs.icon);
+ pgp.setPowerIcon(bs.icon);
pgp.setPercent(bs.percent);
pgp.setTitle(bs.name);
}