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

cut down a couple overly verbose conditionals

This commit is contained in:
Jesse Vincent 2010-12-26 03:49:06 +00:00
parent daf5a9d704
commit 877427f110

View File

@ -997,64 +997,38 @@ public class MessageView extends K9Activity implements OnClickListener
} }
} }
} }
if (K9.DEBUG) if (K9.DEBUG)
Log.d(K9.LOG_TAG, "MessageView got message " + mMessageReference); Log.d(K9.LOG_TAG, "MessageView got message " + mMessageReference);
if (intent.getBooleanExtra(EXTRA_NEXT, false))
boolean goNext = intent.getBooleanExtra(EXTRA_NEXT, false);
if (goNext)
{ {
next.requestFocus(); next.requestFocus();
} }
// Perhaps the ScrollButtons should be global, instead of account-specific // Perhaps the ScrollButtons should be global, instead of account-specific
mAccount = Preferences.getPreferences(this).getAccount(mMessageReference.accountUuid); mAccount = Preferences.getPreferences(this).getAccount(mMessageReference.accountUuid);
Account.ScrollButtons scrollButtons = mAccount.getScrollMessageViewButtons(); Account.ScrollButtons scrollButtons = mAccount.getScrollMessageViewButtons();
if
//MessagingController.getInstance(getApplication()).addListener(mListener); ((Account.ScrollButtons.ALWAYS == scrollButtons)
if (Account.ScrollButtons.ALWAYS == scrollButtons) ||
(Account.ScrollButtons.KEYBOARD_AVAILABLE == scrollButtons &&
(this.getResources().getConfiguration().hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO)))
{ {
scrollButtons(); scrollButtons();
} }
else if (Account.ScrollButtons.NEVER == scrollButtons) else // never or the keyboard is open
{ {
staticButtons(); staticButtons();
} }
else // Account.ScrollButtons.KEYBOARD_AVAIL
{
if (this.getResources().getConfiguration().hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO)
{
scrollButtons();
}
else
{
staticButtons();
}
}
Account.ScrollButtons scrollMoveButtons = mAccount.getScrollMessageViewMoveButtons(); Account.ScrollButtons scrollMoveButtons = mAccount.getScrollMessageViewMoveButtons();
if (Account.ScrollButtons.ALWAYS == scrollMoveButtons) if ((Account.ScrollButtons.ALWAYS == scrollMoveButtons)
|| (Account.ScrollButtons.KEYBOARD_AVAILABLE == scrollMoveButtons &&
(this.getResources().getConfiguration().hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO)))
{ {
scrollMoveButtons(); scrollMoveButtons();
} }
else if (Account.ScrollButtons.NEVER == scrollMoveButtons) else
{ {
staticMoveButtons(); staticMoveButtons();
} }
else // Account.ScrollButtons.KEYBOARD_AVAIL
{
if (this.getResources().getConfiguration().hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO)
{
scrollMoveButtons();
}
else
{
staticMoveButtons();
}
}
if (!mAccount.getEnableMoveButtons()) if (!mAccount.getEnableMoveButtons())
{ {
View buttons = findViewById(R.id.move_buttons); View buttons = findViewById(R.id.move_buttons);