More refresh account and folder list
BUG: 2149171 * Change the string of combined inbox * Change the string of combined starred folder * Change the icon for combined inbox * Change the icon for combined starred folder
This commit is contained in:
parent
e4a7cc440f
commit
3786cab2aa
@ -207,11 +207,11 @@
|
|||||||
<!-- The text in the small separator between smart folders and the accounts -->
|
<!-- The text in the small separator between smart folders and the accounts -->
|
||||||
<string name="account_folder_list_separator_accounts">Accounts</string>
|
<string name="account_folder_list_separator_accounts">Accounts</string>
|
||||||
<!-- The summary section entry in the AccountFolder list to display all inboxes -->
|
<!-- The summary section entry in the AccountFolder list to display all inboxes -->
|
||||||
<string name="account_folder_list_summary_inbox">Inbox</string>
|
<string name="account_folder_list_summary_inbox">Combined Inbox</string>
|
||||||
<!-- The summary section entry in the AccountFolder list to display all unread -->
|
<!-- The summary section entry in the AccountFolder list to display all unread -->
|
||||||
<string name="account_folder_list_summary_unread">Unread</string>
|
<string name="account_folder_list_summary_unread">Unread</string>
|
||||||
<!-- The summary section entry in the AccountFolder list to display all favorites -->
|
<!-- The summary section entry in the AccountFolder list to display all starred -->
|
||||||
<string name="account_folder_list_summary_favorite">Favorite</string>
|
<string name="account_folder_list_summary_starred">Starred</string>
|
||||||
<!-- The summary section entry in the AccountFolder list to display all drafts -->
|
<!-- The summary section entry in the AccountFolder list to display all drafts -->
|
||||||
<string name="account_folder_list_summary_drafts">Drafts</string>
|
<string name="account_folder_list_summary_drafts">Drafts</string>
|
||||||
<!-- The summary section entry in the AccountFolder list to display all outboxes -->
|
<!-- The summary section entry in the AccountFolder list to display all outboxes -->
|
||||||
|
@ -291,6 +291,8 @@ public class Utility {
|
|||||||
private String[] mSpecialMailbox = new String[] {};
|
private String[] mSpecialMailbox = new String[] {};
|
||||||
private TypedArray mSpecialMailboxDrawable;
|
private TypedArray mSpecialMailboxDrawable;
|
||||||
private Drawable mDefaultMailboxDrawable;
|
private Drawable mDefaultMailboxDrawable;
|
||||||
|
private Drawable mSummaryStarredMailboxDrawable;
|
||||||
|
private Drawable mSummaryCombinedInboxDrawable;
|
||||||
|
|
||||||
private FolderProperties(Context context) {
|
private FolderProperties(Context context) {
|
||||||
mSpecialMailbox = context.getResources().getStringArray(R.array.mailbox_display_names);
|
mSpecialMailbox = context.getResources().getStringArray(R.array.mailbox_display_names);
|
||||||
@ -304,6 +306,10 @@ public class Utility {
|
|||||||
context.getResources().obtainTypedArray(R.array.mailbox_display_icons);
|
context.getResources().obtainTypedArray(R.array.mailbox_display_icons);
|
||||||
mDefaultMailboxDrawable =
|
mDefaultMailboxDrawable =
|
||||||
context.getResources().getDrawable(R.drawable.ic_list_folder);
|
context.getResources().getDrawable(R.drawable.ic_list_folder);
|
||||||
|
mSummaryStarredMailboxDrawable =
|
||||||
|
context.getResources().getDrawable(R.drawable.ic_list_starred);
|
||||||
|
mSummaryCombinedInboxDrawable =
|
||||||
|
context.getResources().getDrawable(R.drawable.ic_list_combined_inbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FolderProperties getInstance(Context context) {
|
public static FolderProperties getInstance(Context context) {
|
||||||
@ -340,6 +346,19 @@ public class Utility {
|
|||||||
}
|
}
|
||||||
return mDefaultMailboxDrawable;
|
return mDefaultMailboxDrawable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Drawable getSummaryMailboxIconIds(long mailboxKey) {
|
||||||
|
if (mailboxKey == Mailbox.QUERY_ALL_INBOXES) {
|
||||||
|
return mSummaryCombinedInboxDrawable;
|
||||||
|
} else if (mailboxKey == Mailbox.QUERY_ALL_FAVORITES) {
|
||||||
|
return mSummaryStarredMailboxDrawable;
|
||||||
|
} else if (mailboxKey == Mailbox.QUERY_ALL_DRAFTS) {
|
||||||
|
return mSpecialMailboxDrawable.getDrawable(Mailbox.TYPE_DRAFTS);
|
||||||
|
} else if (mailboxKey == Mailbox.QUERY_ALL_OUTBOX) {
|
||||||
|
return mSpecialMailboxDrawable.getDrawable(Mailbox.TYPE_OUTBOX);
|
||||||
|
}
|
||||||
|
return mDefaultMailboxDrawable;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final static String HOSTAUTH_WHERE_CREDENTIALS = HostAuthColumns.ADDRESS + " like ?"
|
private final static String HOSTAUTH_WHERE_CREDENTIALS = HostAuthColumns.ADDRESS + " like ?"
|
||||||
|
@ -301,7 +301,7 @@ public class AccountFolderList extends ListActivity
|
|||||||
row = childCursor.newRow();
|
row = childCursor.newRow();
|
||||||
row.add(Long.valueOf(Mailbox.QUERY_ALL_FAVORITES)); // MAILBOX_COLUMN_ID = 0;
|
row.add(Long.valueOf(Mailbox.QUERY_ALL_FAVORITES)); // MAILBOX_COLUMN_ID = 0;
|
||||||
// MAILBOX_DISPLAY_NAME
|
// MAILBOX_DISPLAY_NAME
|
||||||
row.add(getString(R.string.account_folder_list_summary_favorite));
|
row.add(getString(R.string.account_folder_list_summary_starred));
|
||||||
row.add(null); // MAILBOX_ACCOUNT_KEY = 2;
|
row.add(null); // MAILBOX_ACCOUNT_KEY = 2;
|
||||||
row.add(Integer.valueOf(Mailbox.TYPE_MAIL)); // MAILBOX_TYPE = 3;
|
row.add(Integer.valueOf(Mailbox.TYPE_MAIL)); // MAILBOX_TYPE = 3;
|
||||||
row.add(Integer.valueOf(count)); // MAILBOX_UNREAD_COUNT = 4;
|
row.add(Integer.valueOf(count)); // MAILBOX_UNREAD_COUNT = 4;
|
||||||
@ -716,11 +716,7 @@ public class AccountFolderList extends ListActivity
|
|||||||
// Invisible (not "gone") to maintain spacing
|
// Invisible (not "gone") to maintain spacing
|
||||||
view.findViewById(R.id.chip).setVisibility(View.INVISIBLE);
|
view.findViewById(R.id.chip).setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
int type = cursor.getInt(MAILBOX_TYPE);
|
String text = cursor.getString(MAILBOX_DISPLAY_NAME);
|
||||||
String text = Utility.FolderProperties.getInstance(context).getDisplayName(type);
|
|
||||||
if (text == null) {
|
|
||||||
text = cursor.getString(MAILBOX_DISPLAY_NAME);
|
|
||||||
}
|
|
||||||
if (text != null) {
|
if (text != null) {
|
||||||
TextView nameView = (TextView) view.findViewById(R.id.name);
|
TextView nameView = (TextView) view.findViewById(R.id.name);
|
||||||
nameView.setText(text);
|
nameView.setText(text);
|
||||||
@ -765,7 +761,7 @@ public class AccountFolderList extends ListActivity
|
|||||||
view.findViewById(R.id.default_sender).setVisibility(View.GONE);
|
view.findViewById(R.id.default_sender).setVisibility(View.GONE);
|
||||||
view.findViewById(R.id.folder_icon).setVisibility(View.VISIBLE);
|
view.findViewById(R.id.folder_icon).setVisibility(View.VISIBLE);
|
||||||
((ImageView)view.findViewById(R.id.folder_icon)).setImageDrawable(
|
((ImageView)view.findViewById(R.id.folder_icon)).setImageDrawable(
|
||||||
Utility.FolderProperties.getInstance(context).getIconIds(type));
|
Utility.FolderProperties.getInstance(context).getSummaryMailboxIconIds(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindAccountItem(View view, Context context, Cursor cursor, boolean isExpanded)
|
private void bindAccountItem(View view, Context context, Cursor cursor, boolean isExpanded)
|
||||||
|
@ -1054,7 +1054,7 @@ public class MessageList extends ListActivity implements OnItemClickListener, On
|
|||||||
getString(R.string.account_folder_list_summary_inbox)};
|
getString(R.string.account_folder_list_summary_inbox)};
|
||||||
} else if (mMailboxKey == Mailbox.QUERY_ALL_FAVORITES) {
|
} else if (mMailboxKey == Mailbox.QUERY_ALL_FAVORITES) {
|
||||||
return new String[] {null,
|
return new String[] {null,
|
||||||
getString(R.string.account_folder_list_summary_favorite)};
|
getString(R.string.account_folder_list_summary_starred)};
|
||||||
} else if (mMailboxKey == Mailbox.QUERY_ALL_DRAFTS) {
|
} else if (mMailboxKey == Mailbox.QUERY_ALL_DRAFTS) {
|
||||||
return new String[] {null,
|
return new String[] {null,
|
||||||
getString(R.string.account_folder_list_summary_drafts)};
|
getString(R.string.account_folder_list_summary_drafts)};
|
||||||
|
Loading…
Reference in New Issue
Block a user