1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00

Added a "show no widgets" entry into the widgets rotation.

Eventually, we should have a preference per account for whether listview
starts in no-widgets or flag mode.
This commit is contained in:
Jesse Vincent 2009-11-25 16:21:01 +00:00
parent b50baac5e8
commit e4427f4f17
2 changed files with 31 additions and 9 deletions

View File

@ -25,6 +25,7 @@
android:paddingLeft="10dip"
android:layout_toLeftOf="@id/widgets"
android:layout_toRightOf="@+id/chip"
android:layout_alignWithParentIfMissing="true"
android:layout_marginRight="1dip" />
<TextView
android:id="@+id/date"
@ -39,7 +40,7 @@
android:layout_toLeftOf="@id/widgets"
android:layout_alignParentBottom="true"
android:background="@android:color/transparent"
android:layout_alignWithParentIfMissing="true"
/>
<TextView
android:id="@+id/from"

View File

@ -95,9 +95,10 @@ public class MessageList extends K9ListActivity
private static final String STATE_KEY_SELECTION = "com.android.email.activity.messagelist_selection";
private static final int WIDGET_FLAG = 1;
private static final int WIDGET_DELETE = 2;
private static final int WIDGET_MULTISELECT = 3;
private static final int WIDGET_NONE = 1;
private static final int WIDGET_FLAG = 2;
private static final int WIDGET_DELETE = 3;
private static final int WIDGET_MULTISELECT = 4;
private static final int[] colorChipResIds = new int[]
{
@ -729,6 +730,10 @@ public class MessageList extends K9ListActivity
{
mSelectedWidget=WIDGET_MULTISELECT;
}
else if (mSelectedWidget == WIDGET_MULTISELECT)
{
mSelectedWidget=WIDGET_NONE;
}
else
{
mSelectedWidget=WIDGET_FLAG;
@ -738,17 +743,21 @@ public class MessageList extends K9ListActivity
else
{
if (mSelectedWidget == WIDGET_FLAG)
{
mSelectedWidget=WIDGET_NONE;
}
else if (mSelectedWidget == WIDGET_NONE)
{
mSelectedWidget=WIDGET_MULTISELECT;
}
else if (mSelectedWidget == WIDGET_DELETE)
{
mSelectedWidget=WIDGET_FLAG;
}
else
else if (mSelectedWidget == WIDGET_MULTISELECT)
{
mSelectedWidget=WIDGET_DELETE;
}
else // if (mSelectedWidget == WIDGET_DELETE)
{
mSelectedWidget=WIDGET_FLAG;
}
@ -773,6 +782,18 @@ public class MessageList extends K9ListActivity
return;
}
if (nextWidget == WIDGET_NONE)
{
v.findViewById(R.id.widgets).setVisibility(View.GONE);
return;
}
else
{
v.findViewById(R.id.widgets).setVisibility(View.VISIBLE);
}
if (nextWidget == WIDGET_DELETE)
{