diff --git a/k9mail/src/main/java/com/fsck/k9/activity/Accounts.java b/k9mail/src/main/java/com/fsck/k9/activity/Accounts.java index b2bd2e6e4..563dca5c7 100644 --- a/k9mail/src/main/java/com/fsck/k9/activity/Accounts.java +++ b/k9mail/src/main/java/com/fsck/k9/activity/Accounts.java @@ -122,21 +122,21 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { private ConcurrentMap pendingWork = new ConcurrentHashMap(); - private BaseAccount mSelectedContextAccount; - private int mUnreadMessageCount = 0; + private BaseAccount selectedContextAccount; + private int unreadMessageCount = 0; - private AccountsHandler mHandler = new AccountsHandler(); - private AccountsAdapter mAdapter; - private SearchAccount mAllMessagesAccount = null; - private SearchAccount mUnifiedInboxAccount = null; - private FontSizes mFontSizes = K9.getFontSizes(); + private AccountsHandler handler = new AccountsHandler(); + private AccountsAdapter adapter; + private SearchAccount allMessagesAccount = null; + private SearchAccount unifiedInboxAccount = null; + private FontSizes fontSizes = K9.getFontSizes(); - private MenuItem mRefreshMenuItem; - private ActionBar mActionBar; + private MenuItem refreshMenuItem; + private ActionBar actionBar; - private TextView mActionBarTitle; - private TextView mActionBarSubTitle; - private TextView mActionBarUnread; + private TextView actionBarTitle; + private TextView actionBarSubTitle; + private TextView actionBarUnread; private boolean exportGlobalSettings; private ArrayList exportAccountUuids; @@ -146,7 +146,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { * * @see #onRetainNonConfigurationInstance() */ - private NonConfigurationInstance mNonConfigurationInstance; + private NonConfigurationInstance nonConfigurationInstance; private static final int ACTIVITY_REQUEST_PICK_SETTINGS_FILE = 1; @@ -154,22 +154,22 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { class AccountsHandler extends Handler { private void setViewTitle() { - mActionBarTitle.setText(getString(R.string.accounts_title)); + actionBarTitle.setText(getString(R.string.accounts_title)); - if (mUnreadMessageCount == 0) { - mActionBarUnread.setVisibility(View.GONE); + if (unreadMessageCount == 0) { + actionBarUnread.setVisibility(View.GONE); } else { - mActionBarUnread.setText(String.format("%d", mUnreadMessageCount)); - mActionBarUnread.setVisibility(View.VISIBLE); + actionBarUnread.setText(String.format("%d", unreadMessageCount)); + actionBarUnread.setVisibility(View.VISIBLE); } String operation = mListener.getOperation(Accounts.this); operation = operation.trim(); if (operation.length() < 1) { - mActionBarSubTitle.setVisibility(View.GONE); + actionBarSubTitle.setVisibility(View.GONE); } else { - mActionBarSubTitle.setVisibility(View.VISIBLE); - mActionBarSubTitle.setText(operation); + actionBarSubTitle.setVisibility(View.VISIBLE); + actionBarSubTitle.setText(operation); } } public void refreshTitle() { @@ -183,8 +183,8 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { public void dataChanged() { runOnUiThread(new Runnable() { public void run() { - if (mAdapter != null) { - mAdapter.notifyDataSetChanged(); + if (adapter != null) { + adapter.notifyDataSetChanged(); } } }); @@ -213,8 +213,8 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { Toast toast = Toast.makeText(getApplication(), toastText, Toast.LENGTH_LONG); toast.show(); - if (mAdapter != null) { - mAdapter.notifyDataSetChanged(); + if (adapter != null) { + adapter.notifyDataSetChanged(); } } }); @@ -222,16 +222,16 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { public void progress(final boolean progress) { // Make sure we don't try this before the menu is initialized // this could happen while the activity is initialized. - if (mRefreshMenuItem == null) { + if (refreshMenuItem == null) { return; } runOnUiThread(new Runnable() { public void run() { if (progress) { - mRefreshMenuItem.setActionView(R.layout.actionbar_indeterminate_progress_actionview); + refreshMenuItem.setActionView(R.layout.actionbar_indeterminate_progress_actionview); } else { - mRefreshMenuItem.setActionView(null); + refreshMenuItem.setActionView(null); } } }); @@ -247,13 +247,13 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { } public void setProgress(boolean progress) { - mHandler.progress(progress); + handler.progress(progress); } ActivityListener mListener = new ActivityListener() { @Override public void informUserOfStatus() { - mHandler.refreshTitle(); + handler.refreshTitle(); } @Override @@ -282,23 +282,23 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { } accountStats.put(account.getUuid(), stats); if (account instanceof Account) { - mUnreadMessageCount += stats.unreadMessageCount - oldUnreadMessageCount; + unreadMessageCount += stats.unreadMessageCount - oldUnreadMessageCount; } - mHandler.dataChanged(); + handler.dataChanged(); pendingWork.remove(account); if (pendingWork.isEmpty()) { - mHandler.progress(Window.PROGRESS_END); - mHandler.refreshTitle(); + handler.progress(Window.PROGRESS_END); + handler.refreshTitle(); } else { - int level = (Window.PROGRESS_END / mAdapter.getCount()) * (mAdapter.getCount() - pendingWork.size()) ; - mHandler.progress(level); + int level = (Window.PROGRESS_END / adapter.getCount()) * (adapter.getCount() - pendingWork.size()) ; + handler.progress(level); } } @Override public void accountSizeChanged(Account account, long oldSize, long newSize) { - mHandler.accountSizeChanged(account, oldSize, newSize); + handler.accountSizeChanged(account, oldSize, newSize); } @Override @@ -310,21 +310,21 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { MessagingController.getInstance(getApplication()).getAccountStats(Accounts.this, account, mListener); super.synchronizeMailboxFinished(account, folder, totalMessagesInMailbox, numNewMessages); - mHandler.progress(false); + handler.progress(false); } @Override public void synchronizeMailboxStarted(Account account, String folder) { super.synchronizeMailboxStarted(account, folder); - mHandler.progress(true); + handler.progress(true); } @Override public void synchronizeMailboxFailed(Account account, String folder, String message) { super.synchronizeMailboxFailed(account, folder, message); - mHandler.progress(false); + handler.progress(false); } @@ -406,7 +406,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { boolean startup = intent.getBooleanExtra(EXTRA_STARTUP, true); if (startup && K9.startIntegratedInbox() && !K9.isHideSpecialAccounts()) { - onOpenAccount(mUnifiedInboxAccount); + onOpenAccount(unifiedInboxAccount); finish(); return; } else if (startup && accounts.size() == 1 && onOpenAccount(accounts.get(0))) { @@ -415,7 +415,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { } requestWindowFeature(Window.FEATURE_PROGRESS); - mActionBar = getActionBar(); + actionBar = getActionBar(); initializeActionBar(); setContentView(R.layout.accounts); ListView listView = getListView(); @@ -427,16 +427,16 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { if (icicle != null && icicle.containsKey(SELECTED_CONTEXT_ACCOUNT)) { String accountUuid = icicle.getString("selectedContextAccount"); - mSelectedContextAccount = Preferences.getPreferences(this).getAccount(accountUuid); + selectedContextAccount = Preferences.getPreferences(this).getAccount(accountUuid); } restoreAccountStats(icicle); - mHandler.setViewTitle(); + handler.setViewTitle(); // Handle activity restarts because of a configuration change (e.g. rotating the screen) - mNonConfigurationInstance = (NonConfigurationInstance) getLastNonConfigurationInstance(); - if (mNonConfigurationInstance != null) { - mNonConfigurationInstance.restore(this); + nonConfigurationInstance = (NonConfigurationInstance) getLastNonConfigurationInstance(); + if (nonConfigurationInstance != null) { + nonConfigurationInstance.restore(this); } ChangeLog cl = new ChangeLog(this); @@ -446,23 +446,23 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { } private void initializeActionBar() { - mActionBar.setDisplayShowCustomEnabled(true); - mActionBar.setCustomView(R.layout.actionbar_custom); + actionBar.setDisplayShowCustomEnabled(true); + actionBar.setCustomView(R.layout.actionbar_custom); - View customView = mActionBar.getCustomView(); - mActionBarTitle = (TextView) customView.findViewById(R.id.actionbar_title_first); - mActionBarSubTitle = (TextView) customView.findViewById(R.id.actionbar_title_sub); - mActionBarUnread = (TextView) customView.findViewById(R.id.actionbar_unread_count); + View customView = actionBar.getCustomView(); + actionBarTitle = (TextView) customView.findViewById(R.id.actionbar_title_first); + actionBarSubTitle = (TextView) customView.findViewById(R.id.actionbar_title_sub); + actionBarUnread = (TextView) customView.findViewById(R.id.actionbar_unread_count); - mActionBar.setDisplayHomeAsUpEnabled(false); + actionBar.setDisplayHomeAsUpEnabled(false); } /** * Creates and initializes the special accounts ('Unified Inbox' and 'All Messages') */ private void createSpecialAccounts() { - mUnifiedInboxAccount = SearchAccount.createUnifiedInboxAccount(this); - mAllMessagesAccount = SearchAccount.createAllMessagesAccount(this); + unifiedInboxAccount = SearchAccount.createUnifiedInboxAccount(this); + allMessagesAccount = SearchAccount.createAllMessagesAccount(this); } @SuppressWarnings("unchecked") @@ -472,17 +472,17 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { if (oldStats != null) { accountStats.putAll(oldStats); } - mUnreadMessageCount = icicle.getInt(STATE_UNREAD_COUNT); + unreadMessageCount = icicle.getInt(STATE_UNREAD_COUNT); } } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); - if (mSelectedContextAccount != null) { - outState.putString(SELECTED_CONTEXT_ACCOUNT, mSelectedContextAccount.getUuid()); + if (selectedContextAccount != null) { + outState.putString(SELECTED_CONTEXT_ACCOUNT, selectedContextAccount.getUuid()); } - outState.putSerializable(STATE_UNREAD_COUNT, mUnreadMessageCount); + outState.putSerializable(STATE_UNREAD_COUNT, unreadMessageCount); outState.putSerializable(ACCOUNT_STATS, accountStats); outState.putBoolean(STATE_EXPORT_GLOBAL_SETTINGS, exportGlobalSettings); @@ -534,8 +534,8 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { @Override public Object onRetainNonConfigurationInstance() { Object retain = null; - if (mNonConfigurationInstance != null && mNonConfigurationInstance.retain()) { - retain = mNonConfigurationInstance; + if (nonConfigurationInstance != null && nonConfigurationInstance.retain()) { + retain = nonConfigurationInstance; } return retain; } @@ -572,27 +572,27 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { List newAccounts; if (!K9.isHideSpecialAccounts() && accounts.size() > 0) { - if (mUnifiedInboxAccount == null || mAllMessagesAccount == null) { + if (unifiedInboxAccount == null || allMessagesAccount == null) { createSpecialAccounts(); } newAccounts = new ArrayList(accounts.size() + SPECIAL_ACCOUNTS_COUNT); - newAccounts.add(mUnifiedInboxAccount); - newAccounts.add(mAllMessagesAccount); + newAccounts.add(unifiedInboxAccount); + newAccounts.add(allMessagesAccount); } else { newAccounts = new ArrayList(accounts.size()); } newAccounts.addAll(accounts); - mAdapter = new AccountsAdapter(newAccounts); - getListView().setAdapter(mAdapter); + adapter = new AccountsAdapter(newAccounts); + getListView().setAdapter(adapter); if (!newAccounts.isEmpty()) { - mHandler.progress(Window.PROGRESS_START); + handler.progress(Window.PROGRESS_START); } pendingWork.clear(); - mHandler.refreshTitle(); + handler.refreshTitle(); MessagingController controller = MessagingController.getInstance(getApplication()); @@ -1037,7 +1037,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { } private void onDeleteAccount(Account account) { - mSelectedContextAccount = account; + selectedContextAccount = account; showDialog(DIALOG_REMOVE_ACCOUNT); } @@ -1051,21 +1051,21 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { // dismissed. Make sure we have all information necessary before creating a new dialog. switch (id) { case DIALOG_REMOVE_ACCOUNT: { - if (mSelectedContextAccount == null) { + if (selectedContextAccount == null) { return null; } return ConfirmationDialog.create(this, id, R.string.account_delete_dlg_title, getString(R.string.account_delete_dlg_instructions_fmt, - mSelectedContextAccount.getDescription()), + selectedContextAccount.getDescription()), R.string.okay_action, R.string.cancel_action, new Runnable() { @Override public void run() { - if (mSelectedContextAccount instanceof Account) { - Account realAccount = (Account) mSelectedContextAccount; + if (selectedContextAccount instanceof Account) { + Account realAccount = (Account) selectedContextAccount; try { realAccount.getLocalStore().delete(); } catch (Exception e) { @@ -1083,22 +1083,22 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { }); } case DIALOG_CLEAR_ACCOUNT: { - if (mSelectedContextAccount == null) { + if (selectedContextAccount == null) { return null; } return ConfirmationDialog.create(this, id, R.string.account_clear_dlg_title, getString(R.string.account_clear_dlg_instructions_fmt, - mSelectedContextAccount.getDescription()), + selectedContextAccount.getDescription()), R.string.okay_action, R.string.cancel_action, new Runnable() { @Override public void run() { - if (mSelectedContextAccount instanceof Account) { - Account realAccount = (Account) mSelectedContextAccount; - mHandler.workingAccount(realAccount, + if (selectedContextAccount instanceof Account) { + Account realAccount = (Account) selectedContextAccount; + handler.workingAccount(realAccount, R.string.clearing_account); MessagingController.getInstance(getApplication()) .clear(realAccount, null); @@ -1107,22 +1107,22 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { }); } case DIALOG_RECREATE_ACCOUNT: { - if (mSelectedContextAccount == null) { + if (selectedContextAccount == null) { return null; } return ConfirmationDialog.create(this, id, R.string.account_recreate_dlg_title, getString(R.string.account_recreate_dlg_instructions_fmt, - mSelectedContextAccount.getDescription()), + selectedContextAccount.getDescription()), R.string.okay_action, R.string.cancel_action, new Runnable() { @Override public void run() { - if (mSelectedContextAccount instanceof Account) { - Account realAccount = (Account) mSelectedContextAccount; - mHandler.workingAccount(realAccount, + if (selectedContextAccount instanceof Account) { + Account realAccount = (Account) selectedContextAccount; + handler.workingAccount(realAccount, R.string.recreating_account); MessagingController.getInstance(getApplication()) .recreate(realAccount, null); @@ -1156,17 +1156,17 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { switch (id) { case DIALOG_REMOVE_ACCOUNT: { alert.setMessage(getString(R.string.account_delete_dlg_instructions_fmt, - mSelectedContextAccount.getDescription())); + selectedContextAccount.getDescription())); break; } case DIALOG_CLEAR_ACCOUNT: { alert.setMessage(getString(R.string.account_clear_dlg_instructions_fmt, - mSelectedContextAccount.getDescription())); + selectedContextAccount.getDescription())); break; } case DIALOG_RECREATE_ACCOUNT: { alert.setMessage(getString(R.string.account_recreate_dlg_instructions_fmt, - mSelectedContextAccount.getDescription())); + selectedContextAccount.getDescription())); break; } } @@ -1180,10 +1180,10 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { // submenus don't actually set the menuInfo, so the "advanced" // submenu wouldn't work. if (menuInfo != null) { - mSelectedContextAccount = (BaseAccount)getListView().getItemAtPosition(menuInfo.position); + selectedContextAccount = (BaseAccount)getListView().getItemAtPosition(menuInfo.position); } - if (mSelectedContextAccount instanceof Account) { - Account realAccount = (Account)mSelectedContextAccount; + if (selectedContextAccount instanceof Account) { + Account realAccount = (Account) selectedContextAccount; switch (item.getItemId()) { case R.id.delete_account: onDeleteAccount(realAccount); @@ -1377,7 +1377,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); getMenuInflater().inflate(R.menu.accounts_option, menu); - mRefreshMenuItem = menu.findItem(R.id.check_mail); + refreshMenuItem = menu.findItem(R.id.check_mail); return true; } @@ -1387,7 +1387,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { menu.setHeaderTitle(R.string.accounts_context_menu_title); AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo; - BaseAccount account = mAdapter.getItem(info.position); + BaseAccount account = adapter.getItem(info.position); if ((account instanceof Account) && !((Account) account).isEnabled()) { getMenuInflater().inflate(R.menu.disabled_accounts_context, menu); @@ -1743,7 +1743,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { * {@link Accounts#onRetainNonConfigurationInstance()} is called. */ private void setNonConfigurationInstance(NonConfigurationInstance inst) { - mNonConfigurationInstance = inst; + nonConfigurationInstance = inst; } class AccountsAdapter extends ArrayAdapter { @@ -1841,8 +1841,8 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { - mFontSizes.setViewTextSize(holder.description, mFontSizes.getAccountName()); - mFontSizes.setViewTextSize(holder.email, mFontSizes.getAccountDescription()); + fontSizes.setViewTextSize(holder.description, fontSizes.getAccountName()); + fontSizes.setViewTextSize(holder.email, fontSizes.getAccountDescription()); if (account instanceof SearchAccount) { holder.folders.setVisibility(View.GONE); diff --git a/k9mail/src/main/java/com/fsck/k9/activity/FolderList.java b/k9mail/src/main/java/com/fsck/k9/activity/FolderList.java index bd6aa8092..a4e7e3b87 100644 --- a/k9mail/src/main/java/com/fsck/k9/activity/FolderList.java +++ b/k9mail/src/main/java/com/fsck/k9/activity/FolderList.java @@ -78,48 +78,48 @@ public class FolderList extends K9ListActivity { private static final boolean REFRESH_REMOTE = true; - private ListView mListView; + private ListView listView; - private FolderListAdapter mAdapter; + private FolderListAdapter adapter; - private LayoutInflater mInflater; + private LayoutInflater inflater; - private Account mAccount; + private Account account; - private FolderListHandler mHandler = new FolderListHandler(); + private FolderListHandler handler = new FolderListHandler(); - private int mUnreadMessageCount; + private int unreadMessageCount; - private FontSizes mFontSizes = K9.getFontSizes(); + private FontSizes fontSizes = K9.getFontSizes(); private Context context; - private MenuItem mRefreshMenuItem; - private View mActionBarProgressView; - private ActionBar mActionBar; + private MenuItem refreshMenuItem; + private View actionBarProgressView; + private ActionBar actionBar; - private TextView mActionBarTitle; - private TextView mActionBarSubTitle; - private TextView mActionBarUnread; + private TextView actionBarTitle; + private TextView actionBarSubTitle; + private TextView actionBarUnread; class FolderListHandler extends Handler { public void refreshTitle() { runOnUiThread(new Runnable() { public void run() { - mActionBarTitle.setText(getString(R.string.folders_title)); + actionBarTitle.setText(getString(R.string.folders_title)); - if (mUnreadMessageCount == 0) { - mActionBarUnread.setVisibility(View.GONE); + if (unreadMessageCount == 0) { + actionBarUnread.setVisibility(View.GONE); } else { - mActionBarUnread.setText(String.format("%d", mUnreadMessageCount)); - mActionBarUnread.setVisibility(View.VISIBLE); + actionBarUnread.setText(String.format("%d", unreadMessageCount)); + actionBarUnread.setVisibility(View.VISIBLE); } - String operation = mAdapter.mListener.getOperation(FolderList.this); + String operation = adapter.mListener.getOperation(FolderList.this); if (operation.length() < 1) { - mActionBarSubTitle.setText(mAccount.getEmail()); + actionBarSubTitle.setText(account.getEmail()); } else { - mActionBarSubTitle.setText(operation); + actionBarSubTitle.setText(operation); } } }); @@ -129,10 +129,10 @@ public class FolderList extends K9ListActivity { public void newFolders(final List newFolders) { runOnUiThread(new Runnable() { public void run() { - mAdapter.mFolders.clear(); - mAdapter.mFolders.addAll(newFolders); - mAdapter.mFilteredFolders = mAdapter.mFolders; - mHandler.dataChanged(); + adapter.mFolders.clear(); + adapter.mFolders.addAll(newFolders); + adapter.mFilteredFolders = adapter.mFolders; + handler.dataChanged(); } }); } @@ -140,7 +140,7 @@ public class FolderList extends K9ListActivity { public void workingAccount(final int res) { runOnUiThread(new Runnable() { public void run() { - String toastText = getString(res, mAccount.getDescription()); + String toastText = getString(res, account.getDescription()); Toast toast = Toast.makeText(getApplication(), toastText, Toast.LENGTH_SHORT); toast.show(); } @@ -150,7 +150,7 @@ public class FolderList extends K9ListActivity { public void accountSizeChanged(final long oldSize, final long newSize) { runOnUiThread(new Runnable() { public void run() { - String toastText = getString(R.string.account_size_changed, mAccount.getDescription(), SizeFormatter.formatSize(getApplication(), oldSize), SizeFormatter.formatSize(getApplication(), newSize)); + String toastText = getString(R.string.account_size_changed, account.getDescription(), SizeFormatter.formatSize(getApplication(), oldSize), SizeFormatter.formatSize(getApplication(), newSize)); Toast toast = Toast.makeText(getApplication(), toastText, Toast.LENGTH_LONG); toast.show(); @@ -161,7 +161,7 @@ public class FolderList extends K9ListActivity { public void folderLoading(final String folder, final boolean loading) { runOnUiThread(new Runnable() { public void run() { - FolderInfoHolder folderHolder = mAdapter.getFolder(folder); + FolderInfoHolder folderHolder = adapter.getFolder(folder); if (folderHolder != null) { @@ -175,16 +175,16 @@ public class FolderList extends K9ListActivity { public void progress(final boolean progress) { // Make sure we don't try this before the menu is initialized // this could happen while the activity is initialized. - if (mRefreshMenuItem == null) { + if (refreshMenuItem == null) { return; } runOnUiThread(new Runnable() { public void run() { if (progress) { - mRefreshMenuItem.setActionView(mActionBarProgressView); + refreshMenuItem.setActionView(actionBarProgressView); } else { - mRefreshMenuItem.setActionView(null); + refreshMenuItem.setActionView(null); } } }); @@ -194,7 +194,7 @@ public class FolderList extends K9ListActivity { public void dataChanged() { runOnUiThread(new Runnable() { public void run() { - mAdapter.notifyDataSetChanged(); + adapter.notifyDataSetChanged(); } }); } @@ -214,7 +214,7 @@ public class FolderList extends K9ListActivity { MessagingListener listener = new SimpleMessagingListener() { @Override public void synchronizeMailboxFinished(Account account, String folder, int totalMessagesInMailbox, int numNewMessages) { - if (!account.equals(mAccount)) { + if (!account.equals(FolderList.this.account)) { return; } wakeLock.release(); @@ -223,14 +223,14 @@ public class FolderList extends K9ListActivity { @Override public void synchronizeMailboxFailed(Account account, String folder, String message) { - if (!account.equals(mAccount)) { + if (!account.equals(FolderList.this.account)) { return; } wakeLock.release(); } }; - MessagingController.getInstance(getApplication()).synchronizeMailbox(mAccount, folder.name, listener, null); - sendMail(mAccount); + MessagingController.getInstance(getApplication()).synchronizeMailbox(account, folder.name, listener, null); + sendMail(account); } public static Intent actionHandleAccountIntent(Context context, Account account, boolean fromShortcut) { @@ -259,25 +259,25 @@ public class FolderList extends K9ListActivity { return; } - mActionBarProgressView = getActionBarProgressView(); - mActionBar = getActionBar(); + actionBarProgressView = getActionBarProgressView(); + actionBar = getActionBar(); initializeActionBar(); setContentView(R.layout.folder_list); - mListView = getListView(); - mListView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); - mListView.setLongClickable(true); - mListView.setFastScrollEnabled(true); - mListView.setScrollingCacheEnabled(false); - mListView.setOnItemClickListener(new OnItemClickListener() { + listView = getListView(); + listView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); + listView.setLongClickable(true); + listView.setFastScrollEnabled(true); + listView.setScrollingCacheEnabled(false); + listView.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View view, int position, long id) { - onOpenFolder(((FolderInfoHolder)mAdapter.getItem(position)).name); + onOpenFolder(((FolderInfoHolder) adapter.getItem(position)).name); } }); - registerForContextMenu(mListView); + registerForContextMenu(listView); - mListView.setSaveEnabled(true); + listView.setSaveEnabled(true); - mInflater = getLayoutInflater(); + inflater = getLayoutInflater(); context = this; @@ -303,26 +303,26 @@ public class FolderList extends K9ListActivity { } private void initializeActionBar() { - mActionBar.setDisplayShowCustomEnabled(true); - mActionBar.setCustomView(R.layout.actionbar_custom); + actionBar.setDisplayShowCustomEnabled(true); + actionBar.setCustomView(R.layout.actionbar_custom); - View customView = mActionBar.getCustomView(); - mActionBarTitle = (TextView) customView.findViewById(R.id.actionbar_title_first); - mActionBarSubTitle = (TextView) customView.findViewById(R.id.actionbar_title_sub); - mActionBarUnread = (TextView) customView.findViewById(R.id.actionbar_unread_count); + View customView = actionBar.getCustomView(); + actionBarTitle = (TextView) customView.findViewById(R.id.actionbar_title_first); + actionBarSubTitle = (TextView) customView.findViewById(R.id.actionbar_title_sub); + actionBarUnread = (TextView) customView.findViewById(R.id.actionbar_unread_count); - mActionBar.setDisplayHomeAsUpEnabled(true); + actionBar.setDisplayHomeAsUpEnabled(true); } @Override public void onNewIntent(Intent intent) { setIntent(intent); // onNewIntent doesn't autoset our "internal" intent - mUnreadMessageCount = 0; + unreadMessageCount = 0; String accountUuid = intent.getStringExtra(EXTRA_ACCOUNT); - mAccount = Preferences.getPreferences(this).getAccount(accountUuid); + account = Preferences.getPreferences(this).getAccount(accountUuid); - if (mAccount == null) { + if (account == null) { /* * This can happen when a launcher shortcut is created for an * account, and then the account is deleted or data is wiped, and @@ -333,8 +333,8 @@ public class FolderList extends K9ListActivity { } if (intent.getBooleanExtra(EXTRA_FROM_SHORTCUT, false) && - !K9.FOLDER_NONE.equals(mAccount.getAutoExpandFolderName())) { - onOpenFolder(mAccount.getAutoExpandFolderName()); + !K9.FOLDER_NONE.equals(account.getAutoExpandFolderName())) { + onOpenFolder(account.getAutoExpandFolderName()); finish(); } else { initializeActivityView(); @@ -342,11 +342,11 @@ public class FolderList extends K9ListActivity { } private void initializeActivityView() { - mAdapter = new FolderListAdapter(); + adapter = new FolderListAdapter(); restorePreviousData(); - setListAdapter(mAdapter); - getListView().setTextFilterEnabled(mAdapter.getFilter() != null); // should never be false but better safe then sorry + setListAdapter(adapter); + getListView().setTextFilterEnabled(adapter.getFilter() != null); // should never be false but better safe then sorry } @SuppressWarnings("unchecked") @@ -354,20 +354,20 @@ public class FolderList extends K9ListActivity { final Object previousData = getLastNonConfigurationInstance(); if (previousData != null) { - mAdapter.mFolders = (ArrayList) previousData; - mAdapter.mFilteredFolders = Collections.unmodifiableList(mAdapter.mFolders); + adapter.mFolders = (ArrayList) previousData; + adapter.mFilteredFolders = Collections.unmodifiableList(adapter.mFolders); } } @Override public Object onRetainNonConfigurationInstance() { - return (mAdapter == null) ? null : mAdapter.mFolders; + return (adapter == null) ? null : adapter.mFolders; } @Override public void onPause() { super.onPause(); - MessagingController.getInstance(getApplication()).removeListener(mAdapter.mListener); - mAdapter.mListener.onPause(this); + MessagingController.getInstance(getApplication()).removeListener(adapter.mListener); + adapter.mListener.onPause(this); } /** @@ -378,25 +378,25 @@ public class FolderList extends K9ListActivity { @Override public void onResume() { super.onResume(); - if (!mAccount.isAvailable(this)) { + if (!account.isAvailable(this)) { Timber.i("account unavaliabale, not showing folder-list but account-list"); Accounts.listAccounts(this); finish(); return; } - if (mAdapter == null) + if (adapter == null) initializeActivityView(); - mHandler.refreshTitle(); + handler.refreshTitle(); - MessagingController.getInstance(getApplication()).addListener(mAdapter.mListener); - //mAccount.refresh(Preferences.getPreferences(this)); - MessagingController.getInstance(getApplication()).getAccountStats(this, mAccount, mAdapter.mListener); + MessagingController.getInstance(getApplication()).addListener(adapter.mListener); + //account.refresh(Preferences.getPreferences(this)); + MessagingController.getInstance(getApplication()).getAccountStats(this, account, adapter.mListener); onRefresh(!REFRESH_REMOTE); - MessagingController.getInstance(getApplication()).cancelNotificationsForAccount(mAccount); - mAdapter.mListener.onResume(this); + MessagingController.getInstance(getApplication()).cancelNotificationsForAccount(account); + adapter.mListener.onResume(this); } @Override @@ -442,19 +442,19 @@ public class FolderList extends K9ListActivity { }//onKeyDown private void setDisplayMode(FolderMode newMode) { - mAccount.setFolderDisplayMode(newMode); - mAccount.save(Preferences.getPreferences(this)); - if (mAccount.getFolderPushMode() != FolderMode.NONE) { + account.setFolderDisplayMode(newMode); + account.save(Preferences.getPreferences(this)); + if (account.getFolderPushMode() != FolderMode.NONE) { MailService.actionRestartPushers(this, null); } - mAdapter.getFilter().filter(null); + adapter.getFilter().filter(null); onRefresh(false); } private void onRefresh(final boolean forceRemote) { - MessagingController.getInstance(getApplication()).listFolders(mAccount, forceRemote, mAdapter.mListener); + MessagingController.getInstance(getApplication()).listFolders(account, forceRemote, adapter.mListener); } @@ -462,7 +462,7 @@ public class FolderList extends K9ListActivity { Prefs.actionPrefs(this); } private void onEditAccount() { - AccountSettings.actionSettings(this, mAccount); + AccountSettings.actionSettings(this, account); } private void onAccounts() { @@ -471,17 +471,17 @@ public class FolderList extends K9ListActivity { } private void onEmptyTrash(final Account account) { - mHandler.dataChanged(); + handler.dataChanged(); MessagingController.getInstance(getApplication()).emptyTrash(account, null); } private void onClearFolder(Account account, String folderName) { - MessagingController.getInstance(getApplication()).clearFolder(account, folderName, mAdapter.mListener); + MessagingController.getInstance(getApplication()).clearFolder(account, folderName, adapter.mListener); } private void sendMail(Account account) { - MessagingController.getInstance(getApplication()).sendPendingMessages(account, mAdapter.mListener); + MessagingController.getInstance(getApplication()).sendPendingMessages(account, adapter.mListener); } @Override public boolean onOptionsItemSelected(MenuItem item) { @@ -497,17 +497,17 @@ public class FolderList extends K9ListActivity { return true; case R.id.compose: - MessageActions.actionCompose(this, mAccount); + MessageActions.actionCompose(this, account); return true; case R.id.check_mail: - MessagingController.getInstance(getApplication()).checkMail(this, mAccount, true, true, mAdapter.mListener); + MessagingController.getInstance(getApplication()).checkMail(this, account, true, true, adapter.mListener); return true; case R.id.send_messages: - MessagingController.getInstance(getApplication()).sendPendingMessages(mAccount, null); + MessagingController.getInstance(getApplication()).sendPendingMessages(account, null); return true; @@ -527,12 +527,12 @@ public class FolderList extends K9ListActivity { return true; case R.id.empty_trash: - onEmptyTrash(mAccount); + onEmptyTrash(account); return true; case R.id.compact: - onCompact(mAccount); + onCompact(account); return true; @@ -560,27 +560,27 @@ public class FolderList extends K9ListActivity { @Override public boolean onSearchRequested() { Bundle appData = new Bundle(); - appData.putString(MessageList.EXTRA_SEARCH_ACCOUNT, mAccount.getUuid()); + appData.putString(MessageList.EXTRA_SEARCH_ACCOUNT, account.getUuid()); startSearch(null, false, appData, false); return true; } private void onOpenFolder(String folder) { LocalSearch search = new LocalSearch(folder); - search.addAccountUuid(mAccount.getUuid()); + search.addAccountUuid(account.getUuid()); search.addAllowedFolder(folder); MessageList.actionDisplaySearch(this, search, false, false); } private void onCompact(Account account) { - mHandler.workingAccount(R.string.compacting_account); + handler.workingAccount(R.string.compacting_account); MessagingController.getInstance(getApplication()).compact(account, null); } @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); getMenuInflater().inflate(R.menu.folder_list_option, menu); - mRefreshMenuItem = menu.findItem(R.id.check_mail); + refreshMenuItem = menu.findItem(R.id.check_mail); configureFolderSearchView(menu); return true; } @@ -594,13 +594,13 @@ public class FolderList extends K9ListActivity { @Override public boolean onQueryTextSubmit(String query) { folderMenuItem.collapseActionView(); - mActionBarTitle.setText(getString(R.string.filter_folders_action)); + actionBarTitle.setText(getString(R.string.filter_folders_action)); return true; } @Override public boolean onQueryTextChange(String newText) { - mAdapter.getFilter().filter(newText); + adapter.getFilter().filter(newText); return true; } }); @@ -609,7 +609,7 @@ public class FolderList extends K9ListActivity { @Override public boolean onClose() { - mActionBarTitle.setText(getString(R.string.folders_title)); + actionBarTitle.setText(getString(R.string.folders_title)); return false; } }); @@ -617,17 +617,17 @@ public class FolderList extends K9ListActivity { @Override public boolean onContextItemSelected(android.view.MenuItem item) { AdapterContextMenuInfo info = (AdapterContextMenuInfo) item .getMenuInfo(); - FolderInfoHolder folder = (FolderInfoHolder) mAdapter.getItem(info.position); + FolderInfoHolder folder = (FolderInfoHolder) adapter.getItem(info.position); switch (item.getItemId()) { case R.id.clear_local_folder: - onClearFolder(mAccount, folder.name); + onClearFolder(account, folder.name); break; case R.id.refresh_folder: checkMail(folder); break; case R.id.folder_settings: - FolderSettings.actionSettings(this, mAccount, folder.name); + FolderSettings.actionSettings(this, account, folder.name); break; } @@ -639,7 +639,7 @@ public class FolderList extends K9ListActivity { AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo; getMenuInflater().inflate(R.menu.folder_context, menu); - FolderInfoHolder folder = (FolderInfoHolder) mAdapter.getItem(info.position); + FolderInfoHolder folder = (FolderInfoHolder) adapter.getItem(info.position); menu.setHeaderTitle(folder.displayName); } @@ -679,25 +679,25 @@ public class FolderList extends K9ListActivity { private ActivityListener mListener = new ActivityListener() { @Override public void informUserOfStatus() { - mHandler.refreshTitle(); - mHandler.dataChanged(); + handler.refreshTitle(); + handler.dataChanged(); } @Override public void accountStatusChanged(BaseAccount account, AccountStats stats) { - if (!account.equals(mAccount)) { + if (!account.equals(FolderList.this.account)) { return; } if (stats == null) { return; } - mUnreadMessageCount = stats.unreadMessageCount; - mHandler.refreshTitle(); + unreadMessageCount = stats.unreadMessageCount; + handler.refreshTitle(); } @Override public void listFoldersStarted(Account account) { - if (account.equals(mAccount)) { - mHandler.progress(true); + if (account.equals(FolderList.this.account)) { + handler.progress(true); } super.listFoldersStarted(account); @@ -705,8 +705,8 @@ public class FolderList extends K9ListActivity { @Override public void listFoldersFailed(Account account, String message) { - if (account.equals(mAccount)) { - mHandler.progress(false); + if (account.equals(FolderList.this.account)) { + handler.progress(false); Toast.makeText(context, R.string.fetching_folders_failed, Toast.LENGTH_SHORT).show(); } super.listFoldersFailed(account, message); @@ -714,11 +714,11 @@ public class FolderList extends K9ListActivity { @Override public void listFoldersFinished(Account account) { - if (account.equals(mAccount)) { + if (account.equals(FolderList.this.account)) { - mHandler.progress(false); - MessagingController.getInstance(getApplication()).refreshListener(mAdapter.mListener); - mHandler.dataChanged(); + handler.progress(false); + MessagingController.getInstance(getApplication()).refreshListener(adapter.mListener); + handler.dataChanged(); } super.listFoldersFinished(account); @@ -726,7 +726,7 @@ public class FolderList extends K9ListActivity { @Override public void listFolders(Account account, List folders) { - if (account.equals(mAccount)) { + if (account.equals(FolderList.this.account)) { List newFolders = new LinkedList(); List topFolders = new LinkedList(); @@ -751,9 +751,9 @@ public class FolderList extends K9ListActivity { } if (holder == null) { - holder = new FolderInfoHolder(context, folder, mAccount, -1); + holder = new FolderInfoHolder(context, folder, FolderList.this.account, -1); } else { - holder.populate(context, folder, mAccount, -1); + holder.populate(context, folder, FolderList.this.account, -1); } if (folder.isInTopGroup()) { @@ -765,7 +765,7 @@ public class FolderList extends K9ListActivity { Collections.sort(newFolders); Collections.sort(topFolders); topFolders.addAll(newFolders); - mHandler.newFolders(topFolders); + handler.newFolders(topFolders); } super.listFolders(account, folders); } @@ -773,11 +773,11 @@ public class FolderList extends K9ListActivity { @Override public void synchronizeMailboxStarted(Account account, String folder) { super.synchronizeMailboxStarted(account, folder); - if (account.equals(mAccount)) { + if (account.equals(FolderList.this.account)) { - mHandler.progress(true); - mHandler.folderLoading(folder, true); - mHandler.dataChanged(); + handler.progress(true); + handler.folderLoading(folder, true); + handler.dataChanged(); } } @@ -785,9 +785,9 @@ public class FolderList extends K9ListActivity { @Override public void synchronizeMailboxFinished(Account account, String folder, int totalMessagesInMailbox, int numNewMessages) { super.synchronizeMailboxFinished(account, folder, totalMessagesInMailbox, numNewMessages); - if (account.equals(mAccount)) { - mHandler.progress(false); - mHandler.folderLoading(folder, false); + if (account.equals(FolderList.this.account)) { + handler.progress(false); + handler.folderLoading(folder, false); refreshFolder(account, folder); } @@ -806,10 +806,10 @@ public class FolderList extends K9ListActivity { localFolder = account.getLocalStore().getFolder(folderName); FolderInfoHolder folderHolder = getFolder(folderName); if (folderHolder != null) { - folderHolder.populate(context, localFolder, mAccount, -1); + folderHolder.populate(context, localFolder, FolderList.this.account, -1); folderHolder.flaggedMessageCount = -1; - mHandler.dataChanged(); + handler.dataChanged(); } } } catch (Exception e) { @@ -825,31 +825,31 @@ public class FolderList extends K9ListActivity { @Override public void synchronizeMailboxFailed(Account account, String folder, String message) { super.synchronizeMailboxFailed(account, folder, message); - if (!account.equals(mAccount)) { + if (!account.equals(FolderList.this.account)) { return; } - mHandler.progress(false); + handler.progress(false); - mHandler.folderLoading(folder, false); + handler.folderLoading(folder, false); // String mess = truncateStatus(message); - // mHandler.folderStatus(folder, mess); + // handler.folderStatus(folder, mess); FolderInfoHolder holder = getFolder(folder); if (holder != null) { holder.lastChecked = 0; } - mHandler.dataChanged(); + handler.dataChanged(); } @Override public void setPushActive(Account account, String folderName, boolean enabled) { - if (!account.equals(mAccount)) { + if (!account.equals(FolderList.this.account)) { return; } FolderInfoHolder holder = getFolder(folderName); @@ -857,7 +857,7 @@ public class FolderList extends K9ListActivity { if (holder != null) { holder.pushActive = enabled; - mHandler.dataChanged(); + handler.dataChanged(); } } @@ -869,14 +869,14 @@ public class FolderList extends K9ListActivity { @Override public void emptyTrashCompleted(Account account) { - if (account.equals(mAccount)) { - refreshFolder(account, mAccount.getTrashFolderName()); + if (account.equals(FolderList.this.account)) { + refreshFolder(account, FolderList.this.account.getTrashFolderName()); } } @Override public void folderStatusChanged(Account account, String folderName, int unreadMessageCount) { - if (account.equals(mAccount)) { + if (account.equals(FolderList.this.account)) { refreshFolder(account, folderName); informUserOfStatus(); } @@ -885,8 +885,8 @@ public class FolderList extends K9ListActivity { @Override public void sendPendingMessagesCompleted(Account account) { super.sendPendingMessagesCompleted(account); - if (account.equals(mAccount)) { - refreshFolder(account, mAccount.getOutboxFolderName()); + if (account.equals(FolderList.this.account)) { + refreshFolder(account, FolderList.this.account.getOutboxFolderName()); } } @@ -894,23 +894,23 @@ public class FolderList extends K9ListActivity { public void sendPendingMessagesStarted(Account account) { super.sendPendingMessagesStarted(account); - if (account.equals(mAccount)) { - mHandler.dataChanged(); + if (account.equals(FolderList.this.account)) { + handler.dataChanged(); } } @Override public void sendPendingMessagesFailed(Account account) { super.sendPendingMessagesFailed(account); - if (account.equals(mAccount)) { - refreshFolder(account, mAccount.getOutboxFolderName()); + if (account.equals(FolderList.this.account)) { + refreshFolder(account, FolderList.this.account.getOutboxFolderName()); } } @Override public void accountSizeChanged(Account account, long oldSize, long newSize) { - if (account.equals(mAccount)) { - mHandler.accountSizeChanged(oldSize, newSize); + if (account.equals(FolderList.this.account)) { + handler.accountSizeChanged(oldSize, newSize); } } }; @@ -950,7 +950,7 @@ public class FolderList extends K9ListActivity { if (convertView != null) { view = convertView; } else { - view = mInflater.inflate(R.layout.folder_list_item, parent, false); + view = inflater.inflate(R.layout.folder_list_item, parent, false); } FolderViewHolder holder = (FolderViewHolder) view.getTag(); @@ -1018,16 +1018,16 @@ public class FolderList extends K9ListActivity { try { folder.unreadMessageCount = folder.folder.getUnreadMessageCount(); } catch (Exception e) { - Timber.e("Unable to get unreadMessageCount for %s:%s", mAccount.getDescription(), folder.name); + Timber.e("Unable to get unreadMessageCount for %s:%s", account.getDescription(), folder.name); } } if (folder.unreadMessageCount > 0) { holder.newMessageCount.setText(String.format("%d", folder.unreadMessageCount)); holder.newMessageCountWrapper.setOnClickListener( - createUnreadSearch(mAccount, folder)); + createUnreadSearch(account, folder)); holder.newMessageCountWrapper.setVisibility(View.VISIBLE); holder.newMessageCountIcon.setBackgroundDrawable( - mAccount.generateColorChip(false, false).drawable()); + account.generateColorChip(false, false).drawable()); } else { holder.newMessageCountWrapper.setVisibility(View.GONE); } @@ -1037,17 +1037,17 @@ public class FolderList extends K9ListActivity { try { folder.flaggedMessageCount = folder.folder.getFlaggedMessageCount(); } catch (Exception e) { - Timber.e("Unable to get flaggedMessageCount for %s:%s", mAccount.getDescription(), folder.name); + Timber.e("Unable to get flaggedMessageCount for %s:%s", account.getDescription(), folder.name); } } if (K9.messageListStars() && folder.flaggedMessageCount > 0) { holder.flaggedMessageCount.setText(String.format("%d", folder.flaggedMessageCount)); holder.flaggedMessageCountWrapper.setOnClickListener( - createFlaggedSearch(mAccount, folder)); + createFlaggedSearch(account, folder)); holder.flaggedMessageCountWrapper.setVisibility(View.VISIBLE); holder.flaggedMessageCountIcon.setBackgroundDrawable( - mAccount.generateColorChip(false, true).drawable()); + account.generateColorChip(false, true).drawable()); } else { holder.flaggedMessageCountWrapper.setVisibility(View.GONE); } @@ -1059,10 +1059,10 @@ public class FolderList extends K9ListActivity { } }); - holder.chip.setBackgroundColor(mAccount.getChipColor()); + holder.chip.setBackgroundColor(account.getChipColor()); - mFontSizes.setViewTextSize(holder.folderName, mFontSizes.getFolderName()); + fontSizes.setViewTextSize(holder.folderName, fontSizes.getFolderName()); if (K9.wrapFolderNames()) { holder.folderName.setEllipsize(null); @@ -1072,7 +1072,7 @@ public class FolderList extends K9ListActivity { holder.folderName.setEllipsize(TruncateAt.START); holder.folderName.setSingleLine(true); } - mFontSizes.setViewTextSize(holder.folderStatus, mFontSizes.getFolderStatus()); + fontSizes.setViewTextSize(holder.folderStatus, fontSizes.getFolderStatus()); return view; } diff --git a/k9mail/src/main/java/com/fsck/k9/activity/K9ListActivity.java b/k9mail/src/main/java/com/fsck/k9/activity/K9ListActivity.java index 11c16f0f5..df61923b8 100644 --- a/k9mail/src/main/java/com/fsck/k9/activity/K9ListActivity.java +++ b/k9mail/src/main/java/com/fsck/k9/activity/K9ListActivity.java @@ -14,17 +14,17 @@ import com.fsck.k9.activity.misc.SwipeGestureDetector.OnSwipeGestureListener; public abstract class K9ListActivity extends ListActivity implements K9ActivityMagic { - private K9ActivityCommon mBase; + private K9ActivityCommon base; @Override public void onCreate(Bundle savedInstanceState) { - mBase = K9ActivityCommon.newInstance(this); + base = K9ActivityCommon.newInstance(this); super.onCreate(savedInstanceState); } @Override public boolean dispatchTouchEvent(MotionEvent event) { - mBase.preDispatchTouchEvent(event); + base.preDispatchTouchEvent(event); return super.dispatchTouchEvent(event); } @@ -35,7 +35,7 @@ public abstract class K9ListActivity extends ListActivity implements K9ActivityM @Override public void setupGestureDetector(OnSwipeGestureListener listener) { - mBase.setupGestureDetector(listener); + base.setupGestureDetector(listener); } @Override diff --git a/k9mail/src/main/java/com/fsck/k9/activity/MessageList.java b/k9mail/src/main/java/com/fsck/k9/activity/MessageList.java index 33b2ccc9a..82b605113 100644 --- a/k9mail/src/main/java/com/fsck/k9/activity/MessageList.java +++ b/k9mail/src/main/java/com/fsck/k9/activity/MessageList.java @@ -149,50 +149,50 @@ public class MessageList extends K9Activity implements MessageListFragmentListen private StorageManager.StorageListener mStorageListener = new StorageListenerImplementation(); - private ActionBar mActionBar; - private View mActionBarMessageList; - private View mActionBarMessageView; - private MessageTitleView mActionBarSubject; - private TextView mActionBarTitle; - private TextView mActionBarSubTitle; - private TextView mActionBarUnread; - private Menu mMenu; + private ActionBar actionBar; + private View actionBarMessageList; + private View actionBarMessageView; + private MessageTitleView actionBarSubject; + private TextView actionBarTitle; + private TextView actionBarSubTitle; + private TextView actionBarUnread; + private Menu menu; - private ViewGroup mMessageViewContainer; - private View mMessageViewPlaceHolder; + private ViewGroup messageViewContainer; + private View messageViewPlaceHolder; - private MessageListFragment mMessageListFragment; - private MessageViewFragment mMessageViewFragment; - private int mFirstBackStackId = -1; + private MessageListFragment messageListFragment; + private MessageViewFragment messageViewFragment; + private int firstBackStackId = -1; - private Account mAccount; - private String mFolderName; - private LocalSearch mSearch; - private boolean mSingleFolderMode; - private boolean mSingleAccountMode; + private Account account; + private String folderName; + private LocalSearch search; + private boolean singleFolderMode; + private boolean singleAccountMode; - private ProgressBar mActionBarProgress; - private MenuItem mMenuButtonCheckMail; - private View mActionButtonIndeterminateProgress; - private int mLastDirection = (K9.messageViewShowNext()) ? NEXT : PREVIOUS; + private ProgressBar actionBarProgress; + private MenuItem menuButtonCheckMail; + private View actionButtonIndeterminateProgress; + private int lastDirection = (K9.messageViewShowNext()) ? NEXT : PREVIOUS; /** * {@code true} if the message list should be displayed as flat list (i.e. no threading) * regardless whether or not message threading was enabled in the settings. This is used for * filtered views, e.g. when only displaying the unread messages in a folder. */ - private boolean mNoThreading; + private boolean noThreading; - private DisplayMode mDisplayMode; - private MessageReference mMessageReference; + private DisplayMode displayMode; + private MessageReference messageReference; /** * {@code true} when the message list was displayed once. This is used in * {@link #onBackPressed()} to decide whether to go from the message view to the message list or * finish the activity. */ - private boolean mMessageListWasDisplayed = false; - private ViewSwitcher mViewSwitcher; + private boolean messageListWasDisplayed = false; + private ViewSwitcher viewSwitcher; @Override @@ -208,12 +208,12 @@ public class MessageList extends K9Activity implements MessageListFragmentListen setContentView(R.layout.split_message_list); } else { setContentView(R.layout.message_list); - mViewSwitcher = (ViewSwitcher) findViewById(R.id.container); - mViewSwitcher.setFirstInAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_in_left)); - mViewSwitcher.setFirstOutAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_out_right)); - mViewSwitcher.setSecondInAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_in_right)); - mViewSwitcher.setSecondOutAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_out_left)); - mViewSwitcher.setOnSwitchCompleteListener(this); + viewSwitcher = (ViewSwitcher) findViewById(R.id.container); + viewSwitcher.setFirstInAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_in_left)); + viewSwitcher.setFirstOutAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_out_right)); + viewSwitcher.setSecondInAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_in_right)); + viewSwitcher.setSecondOutAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_out_left)); + viewSwitcher.setOnSwitchCompleteListener(this); } initializeActionBar(); @@ -247,17 +247,17 @@ public class MessageList extends K9Activity implements MessageListFragmentListen setIntent(intent); - if (mFirstBackStackId >= 0) { - getFragmentManager().popBackStackImmediate(mFirstBackStackId, + if (firstBackStackId >= 0) { + getFragmentManager().popBackStackImmediate(firstBackStackId, FragmentManager.POP_BACK_STACK_INCLUSIVE); - mFirstBackStackId = -1; + firstBackStackId = -1; } removeMessageListFragment(); removeMessageViewFragment(); - mMessageReference = null; - mSearch = null; - mFolderName = null; + messageReference = null; + search = null; + folderName = null; if (!decodeExtras(intent)) { return; @@ -273,9 +273,9 @@ public class MessageList extends K9Activity implements MessageListFragmentListen */ private void findFragments() { FragmentManager fragmentManager = getFragmentManager(); - mMessageListFragment = (MessageListFragment) fragmentManager.findFragmentById( + messageListFragment = (MessageListFragment) fragmentManager.findFragmentById( R.id.message_list_container); - mMessageViewFragment = (MessageViewFragment) fragmentManager.findFragmentById( + messageViewFragment = (MessageViewFragment) fragmentManager.findFragmentById( R.id.message_view_container); } @@ -288,21 +288,21 @@ public class MessageList extends K9Activity implements MessageListFragmentListen FragmentManager fragmentManager = getFragmentManager(); fragmentManager.addOnBackStackChangedListener(this); - boolean hasMessageListFragment = (mMessageListFragment != null); + boolean hasMessageListFragment = (messageListFragment != null); if (!hasMessageListFragment) { FragmentTransaction ft = fragmentManager.beginTransaction(); - mMessageListFragment = MessageListFragment.newInstance(mSearch, false, - (K9.isThreadedViewEnabled() && !mNoThreading)); - ft.add(R.id.message_list_container, mMessageListFragment); + messageListFragment = MessageListFragment.newInstance(search, false, + (K9.isThreadedViewEnabled() && !noThreading)); + ft.add(R.id.message_list_container, messageListFragment); ft.commit(); } // Check if the fragment wasn't restarted and has a MessageReference in the arguments. If // so, open the referenced message. - if (!hasMessageListFragment && mMessageViewFragment == null && - mMessageReference != null) { - openMessage(mMessageReference); + if (!hasMessageListFragment && messageViewFragment == null && + messageReference != null) { + openMessage(messageReference); } } @@ -320,7 +320,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen */ private void initializeDisplayMode(Bundle savedInstanceState) { if (useSplitView()) { - mDisplayMode = DisplayMode.SPLIT_VIEW; + displayMode = DisplayMode.SPLIT_VIEW; return; } @@ -328,15 +328,15 @@ public class MessageList extends K9Activity implements MessageListFragmentListen DisplayMode savedDisplayMode = (DisplayMode) savedInstanceState.getSerializable(STATE_DISPLAY_MODE); if (savedDisplayMode != DisplayMode.SPLIT_VIEW) { - mDisplayMode = savedDisplayMode; + displayMode = savedDisplayMode; return; } } - if (mMessageViewFragment != null || mMessageReference != null) { - mDisplayMode = DisplayMode.MESSAGE_VIEW; + if (messageViewFragment != null || messageReference != null) { + displayMode = DisplayMode.MESSAGE_VIEW; } else { - mDisplayMode = DisplayMode.MESSAGE_LIST; + displayMode = DisplayMode.MESSAGE_LIST; } } @@ -350,14 +350,14 @@ public class MessageList extends K9Activity implements MessageListFragmentListen } private void initializeLayout() { - mMessageViewContainer = (ViewGroup) findViewById(R.id.message_view_container); + messageViewContainer = (ViewGroup) findViewById(R.id.message_view_container); LayoutInflater layoutInflater = getLayoutInflater(); - mMessageViewPlaceHolder = layoutInflater.inflate(R.layout.empty_message_view, mMessageViewContainer, false); + messageViewPlaceHolder = layoutInflater.inflate(R.layout.empty_message_view, messageViewContainer, false); } private void displayViews() { - switch (mDisplayMode) { + switch (displayMode) { case MESSAGE_LIST: { showMessageList(); break; @@ -367,13 +367,13 @@ public class MessageList extends K9Activity implements MessageListFragmentListen break; } case SPLIT_VIEW: { - mMessageListWasDisplayed = true; - if (mMessageViewFragment == null) { + messageListWasDisplayed = true; + if (messageViewFragment == null) { showMessageViewPlaceHolder(); } else { - MessageReference activeMessage = mMessageViewFragment.getMessageReference(); + MessageReference activeMessage = messageViewFragment.getMessageReference(); if (activeMessage != null) { - mMessageListFragment.setActiveMessage(activeMessage); + messageListFragment.setActiveMessage(activeMessage); } } break; @@ -393,7 +393,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen if (String.valueOf(account.getAccountNumber()).equals(accountId)) { String folderName = segmentList.get(1); String messageUid = segmentList.get(2); - mMessageReference = new MessageReference(account.getUuid(), folderName, messageUid, null); + messageReference = new MessageReference(account.getUuid(), folderName, messageUid, null); break; } } @@ -401,9 +401,9 @@ public class MessageList extends K9Activity implements MessageListFragmentListen // Handle shortcut intents String specialFolder = intent.getStringExtra(EXTRA_SPECIAL_FOLDER); if (SearchAccount.UNIFIED_INBOX.equals(specialFolder)) { - mSearch = SearchAccount.createUnifiedInboxAccount(this).getRelatedSearch(); + search = SearchAccount.createUnifiedInboxAccount(this).getRelatedSearch(); } else if (SearchAccount.ALL_MESSAGES.equals(specialFolder)) { - mSearch = SearchAccount.createAllMessagesAccount(this).getRelatedSearch(); + search = SearchAccount.createAllMessagesAccount(this).getRelatedSearch(); } } else if (intent.getStringExtra(SearchManager.QUERY) != null) { // check if this intent comes from the system search ( remote ) @@ -411,84 +411,84 @@ public class MessageList extends K9Activity implements MessageListFragmentListen //Query was received from Search Dialog String query = intent.getStringExtra(SearchManager.QUERY).trim(); - mSearch = new LocalSearch(getString(R.string.search_results)); - mSearch.setManualSearch(true); - mNoThreading = true; + search = new LocalSearch(getString(R.string.search_results)); + search.setManualSearch(true); + noThreading = true; - mSearch.or(new SearchCondition(SearchField.SENDER, Attribute.CONTAINS, query)); - mSearch.or(new SearchCondition(SearchField.SUBJECT, Attribute.CONTAINS, query)); - mSearch.or(new SearchCondition(SearchField.MESSAGE_CONTENTS, Attribute.CONTAINS, query)); + search.or(new SearchCondition(SearchField.SENDER, Attribute.CONTAINS, query)); + search.or(new SearchCondition(SearchField.SUBJECT, Attribute.CONTAINS, query)); + search.or(new SearchCondition(SearchField.MESSAGE_CONTENTS, Attribute.CONTAINS, query)); Bundle appData = intent.getBundleExtra(SearchManager.APP_DATA); if (appData != null) { - mSearch.addAccountUuid(appData.getString(EXTRA_SEARCH_ACCOUNT)); + search.addAccountUuid(appData.getString(EXTRA_SEARCH_ACCOUNT)); // searches started from a folder list activity will provide an account, but no folder if (appData.getString(EXTRA_SEARCH_FOLDER) != null) { - mSearch.addAllowedFolder(appData.getString(EXTRA_SEARCH_FOLDER)); + search.addAllowedFolder(appData.getString(EXTRA_SEARCH_FOLDER)); } } else { - mSearch.addAccountUuid(LocalSearch.ALL_ACCOUNTS); + search.addAccountUuid(LocalSearch.ALL_ACCOUNTS); } } } else { // regular LocalSearch object was passed - mSearch = intent.hasExtra(EXTRA_SEARCH) ? + search = intent.hasExtra(EXTRA_SEARCH) ? ParcelableUtil.unmarshall(intent.getByteArrayExtra(EXTRA_SEARCH), LocalSearch.CREATOR) : null; - mNoThreading = intent.getBooleanExtra(EXTRA_NO_THREADING, false); + noThreading = intent.getBooleanExtra(EXTRA_NO_THREADING, false); } - if (mMessageReference == null) { + if (messageReference == null) { String messageReferenceString = intent.getStringExtra(EXTRA_MESSAGE_REFERENCE); - mMessageReference = MessageReference.parse(messageReferenceString); + messageReference = MessageReference.parse(messageReferenceString); } - if (mMessageReference != null) { - mSearch = new LocalSearch(); - mSearch.addAccountUuid(mMessageReference.getAccountUuid()); - mSearch.addAllowedFolder(mMessageReference.getFolderName()); + if (messageReference != null) { + search = new LocalSearch(); + search.addAccountUuid(messageReference.getAccountUuid()); + search.addAllowedFolder(messageReference.getFolderName()); } - if (mSearch == null) { + if (search == null) { // We've most likely been started by an old unread widget String accountUuid = intent.getStringExtra("account"); String folderName = intent.getStringExtra("folder"); - mSearch = new LocalSearch(folderName); - mSearch.addAccountUuid((accountUuid == null) ? "invalid" : accountUuid); + search = new LocalSearch(folderName); + search.addAccountUuid((accountUuid == null) ? "invalid" : accountUuid); if (folderName != null) { - mSearch.addAllowedFolder(folderName); + search.addAllowedFolder(folderName); } } Preferences prefs = Preferences.getPreferences(getApplicationContext()); - String[] accountUuids = mSearch.getAccountUuids(); - if (mSearch.searchAllAccounts()) { + String[] accountUuids = search.getAccountUuids(); + if (search.searchAllAccounts()) { List accounts = prefs.getAccounts(); - mSingleAccountMode = (accounts.size() == 1); - if (mSingleAccountMode) { - mAccount = accounts.get(0); + singleAccountMode = (accounts.size() == 1); + if (singleAccountMode) { + account = accounts.get(0); } } else { - mSingleAccountMode = (accountUuids.length == 1); - if (mSingleAccountMode) { - mAccount = prefs.getAccount(accountUuids[0]); + singleAccountMode = (accountUuids.length == 1); + if (singleAccountMode) { + account = prefs.getAccount(accountUuids[0]); } } - mSingleFolderMode = mSingleAccountMode && (mSearch.getFolderNames().size() == 1); + singleFolderMode = singleAccountMode && (search.getFolderNames().size() == 1); - if (mSingleAccountMode && (mAccount == null || !mAccount.isAvailable(this))) { + if (singleAccountMode && (account == null || !account.isAvailable(this))) { Timber.i("not opening MessageList of unavailable account"); onAccountUnavailable(); return false; } - if (mSingleFolderMode) { - mFolderName = mSearch.getFolderNames().get(0); + if (singleFolderMode) { + folderName = search.getFolderNames().get(0); } // now we know if we are in single account mode and need a subtitle - mActionBarSubTitle.setVisibility((!mSingleFolderMode) ? View.GONE : View.VISIBLE); + actionBarSubTitle.setVisibility((!singleFolderMode) ? View.GONE : View.VISIBLE); return true; } @@ -510,7 +510,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen Search.setActive(false); } - if (mAccount != null && !mAccount.isAvailable(this)) { + if (account != null && !account.isAvailable(this)) { onAccountUnavailable(); return; } @@ -521,36 +521,36 @@ public class MessageList extends K9Activity implements MessageListFragmentListen public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); - outState.putSerializable(STATE_DISPLAY_MODE, mDisplayMode); - outState.putBoolean(STATE_MESSAGE_LIST_WAS_DISPLAYED, mMessageListWasDisplayed); - outState.putInt(STATE_FIRST_BACK_STACK_ID, mFirstBackStackId); + outState.putSerializable(STATE_DISPLAY_MODE, displayMode); + outState.putBoolean(STATE_MESSAGE_LIST_WAS_DISPLAYED, messageListWasDisplayed); + outState.putInt(STATE_FIRST_BACK_STACK_ID, firstBackStackId); } @Override public void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); - mMessageListWasDisplayed = savedInstanceState.getBoolean(STATE_MESSAGE_LIST_WAS_DISPLAYED); - mFirstBackStackId = savedInstanceState.getInt(STATE_FIRST_BACK_STACK_ID); + messageListWasDisplayed = savedInstanceState.getBoolean(STATE_MESSAGE_LIST_WAS_DISPLAYED); + firstBackStackId = savedInstanceState.getInt(STATE_FIRST_BACK_STACK_ID); } private void initializeActionBar() { - mActionBar = getActionBar(); + actionBar = getActionBar(); - mActionBar.setDisplayShowCustomEnabled(true); - mActionBar.setCustomView(R.layout.actionbar_custom); + actionBar.setDisplayShowCustomEnabled(true); + actionBar.setCustomView(R.layout.actionbar_custom); - View customView = mActionBar.getCustomView(); - mActionBarMessageList = customView.findViewById(R.id.actionbar_message_list); - mActionBarMessageView = customView.findViewById(R.id.actionbar_message_view); - mActionBarSubject = (MessageTitleView) customView.findViewById(R.id.message_title_view); - mActionBarTitle = (TextView) customView.findViewById(R.id.actionbar_title_first); - mActionBarSubTitle = (TextView) customView.findViewById(R.id.actionbar_title_sub); - mActionBarUnread = (TextView) customView.findViewById(R.id.actionbar_unread_count); - mActionBarProgress = (ProgressBar) customView.findViewById(R.id.actionbar_progress); - mActionButtonIndeterminateProgress = getActionButtonIndeterminateProgress(); + View customView = actionBar.getCustomView(); + actionBarMessageList = customView.findViewById(R.id.actionbar_message_list); + actionBarMessageView = customView.findViewById(R.id.actionbar_message_view); + actionBarSubject = (MessageTitleView) customView.findViewById(R.id.message_title_view); + actionBarTitle = (TextView) customView.findViewById(R.id.actionbar_title_first); + actionBarSubTitle = (TextView) customView.findViewById(R.id.actionbar_title_sub); + actionBarUnread = (TextView) customView.findViewById(R.id.actionbar_unread_count); + actionBarProgress = (ProgressBar) customView.findViewById(R.id.actionbar_progress); + actionButtonIndeterminateProgress = getActionButtonIndeterminateProgress(); - mActionBar.setDisplayHomeAsUpEnabled(true); + actionBar.setDisplayHomeAsUpEnabled(true); } @SuppressLint("InflateParams") @@ -572,7 +572,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen @Override public void onBackPressed() { - if (mDisplayMode == DisplayMode.MESSAGE_VIEW && mMessageListWasDisplayed) { + if (displayMode == DisplayMode.MESSAGE_VIEW && messageListWasDisplayed) { showMessageList(); } else { super.onBackPressed(); @@ -597,142 +597,142 @@ public class MessageList extends K9Activity implements MessageListFragmentListen public boolean onCustomKeyDown(final int keyCode, final KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_VOLUME_UP: { - if (mMessageViewFragment != null && mDisplayMode != DisplayMode.MESSAGE_LIST && + if (messageViewFragment != null && displayMode != DisplayMode.MESSAGE_LIST && K9.useVolumeKeysForNavigationEnabled()) { showPreviousMessage(); return true; - } else if (mDisplayMode != DisplayMode.MESSAGE_VIEW && + } else if (displayMode != DisplayMode.MESSAGE_VIEW && K9.useVolumeKeysForListNavigationEnabled()) { - mMessageListFragment.onMoveUp(); + messageListFragment.onMoveUp(); return true; } break; } case KeyEvent.KEYCODE_VOLUME_DOWN: { - if (mMessageViewFragment != null && mDisplayMode != DisplayMode.MESSAGE_LIST && + if (messageViewFragment != null && displayMode != DisplayMode.MESSAGE_LIST && K9.useVolumeKeysForNavigationEnabled()) { showNextMessage(); return true; - } else if (mDisplayMode != DisplayMode.MESSAGE_VIEW && + } else if (displayMode != DisplayMode.MESSAGE_VIEW && K9.useVolumeKeysForListNavigationEnabled()) { - mMessageListFragment.onMoveDown(); + messageListFragment.onMoveDown(); return true; } break; } case KeyEvent.KEYCODE_C: { - mMessageListFragment.onCompose(); + messageListFragment.onCompose(); return true; } case KeyEvent.KEYCODE_Q: { - if (mMessageListFragment != null && mMessageListFragment.isSingleAccountMode()) { + if (messageListFragment != null && messageListFragment.isSingleAccountMode()) { onShowFolderList(); } return true; } case KeyEvent.KEYCODE_O: { - mMessageListFragment.onCycleSort(); + messageListFragment.onCycleSort(); return true; } case KeyEvent.KEYCODE_I: { - mMessageListFragment.onReverseSort(); + messageListFragment.onReverseSort(); return true; } case KeyEvent.KEYCODE_DEL: case KeyEvent.KEYCODE_D: { - if (mDisplayMode == DisplayMode.MESSAGE_LIST) { - mMessageListFragment.onDelete(); - } else if (mMessageViewFragment != null) { - mMessageViewFragment.onDelete(); + if (displayMode == DisplayMode.MESSAGE_LIST) { + messageListFragment.onDelete(); + } else if (messageViewFragment != null) { + messageViewFragment.onDelete(); } return true; } case KeyEvent.KEYCODE_S: { - mMessageListFragment.toggleMessageSelect(); + messageListFragment.toggleMessageSelect(); return true; } case KeyEvent.KEYCODE_G: { - if (mDisplayMode == DisplayMode.MESSAGE_LIST) { - mMessageListFragment.onToggleFlagged(); - } else if (mMessageViewFragment != null) { - mMessageViewFragment.onToggleFlagged(); + if (displayMode == DisplayMode.MESSAGE_LIST) { + messageListFragment.onToggleFlagged(); + } else if (messageViewFragment != null) { + messageViewFragment.onToggleFlagged(); } return true; } case KeyEvent.KEYCODE_M: { - if (mDisplayMode == DisplayMode.MESSAGE_LIST) { - mMessageListFragment.onMove(); - } else if (mMessageViewFragment != null) { - mMessageViewFragment.onMove(); + if (displayMode == DisplayMode.MESSAGE_LIST) { + messageListFragment.onMove(); + } else if (messageViewFragment != null) { + messageViewFragment.onMove(); } return true; } case KeyEvent.KEYCODE_V: { - if (mDisplayMode == DisplayMode.MESSAGE_LIST) { - mMessageListFragment.onArchive(); - } else if (mMessageViewFragment != null) { - mMessageViewFragment.onArchive(); + if (displayMode == DisplayMode.MESSAGE_LIST) { + messageListFragment.onArchive(); + } else if (messageViewFragment != null) { + messageViewFragment.onArchive(); } return true; } case KeyEvent.KEYCODE_Y: { - if (mDisplayMode == DisplayMode.MESSAGE_LIST) { - mMessageListFragment.onCopy(); - } else if (mMessageViewFragment != null) { - mMessageViewFragment.onCopy(); + if (displayMode == DisplayMode.MESSAGE_LIST) { + messageListFragment.onCopy(); + } else if (messageViewFragment != null) { + messageViewFragment.onCopy(); } return true; } case KeyEvent.KEYCODE_Z: { - if (mDisplayMode == DisplayMode.MESSAGE_LIST) { - mMessageListFragment.onToggleRead(); - } else if (mMessageViewFragment != null) { - mMessageViewFragment.onToggleRead(); + if (displayMode == DisplayMode.MESSAGE_LIST) { + messageListFragment.onToggleRead(); + } else if (messageViewFragment != null) { + messageViewFragment.onToggleRead(); } return true; } case KeyEvent.KEYCODE_F: { - if (mMessageViewFragment != null) { - mMessageViewFragment.onForward(); + if (messageViewFragment != null) { + messageViewFragment.onForward(); } return true; } case KeyEvent.KEYCODE_A: { - if (mMessageViewFragment != null) { - mMessageViewFragment.onReplyAll(); + if (messageViewFragment != null) { + messageViewFragment.onReplyAll(); } return true; } case KeyEvent.KEYCODE_R: { - if (mMessageViewFragment != null) { - mMessageViewFragment.onReply(); + if (messageViewFragment != null) { + messageViewFragment.onReply(); } return true; } case KeyEvent.KEYCODE_J: case KeyEvent.KEYCODE_P: { - if (mMessageViewFragment != null) { + if (messageViewFragment != null) { showPreviousMessage(); } return true; } case KeyEvent.KEYCODE_N: case KeyEvent.KEYCODE_K: { - if (mMessageViewFragment != null) { + if (messageViewFragment != null) { showNextMessage(); } return true; } /* FIXME case KeyEvent.KEYCODE_Z: { - mMessageViewFragment.zoom(event); + messageViewFragment.zoom(event); return true; }*/ case KeyEvent.KEYCODE_H: { Toast toast; - if (mDisplayMode == DisplayMode.MESSAGE_LIST) { + if (displayMode == DisplayMode.MESSAGE_LIST) { toast = Toast.makeText(this, R.string.message_list_help_key, Toast.LENGTH_LONG); } else { toast = Toast.makeText(this, R.string.message_view_help_key, Toast.LENGTH_LONG); @@ -741,13 +741,13 @@ public class MessageList extends K9Activity implements MessageListFragmentListen return true; } case KeyEvent.KEYCODE_DPAD_LEFT: { - if (mMessageViewFragment != null && mDisplayMode == DisplayMode.MESSAGE_VIEW) { + if (messageViewFragment != null && displayMode == DisplayMode.MESSAGE_VIEW) { return showPreviousMessage(); } return false; } case KeyEvent.KEYCODE_DPAD_RIGHT: { - if (mMessageViewFragment != null && mDisplayMode == DisplayMode.MESSAGE_VIEW) { + if (messageViewFragment != null && displayMode == DisplayMode.MESSAGE_VIEW) { return showNextMessage(); } return false; @@ -776,7 +776,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen } private void onShowFolderList() { - FolderList.actionHandleAccount(this, mAccount); + FolderList.actionHandleAccount(this, account); finish(); } @@ -785,12 +785,12 @@ public class MessageList extends K9Activity implements MessageListFragmentListen } private void onEditAccount() { - AccountSettings.actionSettings(this, mAccount); + AccountSettings.actionSettings(this, account); } @Override public boolean onSearchRequested() { - return mMessageListFragment.onSearchRequested(); + return messageListFragment.onSearchRequested(); } @Override @@ -802,7 +802,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen return true; } case R.id.compose: { - mMessageListFragment.onCompose(); + messageListFragment.onCompose(); return true; } case R.id.toggle_message_view_theme: { @@ -811,39 +811,39 @@ public class MessageList extends K9Activity implements MessageListFragmentListen } // MessageList case R.id.check_mail: { - mMessageListFragment.checkMail(); + messageListFragment.checkMail(); return true; } case R.id.set_sort_date: { - mMessageListFragment.changeSort(SortType.SORT_DATE); + messageListFragment.changeSort(SortType.SORT_DATE); return true; } case R.id.set_sort_arrival: { - mMessageListFragment.changeSort(SortType.SORT_ARRIVAL); + messageListFragment.changeSort(SortType.SORT_ARRIVAL); return true; } case R.id.set_sort_subject: { - mMessageListFragment.changeSort(SortType.SORT_SUBJECT); + messageListFragment.changeSort(SortType.SORT_SUBJECT); return true; } case R.id.set_sort_sender: { - mMessageListFragment.changeSort(SortType.SORT_SENDER); + messageListFragment.changeSort(SortType.SORT_SENDER); return true; } case R.id.set_sort_flag: { - mMessageListFragment.changeSort(SortType.SORT_FLAGGED); + messageListFragment.changeSort(SortType.SORT_FLAGGED); return true; } case R.id.set_sort_unread: { - mMessageListFragment.changeSort(SortType.SORT_UNREAD); + messageListFragment.changeSort(SortType.SORT_UNREAD); return true; } case R.id.set_sort_attach: { - mMessageListFragment.changeSort(SortType.SORT_ATTACHMENT); + messageListFragment.changeSort(SortType.SORT_ATTACHMENT); return true; } case R.id.select_all: { - mMessageListFragment.selectAll(); + messageListFragment.selectAll(); return true; } case R.id.app_settings: { @@ -855,15 +855,15 @@ public class MessageList extends K9Activity implements MessageListFragmentListen return true; } case R.id.search: { - mMessageListFragment.onSearchRequested(); + messageListFragment.onSearchRequested(); return true; } case R.id.search_remote: { - mMessageListFragment.onRemoteSearch(); + messageListFragment.onRemoteSearch(); return true; } case R.id.mark_all_as_read: { - mMessageListFragment.confirmMarkAllAsRead(); + messageListFragment.confirmMarkAllAsRead(); return true; } case R.id.show_folder_list: { @@ -880,66 +880,66 @@ public class MessageList extends K9Activity implements MessageListFragmentListen return true; } case R.id.delete: { - mMessageViewFragment.onDelete(); + messageViewFragment.onDelete(); return true; } case R.id.reply: { - mMessageViewFragment.onReply(); + messageViewFragment.onReply(); return true; } case R.id.reply_all: { - mMessageViewFragment.onReplyAll(); + messageViewFragment.onReplyAll(); return true; } case R.id.forward: { - mMessageViewFragment.onForward(); + messageViewFragment.onForward(); return true; } case R.id.forward_as_attachment: { - mMessageViewFragment.onForwardAsAttachment(); + messageViewFragment.onForwardAsAttachment(); return true; } case R.id.share: { - mMessageViewFragment.onSendAlternate(); + messageViewFragment.onSendAlternate(); return true; } case R.id.toggle_unread: { - mMessageViewFragment.onToggleRead(); + messageViewFragment.onToggleRead(); return true; } case R.id.archive: case R.id.refile_archive: { - mMessageViewFragment.onArchive(); + messageViewFragment.onArchive(); return true; } case R.id.spam: case R.id.refile_spam: { - mMessageViewFragment.onSpam(); + messageViewFragment.onSpam(); return true; } case R.id.move: case R.id.refile_move: { - mMessageViewFragment.onMove(); + messageViewFragment.onMove(); return true; } case R.id.copy: case R.id.refile_copy: { - mMessageViewFragment.onCopy(); + messageViewFragment.onCopy(); return true; } case R.id.select_text: { - mMessageViewFragment.onSelectText(); + messageViewFragment.onSelectText(); return true; } case R.id.show_headers: case R.id.hide_headers: { - mMessageViewFragment.onToggleAllHeadersView(); + messageViewFragment.onToggleAllHeadersView(); updateMenu(); return true; } } - if (!mSingleFolderMode) { + if (!singleFolderMode) { // None of the options after this point are "safe" for search results //TODO: This is not true for "unread" and "starred" searches in regular folders return false; @@ -947,17 +947,17 @@ public class MessageList extends K9Activity implements MessageListFragmentListen switch (itemId) { case R.id.send_messages: { - mMessageListFragment.onSendPendingMessages(); + messageListFragment.onSendPendingMessages(); return true; } case R.id.folder_settings: { - if (mFolderName != null) { - FolderSettings.actionSettings(this, mAccount, mFolderName); + if (folderName != null) { + FolderSettings.actionSettings(this, account, folderName); } return true; } case R.id.expunge: { - mMessageListFragment.onExpunge(); + messageListFragment.onExpunge(); return true; } default: { @@ -969,8 +969,8 @@ public class MessageList extends K9Activity implements MessageListFragmentListen @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.message_list_option, menu); - mMenu = menu; - mMenuButtonCheckMail= menu.findItem(R.id.check_mail); + this.menu = menu; + menuButtonCheckMail = menu.findItem(R.id.check_mail); return true; } @@ -999,23 +999,23 @@ public class MessageList extends K9Activity implements MessageListFragmentListen } // Set visibility of account/folder settings menu items - if (mMessageListFragment == null) { + if (messageListFragment == null) { menu.findItem(R.id.account_settings).setVisible(false); menu.findItem(R.id.folder_settings).setVisible(false); } else { menu.findItem(R.id.account_settings).setVisible( - mMessageListFragment.isSingleAccountMode()); + messageListFragment.isSingleAccountMode()); menu.findItem(R.id.folder_settings).setVisible( - mMessageListFragment.isSingleFolderMode()); + messageListFragment.isSingleFolderMode()); } /* * Set visibility of menu items related to the message view */ - if (mDisplayMode == DisplayMode.MESSAGE_LIST - || mMessageViewFragment == null - || !mMessageViewFragment.isInitialized()) { + if (displayMode == DisplayMode.MESSAGE_LIST + || messageViewFragment == null + || !messageViewFragment.isInitialized()) { menu.findItem(R.id.next_message).setVisible(false); menu.findItem(R.id.previous_message).setVisible(false); menu.findItem(R.id.single_message_options).setVisible(false); @@ -1033,15 +1033,15 @@ public class MessageList extends K9Activity implements MessageListFragmentListen menu.findItem(R.id.hide_headers).setVisible(false); } else { // hide prev/next buttons in split mode - if (mDisplayMode != DisplayMode.MESSAGE_VIEW) { + if (displayMode != DisplayMode.MESSAGE_VIEW) { menu.findItem(R.id.next_message).setVisible(false); menu.findItem(R.id.previous_message).setVisible(false); } else { - MessageReference ref = mMessageViewFragment.getMessageReference(); - boolean initialized = (mMessageListFragment != null && - mMessageListFragment.isLoadFinished()); - boolean canDoPrev = (initialized && !mMessageListFragment.isFirst(ref)); - boolean canDoNext = (initialized && !mMessageListFragment.isLast(ref)); + MessageReference ref = messageViewFragment.getMessageReference(); + boolean initialized = (messageListFragment != null && + messageListFragment.isLoadFinished()); + boolean canDoPrev = (initialized && !messageListFragment.isFirst(ref)); + boolean canDoNext = (initialized && !messageListFragment.isLast(ref)); MenuItem prev = menu.findItem(R.id.previous_message); prev.setEnabled(canDoPrev); @@ -1066,7 +1066,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen } // Set title of menu item to toggle the read state of the currently displayed message - if (mMessageViewFragment.isMessageRead()) { + if (messageViewFragment.isMessageRead()) { menu.findItem(R.id.toggle_unread).setTitle(R.string.mark_as_unread_action); } else { menu.findItem(R.id.toggle_unread).setTitle(R.string.mark_as_read_action); @@ -1080,7 +1080,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen /* * Set visibility of copy, move, archive, spam in action bar and refile submenu */ - if (mMessageViewFragment.isCopyCapable()) { + if (messageViewFragment.isCopyCapable()) { menu.findItem(R.id.copy).setVisible(K9.isMessageViewCopyActionVisible()); menu.findItem(R.id.refile_copy).setVisible(true); } else { @@ -1088,9 +1088,9 @@ public class MessageList extends K9Activity implements MessageListFragmentListen menu.findItem(R.id.refile_copy).setVisible(false); } - if (mMessageViewFragment.isMoveCapable()) { - boolean canMessageBeArchived = mMessageViewFragment.canMessageBeArchived(); - boolean canMessageBeMovedToSpam = mMessageViewFragment.canMessageBeMovedToSpam(); + if (messageViewFragment.isMoveCapable()) { + boolean canMessageBeArchived = messageViewFragment.canMessageBeArchived(); + boolean canMessageBeMovedToSpam = messageViewFragment.canMessageBeMovedToSpam(); menu.findItem(R.id.move).setVisible(K9.isMessageViewMoveActionVisible()); menu.findItem(R.id.archive).setVisible(canMessageBeArchived && @@ -1109,7 +1109,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen menu.findItem(R.id.refile).setVisible(false); } - if (mMessageViewFragment.allHeadersVisible()) { + if (messageViewFragment.allHeadersVisible()) { menu.findItem(R.id.show_headers).setVisible(false); } else { menu.findItem(R.id.hide_headers).setVisible(false); @@ -1125,8 +1125,8 @@ public class MessageList extends K9Activity implements MessageListFragmentListen menu.findItem(R.id.search).setVisible(false); menu.findItem(R.id.search_remote).setVisible(false); - if (mDisplayMode == DisplayMode.MESSAGE_VIEW || mMessageListFragment == null || - !mMessageListFragment.isInitialized()) { + if (displayMode == DisplayMode.MESSAGE_VIEW || messageListFragment == null || + !messageListFragment.isInitialized()) { menu.findItem(R.id.check_mail).setVisible(false); menu.findItem(R.id.set_sort).setVisible(false); menu.findItem(R.id.select_all).setVisible(false); @@ -1139,26 +1139,26 @@ public class MessageList extends K9Activity implements MessageListFragmentListen menu.findItem(R.id.select_all).setVisible(true); menu.findItem(R.id.compose).setVisible(true); menu.findItem(R.id.mark_all_as_read).setVisible( - mMessageListFragment.isMarkAllAsReadSupported()); + messageListFragment.isMarkAllAsReadSupported()); - if (!mMessageListFragment.isSingleAccountMode()) { + if (!messageListFragment.isSingleAccountMode()) { menu.findItem(R.id.expunge).setVisible(false); menu.findItem(R.id.send_messages).setVisible(false); menu.findItem(R.id.show_folder_list).setVisible(false); } else { - menu.findItem(R.id.send_messages).setVisible(mMessageListFragment.isOutbox()); - menu.findItem(R.id.expunge).setVisible(mMessageListFragment.isRemoteFolder() && - mMessageListFragment.isAccountExpungeCapable()); + menu.findItem(R.id.send_messages).setVisible(messageListFragment.isOutbox()); + menu.findItem(R.id.expunge).setVisible(messageListFragment.isRemoteFolder() && + messageListFragment.isAccountExpungeCapable()); menu.findItem(R.id.show_folder_list).setVisible(true); } - menu.findItem(R.id.check_mail).setVisible(mMessageListFragment.isCheckMailSupported()); + menu.findItem(R.id.check_mail).setVisible(messageListFragment.isCheckMailSupported()); // If this is an explicit local search, show the option to search on the server - if (!mMessageListFragment.isRemoteSearch() && - mMessageListFragment.isRemoteSearchAllowed()) { + if (!messageListFragment.isRemoteSearch() && + messageListFragment.isRemoteSearchAllowed()) { menu.findItem(R.id.search_remote).setVisible(true); - } else if (!mMessageListFragment.isManualSearch()) { + } else if (!messageListFragment.isManualSearch()) { menu.findItem(R.id.search).setVisible(true); } } @@ -1171,19 +1171,19 @@ public class MessageList extends K9Activity implements MessageListFragmentListen } public void setActionBarTitle(String title) { - mActionBarTitle.setText(title); + actionBarTitle.setText(title); } public void setActionBarSubTitle(String subTitle) { - mActionBarSubTitle.setText(subTitle); + actionBarSubTitle.setText(subTitle); } public void setActionBarUnread(int unread) { if (unread == 0) { - mActionBarUnread.setVisibility(View.GONE); + actionBarUnread.setVisibility(View.GONE); } else { - mActionBarUnread.setVisibility(View.VISIBLE); - mActionBarUnread.setText(String.format("%d", unread)); + actionBarUnread.setVisibility(View.VISIBLE); + actionBarUnread.setText(String.format("%d", unread)); } } @@ -1216,19 +1216,19 @@ public class MessageList extends K9Activity implements MessageListFragmentListen if (folderName.equals(account.getDraftsFolderName())) { MessageActions.actionEditDraft(this, messageReference); } else { - mMessageViewContainer.removeView(mMessageViewPlaceHolder); + messageViewContainer.removeView(messageViewPlaceHolder); - if (mMessageListFragment != null) { - mMessageListFragment.setActiveMessage(messageReference); + if (messageListFragment != null) { + messageListFragment.setActiveMessage(messageReference); } MessageViewFragment fragment = MessageViewFragment.newInstance(messageReference); FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.replace(R.id.message_view_container, fragment); - mMessageViewFragment = fragment; + messageViewFragment = fragment; ft.commit(); - if (mDisplayMode != DisplayMode.SPLIT_VIEW) { + if (displayMode != DisplayMode.SPLIT_VIEW) { showMessageView(); } } @@ -1287,7 +1287,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen @Override public void showMoreFromSameSender(String senderAddress) { LocalSearch tmpSearch = new LocalSearch(getString(R.string.search_from_format, senderAddress)); - tmpSearch.addAccountUuids(mSearch.getAccountUuids()); + tmpSearch.addAccountUuids(search.getAccountUuids()); tmpSearch.and(SearchField.SENDER, senderAddress, Attribute.CONTAINS); MessageListFragment fragment = MessageListFragment.newInstance(tmpSearch, false, false); @@ -1299,31 +1299,31 @@ public class MessageList extends K9Activity implements MessageListFragmentListen public void onBackStackChanged() { findFragments(); - if (mDisplayMode == DisplayMode.SPLIT_VIEW) { + if (displayMode == DisplayMode.SPLIT_VIEW) { showMessageViewPlaceHolder(); } - configureMenu(mMenu); + configureMenu(menu); } @Override public void onSwipeRightToLeft(MotionEvent e1, MotionEvent e2) { - if (mMessageListFragment != null && mDisplayMode != DisplayMode.MESSAGE_VIEW) { - mMessageListFragment.onSwipeRightToLeft(e1, e2); + if (messageListFragment != null && displayMode != DisplayMode.MESSAGE_VIEW) { + messageListFragment.onSwipeRightToLeft(e1, e2); } } @Override public void onSwipeLeftToRight(MotionEvent e1, MotionEvent e2) { - if (mMessageListFragment != null && mDisplayMode != DisplayMode.MESSAGE_VIEW) { - mMessageListFragment.onSwipeLeftToRight(e1, e2); + if (messageListFragment != null && displayMode != DisplayMode.MESSAGE_VIEW) { + messageListFragment.onSwipeLeftToRight(e1, e2); } } private final class StorageListenerImplementation implements StorageManager.StorageListener { @Override public void onUnmount(String providerId) { - if (mAccount != null && providerId.equals(mAccount.getLocalStorageProviderId())) { + if (account != null && providerId.equals(account.getLocalStorageProviderId())) { runOnUiThread(new Runnable() { @Override public void run() { @@ -1346,11 +1346,11 @@ public class MessageList extends K9Activity implements MessageListFragmentListen if (addToBackStack) ft.addToBackStack(null); - mMessageListFragment = fragment; + messageListFragment = fragment; int transactionId = ft.commit(); - if (transactionId >= 0 && mFirstBackStackId < 0) { - mFirstBackStackId = transactionId; + if (transactionId >= 0 && firstBackStackId < 0) { + firstBackStackId = transactionId; } } @@ -1387,21 +1387,21 @@ public class MessageList extends K9Activity implements MessageListFragmentListen removeMessageViewFragment(); // Add placeholder view if necessary - if (mMessageViewPlaceHolder.getParent() == null) { - mMessageViewContainer.addView(mMessageViewPlaceHolder); + if (messageViewPlaceHolder.getParent() == null) { + messageViewContainer.addView(messageViewPlaceHolder); } - mMessageListFragment.setActiveMessage(null); + messageListFragment.setActiveMessage(null); } /** * Remove MessageViewFragment if necessary. */ private void removeMessageViewFragment() { - if (mMessageViewFragment != null) { + if (messageViewFragment != null) { FragmentTransaction ft = getFragmentManager().beginTransaction(); - ft.remove(mMessageViewFragment); - mMessageViewFragment = null; + ft.remove(messageViewFragment); + messageViewFragment = null; ft.commit(); showDefaultTitleView(); @@ -1410,27 +1410,27 @@ public class MessageList extends K9Activity implements MessageListFragmentListen private void removeMessageListFragment() { FragmentTransaction ft = getFragmentManager().beginTransaction(); - ft.remove(mMessageListFragment); - mMessageListFragment = null; + ft.remove(messageListFragment); + messageListFragment = null; ft.commit(); } @Override public void remoteSearchStarted() { // Remove action button for remote search - configureMenu(mMenu); + configureMenu(menu); } @Override public void goBack() { FragmentManager fragmentManager = getFragmentManager(); - if (mDisplayMode == DisplayMode.MESSAGE_VIEW) { + if (displayMode == DisplayMode.MESSAGE_VIEW) { showMessageList(); } else if (fragmentManager.getBackStackEntryCount() > 0) { fragmentManager.popBackStack(); - } else if (mMessageListFragment.isManualSearch()) { + } else if (messageListFragment.isManualSearch()) { finish(); - } else if (!mSingleFolderMode) { + } else if (!singleFolderMode) { onAccounts(); } else { onShowFolderList(); @@ -1439,38 +1439,38 @@ public class MessageList extends K9Activity implements MessageListFragmentListen @Override public void enableActionBarProgress(boolean enable) { - if (mMenuButtonCheckMail != null && mMenuButtonCheckMail.isVisible()) { - mActionBarProgress.setVisibility(ProgressBar.GONE); + if (menuButtonCheckMail != null && menuButtonCheckMail.isVisible()) { + actionBarProgress.setVisibility(ProgressBar.GONE); if (enable) { - mMenuButtonCheckMail - .setActionView(mActionButtonIndeterminateProgress); + menuButtonCheckMail + .setActionView(actionButtonIndeterminateProgress); } else { - mMenuButtonCheckMail.setActionView(null); + menuButtonCheckMail.setActionView(null); } } else { - if (mMenuButtonCheckMail != null) - mMenuButtonCheckMail.setActionView(null); + if (menuButtonCheckMail != null) + menuButtonCheckMail.setActionView(null); if (enable) { - mActionBarProgress.setVisibility(ProgressBar.VISIBLE); + actionBarProgress.setVisibility(ProgressBar.VISIBLE); } else { - mActionBarProgress.setVisibility(ProgressBar.GONE); + actionBarProgress.setVisibility(ProgressBar.GONE); } } } @Override public void displayMessageSubject(String subject) { - if (mDisplayMode == DisplayMode.MESSAGE_VIEW) { - mActionBarSubject.setText(subject); + if (displayMode == DisplayMode.MESSAGE_VIEW) { + actionBarSubject.setText(subject); } else { - mActionBarSubject.showSubjectInMessageHeader(); + actionBarSubject.showSubjectInMessageHeader(); } } @Override public void showNextMessageOrReturn() { if (K9.messageViewReturnToList() || !showLogicalNextMessage()) { - if (mDisplayMode == DisplayMode.SPLIT_VIEW) { + if (displayMode == DisplayMode.SPLIT_VIEW) { showMessageViewPlaceHolder(); } else { showMessageList(); @@ -1485,9 +1485,9 @@ public class MessageList extends K9Activity implements MessageListFragmentListen */ private boolean showLogicalNextMessage() { boolean result = false; - if (mLastDirection == NEXT) { + if (lastDirection == NEXT) { result = showNextMessage(); - } else if (mLastDirection == PREVIOUS) { + } else if (lastDirection == PREVIOUS) { result = showPreviousMessage(); } @@ -1505,14 +1505,14 @@ public class MessageList extends K9Activity implements MessageListFragmentListen @Override public void messageHeaderViewAvailable(MessageHeader header) { - mActionBarSubject.setMessageHeader(header); + actionBarSubject.setMessageHeader(header); } private boolean showNextMessage() { - MessageReference ref = mMessageViewFragment.getMessageReference(); + MessageReference ref = messageViewFragment.getMessageReference(); if (ref != null) { - if (mMessageListFragment.openNext(ref)) { - mLastDirection = NEXT; + if (messageListFragment.openNext(ref)) { + lastDirection = NEXT; return true; } } @@ -1520,10 +1520,10 @@ public class MessageList extends K9Activity implements MessageListFragmentListen } private boolean showPreviousMessage() { - MessageReference ref = mMessageViewFragment.getMessageReference(); + MessageReference ref = messageViewFragment.getMessageReference(); if (ref != null) { - if (mMessageListFragment.openPrevious(ref)) { - mLastDirection = PREVIOUS; + if (messageListFragment.openPrevious(ref)) { + lastDirection = PREVIOUS; return true; } } @@ -1531,26 +1531,26 @@ public class MessageList extends K9Activity implements MessageListFragmentListen } private void showMessageList() { - mMessageListWasDisplayed = true; - mDisplayMode = DisplayMode.MESSAGE_LIST; - mViewSwitcher.showFirstView(); + messageListWasDisplayed = true; + displayMode = DisplayMode.MESSAGE_LIST; + viewSwitcher.showFirstView(); - mMessageListFragment.setActiveMessage(null); + messageListFragment.setActiveMessage(null); showDefaultTitleView(); - configureMenu(mMenu); + configureMenu(menu); } private void showMessageView() { - mDisplayMode = DisplayMode.MESSAGE_VIEW; + displayMode = DisplayMode.MESSAGE_VIEW; - if (!mMessageListWasDisplayed) { - mViewSwitcher.setAnimateFirstView(false); + if (!messageListWasDisplayed) { + viewSwitcher.setAnimateFirstView(false); } - mViewSwitcher.showSecondView(); + viewSwitcher.showSecondView(); showMessageTitleView(); - configureMenu(mMenu); + configureMenu(menu); } @Override @@ -1560,7 +1560,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen @Override public void disableDeleteAction() { - mMenu.findItem(R.id.delete).setEnabled(false); + menu.findItem(R.id.delete).setEnabled(false); } private void onToggleTheme() { @@ -1585,23 +1585,23 @@ public class MessageList extends K9Activity implements MessageListFragmentListen } private void showDefaultTitleView() { - mActionBarMessageView.setVisibility(View.GONE); - mActionBarMessageList.setVisibility(View.VISIBLE); + actionBarMessageView.setVisibility(View.GONE); + actionBarMessageList.setVisibility(View.VISIBLE); - if (mMessageListFragment != null) { - mMessageListFragment.updateTitle(); + if (messageListFragment != null) { + messageListFragment.updateTitle(); } - mActionBarSubject.setMessageHeader(null); + actionBarSubject.setMessageHeader(null); } private void showMessageTitleView() { - mActionBarMessageList.setVisibility(View.GONE); - mActionBarMessageView.setVisibility(View.VISIBLE); + actionBarMessageList.setVisibility(View.GONE); + actionBarMessageView.setVisibility(View.VISIBLE); - if (mMessageViewFragment != null) { + if (messageViewFragment != null) { displayMessageSubject(null); - mMessageViewFragment.updateTitle(); + messageViewFragment.updateTitle(); } } @@ -1625,8 +1625,8 @@ public class MessageList extends K9Activity implements MessageListFragmentListen if ((requestCode & REQUEST_MASK_PENDING_INTENT) == REQUEST_MASK_PENDING_INTENT) { requestCode ^= REQUEST_MASK_PENDING_INTENT; - if (mMessageViewFragment != null) { - mMessageViewFragment.onPendingIntentResult(requestCode, resultCode, data); + if (messageViewFragment != null) { + messageViewFragment.onPendingIntentResult(requestCode, resultCode, data); } } }