Use the new Preference:icon attribute and placeholder for showing icons on the left.

This commit is contained in:
Amith Yamasani
2010-11-17 15:21:18 -08:00
parent 8ba83bf5ff
commit 43a673053f
11 changed files with 17 additions and 136 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);