diff options
| author | Jorge Ruesga <jorge@ruesga.com> | 2012-11-24 20:59:25 +0100 |
|---|---|---|
| committer | Jorge Ruesga <jorge@ruesga.com> | 2012-11-24 20:59:25 +0100 |
| commit | 9f41124f09b4f0df5f040d74d5092b5c1d81f172 (patch) | |
| tree | 0cb18764cf8115def1ab198dcb87f888554e1e35 | |
| parent | e39313f63a41922babe8acefe7b691c20d9fccda (diff) | |
| download | android_packages_apps_CMFileManager-9f41124f09b4f0df5f040d74d5092b5c1d81f172.tar.gz android_packages_apps_CMFileManager-9f41124f09b4f0df5f040d74d5092b5c1d81f172.tar.bz2 android_packages_apps_CMFileManager-9f41124f09b4f0df5f040d74d5092b5c1d81f172.zip | |
CMFileManager: Compress type selection dialog has an invalid background
The background dialog for selecting the compression type has an invalid color.
The valid color is the background color of the dialog.
Change-Id: Ib5ecf1c59e5c99ccd6ed8707646b718ca88dbcd9
| -rw-r--r-- | src/com/cyanogenmod/filemanager/adapters/CheckableListAdapter.java | 20 | ||||
| -rw-r--r-- | src/com/cyanogenmod/filemanager/util/DialogHelper.java | 2 |
2 files changed, 20 insertions, 2 deletions
diff --git a/src/com/cyanogenmod/filemanager/adapters/CheckableListAdapter.java b/src/com/cyanogenmod/filemanager/adapters/CheckableListAdapter.java index e9960ac4..befac79b 100644 --- a/src/com/cyanogenmod/filemanager/adapters/CheckableListAdapter.java +++ b/src/com/cyanogenmod/filemanager/adapters/CheckableListAdapter.java @@ -72,6 +72,8 @@ public class CheckableListAdapter extends ArrayAdapter<CheckableListAdapter.Chec TextView mTvTitle; } + private final boolean mIsDialog; + //The resource of the item check private static final int RESOURCE_ITEM_CHECK = R.id.option_list_item_check; //The resource of the item name @@ -85,7 +87,21 @@ public class CheckableListAdapter extends ArrayAdapter<CheckableListAdapter.Chec */ public CheckableListAdapter( Context context, List<CheckableListAdapter.CheckableItem> items) { + this(context, items, false); + } + + /** + * Constructor of <code>CheckableListAdapter</code>. + * + * @param context The current context + * @param items An array of items to add to the current list + * @param isDialog Indicates if the owner is a dialog (not a popup). In this case, + * use the background of the dialog. + */ + public CheckableListAdapter( + Context context, List<CheckableListAdapter.CheckableItem> items, boolean isDialog) { super(context, RESOURCE_ITEM_NAME, items); + this.mIsDialog = isDialog; } /** @@ -127,7 +143,9 @@ public class CheckableListAdapter extends ArrayAdapter<CheckableListAdapter.Chec Theme theme = ThemeManager.getCurrentTheme(getContext()); theme.setBackgroundDrawable( getContext(), v, - "menu_checkable_selector_drawable"); //$NON-NLS-1$ + (this.mIsDialog) ? + "selectors_deselected_drawable" : //$NON-NLS-1$ + "menu_checkable_selector_drawable"); //$NON-NLS-1$ theme.setTextColor( getContext(), viewHolder.mTvTitle, "text_color"); //$NON-NLS-1$ theme.setImageDrawable( diff --git a/src/com/cyanogenmod/filemanager/util/DialogHelper.java b/src/com/cyanogenmod/filemanager/util/DialogHelper.java index 4e9ca529..69960f8e 100644 --- a/src/com/cyanogenmod/filemanager/util/DialogHelper.java +++ b/src/com/cyanogenmod/filemanager/util/DialogHelper.java @@ -190,7 +190,7 @@ public final class DialogHelper { boolean checked = (i == defOption); items.add(new CheckableListAdapter.CheckableItem(options[i], true, checked)); } - final CheckableListAdapter adapter = new CheckableListAdapter(context, items); + final CheckableListAdapter adapter = new CheckableListAdapter(context, items, true); // Create the list view and set as view final ListView listView = new ListView(context); |
