do not merge: Merged CL 21093 from goog/master to goog/eclair

This commit is contained in:
satok 2009-08-17 15:06:36 +09:00
parent cfa8731e51
commit 73fa3562f2
3 changed files with 20 additions and 3 deletions

View File

@ -22,11 +22,18 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingLeft="8dip" android:paddingLeft="8dip"
android:paddingRight="8dip" > android:paddingRight="8dip" >
<View
android:id="@+id/chip"
android:background="@drawable/appointment_indicator_leftside_1"
android:layout_width="4px"
android:layout_height="56px"
android:layout_centerVertical="true" />
<ImageView <ImageView
android:id="@+id/folder_icon" android:id="@+id/folder_icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/expander_ic_folder_minimized" /> android:src="@drawable/expander_ic_folder_minimized"
android:paddingLeft="2dip"/>
<LinearLayout <LinearLayout
android:layout_width="0dip" android:layout_width="0dip"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -15,6 +15,8 @@
--> -->
<menu xmlns:android="http://schemas.android.com/apk/res/android"> <menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/open"
android:title="@string/open_action" />
<item android:id="@+id/refresh" <item android:id="@+id/refresh"
android:title="@string/refresh_action" /> android:title="@string/refresh_action" />
</menu> </menu>

View File

@ -31,6 +31,7 @@ import android.content.ContentUris;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.database.Cursor; import android.database.Cursor;
import android.graphics.Typeface;
import android.net.Uri; import android.net.Uri;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
@ -258,6 +259,9 @@ public class MailboxList extends ListActivity implements OnItemClickListener, On
case R.id.refresh: case R.id.refresh:
onRefresh(info.id); onRefresh(info.id);
break; break;
case R.id.open:
onOpenMailbox(info.id);
break;
} }
return super.onContextItemSelected(item); return super.onContextItemSelected(item);
} }
@ -419,8 +423,8 @@ public class MailboxList extends ListActivity implements OnItemClickListener, On
public void bindView(View view, Context context, Cursor cursor) { public void bindView(View view, Context context, Cursor cursor) {
// TODO translation by mailbox type // TODO translation by mailbox type
String text = cursor.getString(COLUMN_DISPLAY_NAME); String text = cursor.getString(COLUMN_DISPLAY_NAME);
TextView nameView = (TextView) view.findViewById(R.id.mailbox_name);
if (text != null) { if (text != null) {
TextView nameView = (TextView) view.findViewById(R.id.mailbox_name);
nameView.setText(text); nameView.setText(text);
} }
@ -433,7 +437,9 @@ public class MailboxList extends ListActivity implements OnItemClickListener, On
} else { } else {
statusView.setVisibility(View.GONE); statusView.setVisibility(View.GONE);
} }
View chipView = view.findViewById(R.id.chip);
int chipResId = mColorChipResIds[(int)mAccountId % mColorChipResIds.length];
chipView.setBackgroundResource(chipResId);
// TODO do we use a different count for special mailboxes (total count vs. unread) // TODO do we use a different count for special mailboxes (total count vs. unread)
int count = -1; int count = -1;
text = cursor.getString(COLUMN_UNREAD_COUNT); text = cursor.getString(COLUMN_UNREAD_COUNT);
@ -443,9 +449,11 @@ public class MailboxList extends ListActivity implements OnItemClickListener, On
TextView countView = (TextView) view.findViewById(R.id.new_message_count); TextView countView = (TextView) view.findViewById(R.id.new_message_count);
// If the unread count is zero, not to show countView. // If the unread count is zero, not to show countView.
if (count > 0) { if (count > 0) {
nameView.setTypeface(Typeface.DEFAULT_BOLD);
countView.setVisibility(View.VISIBLE); countView.setVisibility(View.VISIBLE);
countView.setText(text); countView.setText(text);
} else { } else {
nameView.setTypeface(Typeface.DEFAULT);
countView.setVisibility(View.GONE); countView.setVisibility(View.GONE);
} }