diff --git a/res/drawable/btn_check_buttonless_dark_off.png b/res/drawable/btn_check_buttonless_dark_off.png
new file mode 100644
index 000000000..ac9740a88
Binary files /dev/null and b/res/drawable/btn_check_buttonless_dark_off.png differ
diff --git a/res/drawable/btn_check_buttonless_dark_on.png b/res/drawable/btn_check_buttonless_dark_on.png
new file mode 100644
index 000000000..3778aae9b
Binary files /dev/null and b/res/drawable/btn_check_buttonless_dark_on.png differ
diff --git a/res/drawable/btn_check_small_off.png b/res/drawable/btn_check_small_off.png
new file mode 100755
index 000000000..92dd13670
Binary files /dev/null and b/res/drawable/btn_check_small_off.png differ
diff --git a/res/drawable/btn_check_small_on.png b/res/drawable/btn_check_small_on.png
new file mode 100755
index 000000000..5723cf5cc
Binary files /dev/null and b/res/drawable/btn_check_small_on.png differ
diff --git a/res/drawable/btn_star_big_buttonless_off.png b/res/drawable/btn_star_big_buttonless_off.png
new file mode 100644
index 000000000..556498775
Binary files /dev/null and b/res/drawable/btn_star_big_buttonless_off.png differ
diff --git a/res/drawable/btn_star_big_buttonless_on.png b/res/drawable/btn_star_big_buttonless_on.png
new file mode 100644
index 000000000..e8ea4c44d
Binary files /dev/null and b/res/drawable/btn_star_big_buttonless_on.png differ
diff --git a/res/drawable/checkbox_small.xml b/res/drawable/checkbox_small.xml
new file mode 100644
index 000000000..77e9bcb96
--- /dev/null
+++ b/res/drawable/checkbox_small.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
diff --git a/res/drawable/star.xml b/res/drawable/star.xml
new file mode 100644
index 000000000..919c114a9
--- /dev/null
+++ b/res/drawable/star.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
diff --git a/res/layout-land/message_list_item.xml b/res/layout-land/message_list_item.xml
index 01f895186..7469b8935 100644
--- a/res/layout-land/message_list_item.xml
+++ b/res/layout-land/message_list_item.xml
@@ -4,28 +4,38 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingRight="1dip"
- android:paddingTop="2dip"
android:background="#cccccc"
>
-
-
+
-
-
+ >
+
+
+ android:layout_toLeftOf="@+id/flagged"/>
diff --git a/res/layout-land/message_list_widgets.xml b/res/layout-land/message_list_widgets.xml
index d06ff2b18..28f16a077 100644
--- a/res/layout-land/message_list_widgets.xml
+++ b/res/layout-land/message_list_widgets.xml
@@ -7,23 +7,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
-
-
diff --git a/res/layout/message_list_item.xml b/res/layout/message_list_item.xml
index 4df55f607..9c8c7c5cd 100644
--- a/res/layout/message_list_item.xml
+++ b/res/layout/message_list_item.xml
@@ -7,24 +7,38 @@
android:paddingTop="2dip"
android:background="#cccccc"
>
-
-
-
+ >
+
+
+
diff --git a/res/layout/message_list_widgets.xml b/res/layout/message_list_widgets.xml
index 9172c3346..62db0cd43 100644
--- a/res/layout/message_list_widgets.xml
+++ b/res/layout/message_list_widgets.xml
@@ -16,12 +16,4 @@
/>
-
diff --git a/res/menu/message_list_context.xml b/res/menu/message_list_context.xml
index aba0de499..81e4917dc 100644
--- a/res/menu/message_list_context.xml
+++ b/res/menu/message_list_context.xml
@@ -3,6 +3,15 @@
+
+
-
- OK
Cancel
Send
+ Select
+ Unselect
Reply
Reply all
Delete
diff --git a/src/com/fsck/k9/MessagingController.java b/src/com/fsck/k9/MessagingController.java
index 5c741dde9..3d6e3a882 100644
--- a/src/com/fsck/k9/MessagingController.java
+++ b/src/com/fsck/k9/MessagingController.java
@@ -464,7 +464,7 @@ public class MessagingController implements Runnable
}
}
}
-
+
for (MessagingListener l : getListeners())
{
l.listFoldersFinished(account);
diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java
index 1c3133b3b..10b149ba8 100644
--- a/src/com/fsck/k9/activity/MessageList.java
+++ b/src/com/fsck/k9/activity/MessageList.java
@@ -76,7 +76,6 @@ public class MessageList
private static final int WIDGET_NONE = 1;
private static final int WIDGET_FLAG = 2;
- private static final int WIDGET_MULTISELECT = 3;
private ListView mListView;
@@ -309,7 +308,7 @@ public class MessageList
mController.loadMoreMessages(mAccount, mFolderName, mAdapter.mListener);
return;
}
- else if (mSelectedWidget == WIDGET_MULTISELECT || (mTouchView != false && mSelectedCount > 0))
+ else if (mSelectedCount > 0)
{
// In multiselect mode make sure that clicking on the item results in
// toggling the 'selected' checkbox
@@ -726,11 +725,6 @@ public class MessageList
switch (mSelectedWidget)
{
case WIDGET_FLAG:
- {
- mSelectedWidget = WIDGET_MULTISELECT;
- break;
- }
- case WIDGET_MULTISELECT:
{
mSelectedWidget = WIDGET_NONE;
break;
@@ -753,11 +747,6 @@ public class MessageList
break;
}
case WIDGET_NONE:
- {
- mSelectedWidget=WIDGET_MULTISELECT;
- break;
- }
- case WIDGET_MULTISELECT:
{
mSelectedWidget=WIDGET_FLAG;
break;
@@ -781,9 +770,6 @@ public class MessageList
case WIDGET_NONE:
hideBatchButtons();
break;
- case WIDGET_MULTISELECT:
- toggleBatchButtons();
- break;
}
int count = mListView.getChildCount();
@@ -807,26 +793,14 @@ public class MessageList
if (showWidget == WIDGET_NONE)
{
- v.findViewById(R.id.widgets).setVisibility(View.GONE);
+ flagged.setVisibility(View.GONE);
return;
}
else
- {
- v.findViewById(R.id.widgets).setVisibility(View.VISIBLE);
- }
-
-
-
- if (showWidget == WIDGET_MULTISELECT)
- {
- flagged.setVisibility(View.GONE);
- selected.setVisibility(View.VISIBLE);
- }
- else
{
flagged.setVisibility(View.VISIBLE);
- selected.setVisibility(View.GONE);
}
+
}
private void onAccounts()
@@ -1290,11 +1264,6 @@ public class MessageList
configureWidgets();
return true;
- case R.id.batch_select_mode:
- mSelectedWidget = WIDGET_MULTISELECT;
- configureWidgets();
- return true;
-
case R.id.batch_flag_mode:
mSelectedWidget = WIDGET_FLAG;
configureWidgets();
@@ -1317,7 +1286,7 @@ public class MessageList
R.id.batch_select_all, R.id.batch_deselect_all
};
- private final int[] batch_modes = { R.id.batch_flag_mode, R.id.batch_select_mode, R.id.batch_plain_mode };
+ private final int[] batch_modes = { R.id.batch_flag_mode, R.id.batch_plain_mode };
private void setOpsState(Menu menu, boolean state, boolean enabled)
{
@@ -1349,17 +1318,21 @@ public class MessageList
menu.findItem(R.id.list_folders).setVisible(false);
menu.findItem(R.id.expunge).setVisible(false);
}
- if (mTouchView == true || mSelectedWidget == WIDGET_MULTISELECT)
+ 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);
+ }
+ else
{
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);
@@ -1372,16 +1345,6 @@ public class MessageList
menu.findItem(R.id.batch_move_op).setVisible(false);
menu.findItem(R.id.batch_copy_op).setVisible(false);
}
- 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);
- }
if (mCurrentFolder != null && mCurrentFolder.outbox)
{
@@ -1420,17 +1383,22 @@ public class MessageList
{
case R.id.open:
onOpenMessage(holder);
+ break;
+ case R.id.select:
+ setSelected(holder, true);
+ break;
+
+ case R.id.unselect:
+ setSelected(holder, false);
break;
case R.id.delete:
onDelete(holder, info.position);
-
break;
case R.id.reply:
onReply(holder);
-
break;
case R.id.reply_all:
@@ -1536,13 +1504,6 @@ public class MessageList
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
MessageInfoHolder message = (MessageInfoHolder) mAdapter.getItem(info.position);
- // in multi-select mode, the context menu pops up unintentionally
- // causes misclicks
- if (mSelectedWidget == WIDGET_MULTISELECT)
- {
- return;
- }
-
if (message == null)
{
return;
@@ -1571,6 +1532,17 @@ public class MessageList
{
menu.findItem(R.id.move).setVisible(false);
}
+ if (message.selected)
+ {
+ menu.findItem(R.id.select).setVisible(false);
+ menu.findItem(R.id.unselect).setVisible(true);
+ }
+ else
+ {
+ menu.findItem(R.id.select).setVisible(true);
+ menu.findItem(R.id.unselect).setVisible(false);
+ }
+
}
class MessageListAdapter extends BaseAdapter
@@ -1999,18 +1971,6 @@ public class MessageList
{
view = mInflater.inflate(R.layout.message_list_item, parent, false);
view.setId(R.layout.message_list_item);
- View widgetParent;
- if (mLeftHanded == false)
- {
- widgetParent = view.findViewById(R.id.widgets_right);
- }
- else
- {
- widgetParent = view.findViewById(R.id.widgets_left);
- }
- View widgets = mInflater.inflate(R.layout.message_list_widgets,parent,false);
- widgets.setId(R.id.widgets);
- ((LinearLayout) widgetParent).addView(widgets);
}
}
@@ -2701,6 +2661,20 @@ public class MessageList
toggleBatchButtons();
}
+ private void setSelected(MessageInfoHolder holder, boolean newState)
+ {
+
+ if (holder.selected != newState)
+ {
+ holder.selected = newState;
+ mSelectedCount += (newState ? 1 : -1);
+ }
+ mAdapter.notifyDataSetChanged();
+ toggleBatchButtons();
+
+ }
+
+
private void flagSelected(Flag flag, boolean newState)
{
List messageList = new ArrayList();
diff --git a/src/com/fsck/k9/mail/store/ImapStore.java b/src/com/fsck/k9/mail/store/ImapStore.java
index 07ddab2e9..a7f633e84 100644
--- a/src/com/fsck/k9/mail/store/ImapStore.java
+++ b/src/com/fsck/k9/mail/store/ImapStore.java
@@ -610,7 +610,7 @@ public class ImapStore extends Store
{
return mName;
}
-
+
private boolean exists(String folderName) throws MessagingException
{
try
@@ -741,7 +741,7 @@ public class ImapStore extends Store
try
{
String remoteDestName = encodeFolderName(iFolder.getPrefixedName());
-
+
if (!exists(remoteDestName))
{
/*