mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-12 14:18:02 -05:00
cleaned up enable/disable activate/deactivate of multi-select action widgets.
This commit is contained in:
parent
ab706b6b31
commit
769985dd48
@ -744,10 +744,12 @@ public class MessageList
|
||||
else if (mSelectedWidget == WIDGET_DELETE)
|
||||
{
|
||||
mSelectedWidget=WIDGET_MULTISELECT;
|
||||
showBatchButtons();
|
||||
}
|
||||
else if (mSelectedWidget == WIDGET_MULTISELECT)
|
||||
{
|
||||
mSelectedWidget=WIDGET_NONE;
|
||||
hideBatchButtons();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -764,10 +766,12 @@ public class MessageList
|
||||
else if (mSelectedWidget == WIDGET_NONE)
|
||||
{
|
||||
mSelectedWidget=WIDGET_MULTISELECT;
|
||||
showBatchButtons();
|
||||
}
|
||||
else if (mSelectedWidget == WIDGET_MULTISELECT)
|
||||
{
|
||||
mSelectedWidget=WIDGET_DELETE;
|
||||
hideBatchButtons();
|
||||
}
|
||||
else // if (mSelectedWidget == WIDGET_DELETE)
|
||||
{
|
||||
@ -2173,7 +2177,7 @@ public class MessageList
|
||||
if (mSelectedCount==1)
|
||||
{
|
||||
|
||||
showBatchButtons();
|
||||
enableBatchButtons();
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -2181,7 +2185,7 @@ public class MessageList
|
||||
mSelectedCount--;
|
||||
if (mSelectedCount==0)
|
||||
{
|
||||
hideBatchButtons();
|
||||
disableBatchButtons();
|
||||
}
|
||||
}
|
||||
message.selected = isChecked;
|
||||
@ -2189,6 +2193,21 @@ public class MessageList
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void enableBatchButtons()
|
||||
{
|
||||
mBatchDeleteButton.setEnabled(true);
|
||||
mBatchReadButton.setEnabled(true);
|
||||
mBatchFlagButton.setEnabled(true);
|
||||
}
|
||||
|
||||
private void disableBatchButtons()
|
||||
{
|
||||
mBatchDeleteButton.setEnabled(false);
|
||||
mBatchReadButton.setEnabled(false);
|
||||
mBatchFlagButton.setEnabled(false);
|
||||
|
||||
}
|
||||
private void hideBatchButtons()
|
||||
{
|
||||
//TODO: Fade out animation
|
||||
@ -2196,6 +2215,14 @@ public class MessageList
|
||||
}
|
||||
private void showBatchButtons()
|
||||
{
|
||||
if (mSelectedCount==0)
|
||||
{
|
||||
disableBatchButtons();
|
||||
}
|
||||
else
|
||||
{
|
||||
enableBatchButtons();
|
||||
}
|
||||
//TODO: Fade in animation
|
||||
mBatchButtonArea.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user