Merge change 21479 into eclair

* changes:
  Use custom icons for special mailboxes
This commit is contained in:
Android (Google) Code Review 2009-08-17 03:58:23 -07:00
commit a39992fd7d
11 changed files with 26 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1022 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1004 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 796 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

View File

@ -32,7 +32,7 @@
android:id="@+id/folder_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/expander_ic_folder_minimized"
android:src="@drawable/ic_list_folder"
android:paddingLeft="2dip"/>
<LinearLayout
android:layout_width="0dip"

View File

@ -47,6 +47,7 @@ import android.view.ContextMenu.ContextMenuInfo;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.CursorAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;
@ -409,6 +410,7 @@ public class MailboxList extends ListActivity implements OnItemClickListener, On
MailboxColumns.DISPLAY_NAME, MailboxColumns.UNREAD_COUNT, MailboxColumns.TYPE };
private final int COLUMN_DISPLAY_NAME = 1;
private final int COLUMN_UNREAD_COUNT = 2;
private final int COLUMN_TYPE = 3;
Context mContext;
private LayoutInflater mInflater;
@ -456,7 +458,29 @@ public class MailboxList extends ListActivity implements OnItemClickListener, On
nameView.setTypeface(Typeface.DEFAULT);
countView.setVisibility(View.GONE);
}
ImageView folderIcon = (ImageView) view.findViewById(R.id.folder_icon);
int type = cursor.getInt(COLUMN_TYPE);
int resId = -1;
switch (type) {
case Mailbox.TYPE_INBOX:
resId = R.drawable.ic_list_inbox;
break;
case Mailbox.TYPE_OUTBOX:
resId = R.drawable.ic_list_outbox;
break;
case Mailbox.TYPE_DRAFTS:
resId = R.drawable.ic_list_drafts;
break;
case Mailbox.TYPE_SENT:
resId = R.drawable.ic_list_sent;
break;
case Mailbox.TYPE_TRASH:
resId = R.drawable.ic_list_trash;
default:
resId = R.drawable.ic_list_folder;
break;
}
folderIcon.setImageResource(resId);
}
@Override