1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00

Fix focus of flag/read toggles in bulk-update mode

This commit is contained in:
Jesse Vincent 2009-11-30 23:23:27 +00:00
parent 0ebebace82
commit c796897f36

View File

@ -196,7 +196,7 @@ public class MessageList
case MSG_REMOVE_MESSAGE:
{
List<MessageInfoHolder> messages = (List<MessageInfoHolder>)((Object[]) msg.obj)[0];
for (MessageInfoHolder message : messages)
{
if (message != null && message.selected && mSelectedCount > 0)
@ -506,7 +506,7 @@ public class MessageList
{
super.onResume();
mDateFormat = DateFormatter.getDateFormat(this);
mDateFormat = DateFormatter.getDateFormat(this);
mTimeFormat = android.text.format.DateFormat.getTimeFormat(this); // 12/24 date format
sortType = MessagingController.getInstance(getApplication()).getSortType();
@ -550,13 +550,28 @@ public class MessageList
case KeyEvent.KEYCODE_DPAD_LEFT:
{
cycleVisibleWidgets(true);
return true;
if (mBatchButtonArea.hasFocus())
{
return false;
}
else
{
cycleVisibleWidgets(true);
return true;
}
}
case KeyEvent.KEYCODE_DPAD_RIGHT:
{
cycleVisibleWidgets(false);
return true;
if (mBatchButtonArea.hasFocus())
{
return false;
}
else
{
cycleVisibleWidgets(false);
return true;
}
}
@ -2153,7 +2168,7 @@ public class MessageList
//TODO: Fade in animation
mBatchButtonArea.setVisibility(View.VISIBLE);
}
private void configureBatchButtons()
{
if (mSelectedCount < 0)
@ -2176,7 +2191,7 @@ public class MessageList
public TextView main;
}
public class FolderInfoHolder
public class FolderInfoHolder
{
public String name;
@ -2234,7 +2249,7 @@ public class MessageList
@Override
public void onClick(View v)
{
List<Message> messageList = new ArrayList<Message>();
for (MessageInfoHolder holder : mAdapter.messages)
{
@ -2255,8 +2270,8 @@ public class MessageList
messageList.add(holder.message);
}
}
if (!messageList.isEmpty())
{
if (mBatchDeleteButton == v)
@ -2267,8 +2282,8 @@ public class MessageList
}
else
{
MessagingController.getInstance(getApplication()).setFlag(mAccount, mCurrentFolder.name, messageList.toArray(new Message[0]),
(v == mBatchReadButton ? Flag.SEEN : Flag.FLAGGED), true);
MessagingController.getInstance(getApplication()).setFlag(mAccount, mCurrentFolder.name, messageList.toArray(new Message[0]),
(v == mBatchReadButton ? Flag.SEEN : Flag.FLAGGED), true);
}
}
else