mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-25 23:21:50 -05:00
Add a "done" to the batch buttons.
Make the "done" entry in batch buttons only show up in touch mode
This commit is contained in:
parent
b1c9d8918f
commit
d5c185545b
@ -37,6 +37,13 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="@string/message_list_flag_action"
|
android:text="@string/message_list_flag_action"
|
||||||
/>
|
/>
|
||||||
|
<Button
|
||||||
|
android:id="@+id/batch_done_button"
|
||||||
|
android:layout_width="0dip"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@string/done_action"
|
||||||
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/message_list"
|
android:id="@+id/message_list"
|
||||||
|
@ -120,6 +120,7 @@ public class MessageList
|
|||||||
private Button mBatchReadButton;
|
private Button mBatchReadButton;
|
||||||
private Button mBatchDeleteButton;
|
private Button mBatchDeleteButton;
|
||||||
private Button mBatchFlagButton;
|
private Button mBatchFlagButton;
|
||||||
|
private Button mBatchDoneButton;
|
||||||
|
|
||||||
class MessageListHandler extends Handler
|
class MessageListHandler extends Handler
|
||||||
{
|
{
|
||||||
@ -358,6 +359,16 @@ public class MessageList
|
|||||||
mBatchDeleteButton.setOnClickListener(this);
|
mBatchDeleteButton.setOnClickListener(this);
|
||||||
mBatchFlagButton = (Button) findViewById(R.id.batch_flag_button);
|
mBatchFlagButton = (Button) findViewById(R.id.batch_flag_button);
|
||||||
mBatchFlagButton.setOnClickListener(this);
|
mBatchFlagButton.setOnClickListener(this);
|
||||||
|
mBatchDoneButton = (Button) findViewById(R.id.batch_done_button);
|
||||||
|
|
||||||
|
if (mTouchView == true)
|
||||||
|
{
|
||||||
|
mBatchDoneButton.setOnClickListener(this);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mBatchDoneButton.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
mAccount = (Account)intent.getSerializableExtra(EXTRA_ACCOUNT);
|
mAccount = (Account)intent.getSerializableExtra(EXTRA_ACCOUNT);
|
||||||
@ -2537,6 +2548,12 @@ str.setSpan(new TextAppearanceSpan(null ,Typeface.BOLD ,-1, holder.subject.getTe
|
|||||||
List<Message> messageList = new ArrayList<Message>();
|
List<Message> messageList = new ArrayList<Message>();
|
||||||
List<MessageInfoHolder> removeHolderList = new ArrayList<MessageInfoHolder>();
|
List<MessageInfoHolder> removeHolderList = new ArrayList<MessageInfoHolder>();
|
||||||
|
|
||||||
|
if (v == mBatchDoneButton)
|
||||||
|
{
|
||||||
|
setAllSelected(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (v == mBatchFlagButton)
|
if (v == mBatchFlagButton)
|
||||||
{
|
{
|
||||||
newState = computeBatchDirection(true);
|
newState = computeBatchDirection(true);
|
||||||
@ -2547,6 +2564,7 @@ str.setSpan(new TextAppearanceSpan(null ,Typeface.BOLD ,-1, holder.subject.getTe
|
|||||||
}
|
}
|
||||||
for (MessageInfoHolder holder : mAdapter.messages)
|
for (MessageInfoHolder holder : mAdapter.messages)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (holder.selected)
|
if (holder.selected)
|
||||||
{
|
{
|
||||||
if (v == mBatchDeleteButton)
|
if (v == mBatchDeleteButton)
|
||||||
@ -2597,7 +2615,7 @@ str.setSpan(new TextAppearanceSpan(null ,Typeface.BOLD ,-1, holder.subject.getTe
|
|||||||
mSelectedCount += (isSelected ? 1 : 0);
|
mSelectedCount += (isSelected ? 1 : 0);
|
||||||
}
|
}
|
||||||
mAdapter.notifyDataSetChanged();
|
mAdapter.notifyDataSetChanged();
|
||||||
showBatchButtons();
|
toggleBatchButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void flagSelected(Flag flag, boolean newState)
|
private void flagSelected(Flag flag, boolean newState)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user