mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-12 12:35:04 -05:00
Fix whitespace; no functional changes.
This commit is contained in:
parent
38c4f24111
commit
3e261568ae
@ -761,11 +761,11 @@ public class MessageView extends K9Activity implements OnClickListener {
|
|||||||
finish();
|
finish();
|
||||||
break;
|
break;
|
||||||
case R.id.next_message:
|
case R.id.next_message:
|
||||||
onNext();
|
onNext();
|
||||||
break;
|
break;
|
||||||
case R.id.previous_message:
|
case R.id.previous_message:
|
||||||
onPrevious();
|
onPrevious();
|
||||||
break;
|
break;
|
||||||
case R.id.delete:
|
case R.id.delete:
|
||||||
onDelete();
|
onDelete();
|
||||||
break;
|
break;
|
||||||
@ -814,35 +814,35 @@ public class MessageView extends K9Activity implements OnClickListener {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureMenu(Menu menu){
|
private void configureMenu(Menu menu) {
|
||||||
// first run displayMessage() gets called before onCreateOptionMenu()
|
// first run displayMessage() gets called before onCreateOptionMenu()
|
||||||
if (menu == null) {
|
if (menu == null) {
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
// enable them all
|
|
||||||
menu.findItem(R.id.copy).setVisible(true);
|
|
||||||
menu.findItem(R.id.move).setVisible(true);
|
|
||||||
menu.findItem(R.id.archive).setVisible(true);
|
|
||||||
menu.findItem(R.id.spam).setVisible(true);
|
|
||||||
toggleActionsState(menu, true);
|
|
||||||
|
|
||||||
if (mNextMessage != null ) {
|
|
||||||
|
|
||||||
menu.findItem(R.id.next_message).setEnabled(true);
|
|
||||||
menu.findItem(R.id.next_message).getIcon().setAlpha(255);
|
|
||||||
} else {
|
|
||||||
menu.findItem(R.id.next_message).getIcon().setAlpha(127);
|
|
||||||
menu.findItem(R.id.next_message).setEnabled(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mPreviousMessage != null ) {
|
// enable them all
|
||||||
|
menu.findItem(R.id.copy).setVisible(true);
|
||||||
|
menu.findItem(R.id.move).setVisible(true);
|
||||||
|
menu.findItem(R.id.archive).setVisible(true);
|
||||||
|
menu.findItem(R.id.spam).setVisible(true);
|
||||||
|
toggleActionsState(menu, true);
|
||||||
|
|
||||||
menu.findItem(R.id.previous_message).setEnabled(true);
|
if (mNextMessage != null) {
|
||||||
menu.findItem(R.id.previous_message).getIcon().setAlpha(255);
|
|
||||||
|
menu.findItem(R.id.next_message).setEnabled(true);
|
||||||
|
menu.findItem(R.id.next_message).getIcon().setAlpha(255);
|
||||||
} else {
|
} else {
|
||||||
menu.findItem(R.id.previous_message).getIcon().setAlpha(127);
|
menu.findItem(R.id.next_message).getIcon().setAlpha(127);
|
||||||
menu.findItem(R.id.previous_message).setEnabled(false);
|
menu.findItem(R.id.next_message).setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mPreviousMessage != null) {
|
||||||
|
|
||||||
|
menu.findItem(R.id.previous_message).setEnabled(true);
|
||||||
|
menu.findItem(R.id.previous_message).getIcon().setAlpha(255);
|
||||||
|
} else {
|
||||||
|
menu.findItem(R.id.previous_message).getIcon().setAlpha(127);
|
||||||
|
menu.findItem(R.id.previous_message).setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// comply with the setting
|
// comply with the setting
|
||||||
@ -851,7 +851,7 @@ public class MessageView extends K9Activity implements OnClickListener {
|
|||||||
menu.findItem(R.id.archive).setVisible(false);
|
menu.findItem(R.id.archive).setVisible(false);
|
||||||
menu.findItem(R.id.spam).setVisible(false);
|
menu.findItem(R.id.spam).setVisible(false);
|
||||||
} else {
|
} else {
|
||||||
// check message, folder capability
|
// check message, folder capability
|
||||||
if (!mController.isCopyCapable(mAccount)) {
|
if (!mController.isCopyCapable(mAccount)) {
|
||||||
menu.findItem(R.id.copy).setVisible(false);
|
menu.findItem(R.id.copy).setVisible(false);
|
||||||
}
|
}
|
||||||
@ -860,25 +860,25 @@ public class MessageView extends K9Activity implements OnClickListener {
|
|||||||
menu.findItem(R.id.move).setVisible(true);
|
menu.findItem(R.id.move).setVisible(true);
|
||||||
|
|
||||||
menu.findItem(R.id.archive).setVisible(
|
menu.findItem(R.id.archive).setVisible(
|
||||||
!mMessageReference.folderName.equals(mAccount.getArchiveFolderName())
|
!mMessageReference.folderName.equals(mAccount.getArchiveFolderName())
|
||||||
&& mAccount.hasArchiveFolder());
|
&& mAccount.hasArchiveFolder());
|
||||||
|
|
||||||
menu.findItem(R.id.spam).setVisible(
|
menu.findItem(R.id.spam).setVisible(
|
||||||
!mMessageReference.folderName.equals(mAccount.getSpamFolderName())
|
!mMessageReference.folderName.equals(mAccount.getSpamFolderName())
|
||||||
&& mAccount.hasSpamFolder());
|
&& mAccount.hasSpamFolder());
|
||||||
} else {
|
} else {
|
||||||
menu.findItem(R.id.copy).setVisible(false);
|
menu.findItem(R.id.copy).setVisible(false);
|
||||||
menu.findItem(R.id.move).setVisible(false);
|
menu.findItem(R.id.move).setVisible(false);
|
||||||
menu.findItem(R.id.archive).setVisible(false);
|
menu.findItem(R.id.archive).setVisible(false);
|
||||||
menu.findItem(R.id.spam).setVisible(false);
|
menu.findItem(R.id.spam).setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void toggleActionsState(Menu menu, boolean state){
|
private void toggleActionsState(Menu menu, boolean state) {
|
||||||
for(int i=0; i<menu.size(); ++i) {
|
for (int i = 0; i < menu.size(); ++i) {
|
||||||
menu.getItem(i).setEnabled(state);
|
menu.getItem(i).setEnabled(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: when switching to API version 8, override onCreateDialog(int, Bundle)
|
// TODO: when switching to API version 8, override onCreateDialog(int, Bundle)
|
||||||
|
Loading…
Reference in New Issue
Block a user