Skip to content

Commit

Permalink
CMFileManager: Compress type selection dialog has an invalid background
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jruesga committed Nov 24, 2012
1 parent e39313f commit 9f41124
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public ViewHolder() {
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
Expand All @@ -85,7 +87,21 @@ public ViewHolder() {
*/
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;
}

/**
Expand Down Expand Up @@ -127,7 +143,9 @@ public View getView(int position, View convertView, ViewGroup parent) {
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(
Expand Down
2 changes: 1 addition & 1 deletion src/com/cyanogenmod/filemanager/util/DialogHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public static AlertDialog createSingleChoiceDialog(
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);
Expand Down

0 comments on commit 9f41124

Please sign in to comment.