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

Improved batch button behavior for touch view

This commit is contained in:
Jesse Vincent 2010-01-14 01:07:13 +00:00
parent 25b9f41491
commit 34379dc9be
2 changed files with 31 additions and 28 deletions

View File

@ -45,14 +45,17 @@
<item
android:id="@+id/batch_flag_mode"
android:title="@string/batch_flag_mode"
android:visible="false"
/>
<item
android:id="@+id/batch_select_mode"
android:title="@string/batch_select_mode"
android:visible="false"
/>
<item
android:id="@+id/batch_plain_mode"
android:title="@string/batch_plain_mode"
android:visible="false"
/>
<item
android:id="@+id/batch_delete_op"

View File

@ -1326,19 +1326,17 @@ public class MessageList
menu.findItem(R.id.list_folders).setVisible(false);
menu.findItem(R.id.expunge).setVisible(false);
}
switch (mSelectedWidget)
{
case WIDGET_FLAG:
{
setOpsState(menu, false, false);
setOpsMode(menu, R.id.batch_flag_mode);
break;
}
case WIDGET_MULTISELECT:
if (mTouchView == true || mSelectedWidget == WIDGET_MULTISELECT)
{
boolean anySelected = anySelected();
setOpsState(menu, true, anySelected);
if (mTouchView == false)
{
setOpsMode(menu, R.id.batch_select_mode);
}
boolean newFlagState = computeBatchDirection(true);
boolean newReadState = computeBatchDirection(false);
menu.findItem(R.id.batch_flag_op).setVisible(newFlagState);
@ -1350,14 +1348,16 @@ public class MessageList
// TODO: batch move and copy not yet implemented
menu.findItem(R.id.batch_move_op).setVisible(false);
menu.findItem(R.id.batch_copy_op).setVisible(false);
break;
}
case WIDGET_NONE:
else if (mSelectedWidget == WIDGET_FLAG)
{
setOpsState(menu, false, false);
setOpsMode(menu, R.id.batch_flag_mode);
}
else if (mSelectedWidget == WIDGET_NONE)
{
setOpsState(menu, false, false);
setOpsMode(menu, R.id.batch_plain_mode);
break;
}
}
if (mCurrentFolder != null && mCurrentFolder.outbox)