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:
satok 2009-09-29 15:57:01 +09:00
parent e4a7cc440f
commit 3786cab2aa
4 changed files with 26 additions and 11 deletions

View File

@ -207,11 +207,11 @@
<!-- The text in the small separator between smart folders and the accounts -->
<string name="account_folder_list_separator_accounts">Accounts</string>
<!-- 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 -->
<string name="account_folder_list_summary_unread">Unread</string>
<!-- The summary section entry in the AccountFolder list to display all favorites -->
<string name="account_folder_list_summary_favorite">Favorite</string>
<!-- The summary section entry in the AccountFolder list to display all starred -->
<string name="account_folder_list_summary_starred">Starred</string>
<!-- The summary section entry in the AccountFolder list to display all drafts -->
<string name="account_folder_list_summary_drafts">Drafts</string>
<!-- The summary section entry in the AccountFolder list to display all outboxes -->

View File

@ -291,6 +291,8 @@ public class Utility {
private String[] mSpecialMailbox = new String[] {};
private TypedArray mSpecialMailboxDrawable;
private Drawable mDefaultMailboxDrawable;
private Drawable mSummaryStarredMailboxDrawable;
private Drawable mSummaryCombinedInboxDrawable;
private FolderProperties(Context context) {
mSpecialMailbox = context.getResources().getStringArray(R.array.mailbox_display_names);
@ -304,6 +306,10 @@ public class Utility {
context.getResources().obtainTypedArray(R.array.mailbox_display_icons);
mDefaultMailboxDrawable =
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) {
@ -340,6 +346,19 @@ public class Utility {
}
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 ?"

View File

@ -301,7 +301,7 @@ public class AccountFolderList extends ListActivity
row = childCursor.newRow();
row.add(Long.valueOf(Mailbox.QUERY_ALL_FAVORITES)); // MAILBOX_COLUMN_ID = 0;
// 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(Integer.valueOf(Mailbox.TYPE_MAIL)); // MAILBOX_TYPE = 3;
row.add(Integer.valueOf(count)); // MAILBOX_UNREAD_COUNT = 4;
@ -716,11 +716,7 @@ public class AccountFolderList extends ListActivity
// Invisible (not "gone") to maintain spacing
view.findViewById(R.id.chip).setVisibility(View.INVISIBLE);
int type = cursor.getInt(MAILBOX_TYPE);
String text = Utility.FolderProperties.getInstance(context).getDisplayName(type);
if (text == null) {
text = cursor.getString(MAILBOX_DISPLAY_NAME);
}
String text = cursor.getString(MAILBOX_DISPLAY_NAME);
if (text != null) {
TextView nameView = (TextView) view.findViewById(R.id.name);
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.folder_icon).setVisibility(View.VISIBLE);
((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)

View File

@ -1054,7 +1054,7 @@ public class MessageList extends ListActivity implements OnItemClickListener, On
getString(R.string.account_folder_list_summary_inbox)};
} else if (mMailboxKey == Mailbox.QUERY_ALL_FAVORITES) {
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) {
return new String[] {null,
getString(R.string.account_folder_list_summary_drafts)};