Loading res/layout/preference_icon.xml +8 −9 Original line number Diff line number Diff line Loading @@ -29,24 +29,23 @@ android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="6dip" android:layout_marginRight="6dip" android:layout_margin="4dip" android:maxWidth="36dip" android:maxHeight="36dip" android:adjustViewBounds="true" android:layout_gravity="center" /> <RelativeLayout android:layout_width="wrap_content" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_marginLeft="2dip" android:layout_marginRight="6dip" android:layout_marginTop="6dip" android:layout_marginBottom="6dip" android:layout_margin="4dip" 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/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceMedium" android:ellipsize="marquee" android:fadingEdge="horizontal" /> Loading src/com/android/settings/profiles/AppGroupConfig.java +5 −8 Original line number Diff line number Diff line Loading @@ -86,6 +86,8 @@ public class AppGroupConfig extends SettingsPreferenceFragment private static final int MENU_ADD = Menu.FIRST + 1; PackageAdaptor mAppAdapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Loading @@ -95,11 +97,11 @@ public class AppGroupConfig extends SettingsPreferenceFragment final Bundle args = getArguments(); if (args != null) { Log.d(TAG, "AppGroupConfig has valid arguments passed"); mNotificationGroup = (NotificationGroup) args.getParcelable("NotificationGroup"); mPackageManager = getPackageManager(); mInstalledPackages = mPackageManager.getInstalledPackages(0); mAppAdapter = new PackageAdaptor(mInstalledPackages); mAppAdapter.update(); updatePackages(); Loading Loading @@ -253,9 +255,7 @@ public class AppGroupConfig extends SettingsPreferenceFragment switch (id) { case DIALOG_APPS: final ListView list = new ListView(getActivity()); PackageAdaptor adapter = new PackageAdaptor(mInstalledPackages); list.setAdapter(adapter); adapter.update(); list.setAdapter(mAppAdapter); builder.setTitle(R.string.profile_choose_app); builder.setView(list); dialog = builder.create(); Loading Loading @@ -422,9 +422,6 @@ public class AppGroupConfig extends SettingsPreferenceFragment if (holder.icon != null) { Drawable loadIcon = applicationInfo.icon; holder.icon.setImageDrawable(loadIcon); holder.icon.setAdjustViewBounds(true); holder.icon.setMaxHeight(72); holder.icon.setMaxWidth(72); } return convertView; } Loading src/com/android/settings/profiles/ApplicationItemPreference.java +7 −4 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ public class ApplicationItemPreference extends Preference { public ApplicationItemPreference(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); Log.d(TAG, "ApplicationItemPreference: entered"); setLayoutResource(R.layout.preference_icon); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.IconPreferenceScreen, defStyle, 0); Loading @@ -52,12 +51,16 @@ public class ApplicationItemPreference extends Preference { @Override public void onBindView(View view) { super.onBindView(view); Log.d(TAG, "onBindView: entered"); float valueDips = 36.0f; final float scale = getContext().getResources().getDisplayMetrics().density; int valuePixels = (int) (valueDips * scale + 0.5f); ImageView imageView = (ImageView) view.findViewById(R.id.icon); if (imageView != null && mIcon != null) { imageView.setAdjustViewBounds(true); imageView.setMaxHeight(64); imageView.setMaxWidth(64); imageView.setMaxHeight(valuePixels); imageView.setMaxWidth(valuePixels); imageView.setImageDrawable(mIcon); } } Loading Loading
res/layout/preference_icon.xml +8 −9 Original line number Diff line number Diff line Loading @@ -29,24 +29,23 @@ android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="6dip" android:layout_marginRight="6dip" android:layout_margin="4dip" android:maxWidth="36dip" android:maxHeight="36dip" android:adjustViewBounds="true" android:layout_gravity="center" /> <RelativeLayout android:layout_width="wrap_content" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_marginLeft="2dip" android:layout_marginRight="6dip" android:layout_marginTop="6dip" android:layout_marginBottom="6dip" android:layout_margin="4dip" 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/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceMedium" android:ellipsize="marquee" android:fadingEdge="horizontal" /> Loading
src/com/android/settings/profiles/AppGroupConfig.java +5 −8 Original line number Diff line number Diff line Loading @@ -86,6 +86,8 @@ public class AppGroupConfig extends SettingsPreferenceFragment private static final int MENU_ADD = Menu.FIRST + 1; PackageAdaptor mAppAdapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Loading @@ -95,11 +97,11 @@ public class AppGroupConfig extends SettingsPreferenceFragment final Bundle args = getArguments(); if (args != null) { Log.d(TAG, "AppGroupConfig has valid arguments passed"); mNotificationGroup = (NotificationGroup) args.getParcelable("NotificationGroup"); mPackageManager = getPackageManager(); mInstalledPackages = mPackageManager.getInstalledPackages(0); mAppAdapter = new PackageAdaptor(mInstalledPackages); mAppAdapter.update(); updatePackages(); Loading Loading @@ -253,9 +255,7 @@ public class AppGroupConfig extends SettingsPreferenceFragment switch (id) { case DIALOG_APPS: final ListView list = new ListView(getActivity()); PackageAdaptor adapter = new PackageAdaptor(mInstalledPackages); list.setAdapter(adapter); adapter.update(); list.setAdapter(mAppAdapter); builder.setTitle(R.string.profile_choose_app); builder.setView(list); dialog = builder.create(); Loading Loading @@ -422,9 +422,6 @@ public class AppGroupConfig extends SettingsPreferenceFragment if (holder.icon != null) { Drawable loadIcon = applicationInfo.icon; holder.icon.setImageDrawable(loadIcon); holder.icon.setAdjustViewBounds(true); holder.icon.setMaxHeight(72); holder.icon.setMaxWidth(72); } return convertView; } Loading
src/com/android/settings/profiles/ApplicationItemPreference.java +7 −4 Original line number Diff line number Diff line Loading @@ -38,7 +38,6 @@ public class ApplicationItemPreference extends Preference { public ApplicationItemPreference(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); Log.d(TAG, "ApplicationItemPreference: entered"); setLayoutResource(R.layout.preference_icon); TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.IconPreferenceScreen, defStyle, 0); Loading @@ -52,12 +51,16 @@ public class ApplicationItemPreference extends Preference { @Override public void onBindView(View view) { super.onBindView(view); Log.d(TAG, "onBindView: entered"); float valueDips = 36.0f; final float scale = getContext().getResources().getDisplayMetrics().density; int valuePixels = (int) (valueDips * scale + 0.5f); ImageView imageView = (ImageView) view.findViewById(R.id.icon); if (imageView != null && mIcon != null) { imageView.setAdjustViewBounds(true); imageView.setMaxHeight(64); imageView.setMaxWidth(64); imageView.setMaxHeight(valuePixels); imageView.setMaxWidth(valuePixels); imageView.setImageDrawable(mIcon); } } Loading