summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/mail/ui/AbstractActivityController.java50
-rw-r--r--src/com/android/mail/ui/ActivityController.java47
-rw-r--r--src/com/android/mail/ui/ControllableActivity.java8
-rw-r--r--src/com/android/mail/ui/FolderChangeListener.java33
-rw-r--r--src/com/android/mail/ui/FolderSelectionActivity.java16
-rw-r--r--src/com/android/mail/ui/MailActivity.java6
-rw-r--r--src/com/android/mail/ui/OnePaneController.java5
-rw-r--r--src/com/android/mail/ui/TwoPaneController.java15
8 files changed, 26 insertions, 154 deletions
diff --git a/src/com/android/mail/ui/AbstractActivityController.java b/src/com/android/mail/ui/AbstractActivityController.java
index 71f0144e1..acc207600 100644
--- a/src/com/android/mail/ui/AbstractActivityController.java
+++ b/src/com/android/mail/ui/AbstractActivityController.java
@@ -536,12 +536,10 @@ public abstract class AbstractActivityController implements ActivityController,
mConversationListLoadFinishedIgnored = false;
}
- @Override
public Account getCurrentAccount() {
return mAccount;
}
- @Override
public ConversationListContext getCurrentListContext() {
return mConvListContext;
}
@@ -868,8 +866,7 @@ public abstract class AbstractActivityController implements ActivityController,
mActivity.getLoaderManager().restartLoader(LOADER_SEARCH, args, mFolderCallbacks);
}
- @Override
- public void onFolderChanged(Folder folder, final boolean force) {
+ protected void onFolderChanged(Folder folder, final boolean force) {
if (isDrawerEnabled()) {
/** If the folder doesn't exist, or its parent URI is empty,
* this is not a child folder */
@@ -963,8 +960,10 @@ public abstract class AbstractActivityController implements ActivityController,
return mRecentFolderList;
}
- @Override
- public void loadAccountInbox() {
+ /**
+ * Load the default inbox associated with the current account.
+ */
+ protected void loadAccountInbox() {
boolean handled = false;
if (mFolderWatcher != null) {
final Folder inbox = mFolderWatcher.getDefaultInbox(mAccount);
@@ -1072,8 +1071,10 @@ public abstract class AbstractActivityController implements ActivityController,
return mFolderListFolder;
}
- @Override
- public void setHierarchyFolder(Folder folder) {
+ /**
+ * Set the folder currently selected in the folder selection hierarchy fragments.
+ */
+ protected void setHierarchyFolder(Folder folder) {
mFolderListFolder = folder;
}
@@ -1383,7 +1384,7 @@ public abstract class AbstractActivityController implements ActivityController,
ComposeActivity.compose(mActivity.getActivityContext(), getAccount());
} else if (viewId == android.R.id.home) {
// TODO: b/16627877
- onUpPressed();
+ handleUpPress();
}
}
@@ -1570,7 +1571,7 @@ public abstract class AbstractActivityController implements ActivityController,
delete(R.id.report_phishing, target,
getDeferredAction(R.id.report_phishing, target, isBatch, undoCallback), isBatch);
} else if (id == android.R.id.home) {
- onUpPressed();
+ handleUpPress();
} else if (id == R.id.compose) {
ComposeActivity.compose(mActivity.getActivityContext(), mAccount);
} else if (id == R.id.refresh) {
@@ -1671,11 +1672,6 @@ public abstract class AbstractActivityController implements ActivityController,
}
@Override
- public final boolean onUpPressed() {
- return handleUpPress();
- }
-
- @Override
public final boolean onBackPressed() {
if (isDrawerEnabled() && mDrawerContainer.isDrawerVisible(mDrawerPullout)) {
mDrawerContainer.closeDrawers();
@@ -2492,11 +2488,10 @@ public abstract class AbstractActivityController implements ActivityController,
}
/**
+ * Show the wait for account initialization mode.
* Children can override this method, but they must call super.showWaitForInitialization().
- * {@inheritDoc}
*/
- @Override
- public void showWaitForInitialization() {
+ protected void showWaitForInitialization() {
mViewMode.enterWaitingForInitializationMode();
mWaitFragment = WaitFragment.newInstance(mAccount, true /* expectingMessages */);
}
@@ -2549,12 +2544,12 @@ public abstract class AbstractActivityController implements ActivityController,
}
/**
- * Children can override this method, but they must call super.showConversationList().
- * {@inheritDoc}
+ * Show the conversation List with the list context provided here. On certain layouts, this
+ * might show more than just the conversation list. For instance, on tablets this might show
+ * the conversations along with the conversation list.
+ * @param listContext context providing information on what conversation list to display.
*/
- @Override
- public void showConversationList(ConversationListContext listContext) {
- }
+ protected abstract void showConversationList(ConversationListContext listContext);
@Override
public void onConversationSelected(Conversation conversation, boolean inLoaderCallbacks) {
@@ -3263,13 +3258,6 @@ public abstract class AbstractActivityController implements ActivityController,
}
}
- @Override
- public void exitSearchMode() {
- if (mViewMode.getMode() == ViewMode.SEARCH_RESULTS_LIST) {
- mActivity.finish();
- }
- }
-
/**
* Supports dragging conversations to a folder.
*/
@@ -4583,7 +4571,7 @@ public abstract class AbstractActivityController implements ActivityController,
private class HomeButtonListener implements View.OnClickListener {
@Override
public void onClick(View v) {
- onUpPressed();
+ handleUpPress();
}
}
}
diff --git a/src/com/android/mail/ui/ActivityController.java b/src/com/android/mail/ui/ActivityController.java
index 5e184e5aa..1593ce104 100644
--- a/src/com/android/mail/ui/ActivityController.java
+++ b/src/com/android/mail/ui/ActivityController.java
@@ -29,10 +29,8 @@ import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
-import com.android.mail.ConversationListContext;
import com.android.mail.browse.ConversationCursor.ConversationListener;
import com.android.mail.browse.ConversationListFooterView;
-import com.android.mail.providers.Account;
import com.android.mail.providers.Folder;
import com.android.mail.ui.ViewMode.ModeChangeListener;
@@ -60,7 +58,7 @@ import com.android.mail.ui.ViewMode.ModeChangeListener;
*/
public interface ActivityController extends LayoutListener,
ModeChangeListener, ConversationListCallbacks,
- FolderChangeListener, ConversationSetObserver, ConversationListener, FolderSelector,
+ ConversationSetObserver, ConversationListener, FolderSelector,
UndoListener, ConversationUpdater, ErrorListener, FolderController, AccountController,
ConversationPositionTracker.Callbacks, ConversationListFooterView.FooterViewClickListener,
RecentFolderController, FragmentLauncher, KeyboardNavigationController {
@@ -68,15 +66,6 @@ public interface ActivityController extends LayoutListener,
// As far as possible, the methods here that correspond to Activity lifecycle have the same name
// as their counterpart in the Activity lifecycle.
- /**
- * Returns the current account.
- */
- Account getCurrentAccount();
-
- /**
- * Returns the current conversation list context.
- */
- ConversationListContext getCurrentListContext();
/**
* @see android.app.Activity#onActivityResult
@@ -97,12 +86,6 @@ public interface ActivityController extends LayoutListener,
boolean onBackPressed();
/**
- * Called by the Mail activity when the up button is pressed.
- * @return
- */
- boolean onUpPressed();
-
- /**
* Called when the root activity calls onCreate. Any initialization needs to
* be done here. Subclasses need to call their parents' onCreate method, since it performs
* valuable initialization common to all subclasses.
@@ -230,19 +213,6 @@ public interface ActivityController extends LayoutListener,
void onWindowFocusChanged(boolean hasFocus);
/**
- * Show the conversation List with the list context provided here. On certain layouts, this
- * might show more than just the conversation list. For instance, on tablets this might show
- * the conversations along with the conversation list.
- * @param listContext context providing information on what conversation list to display.
- */
- void showConversationList(ConversationListContext listContext);
-
- /**
- * Show the wait for account initialization mode.
- */
- public void showWaitForInitialization();
-
- /**
* Handle a touch event.
*/
void onTouchEvent(MotionEvent event);
@@ -266,11 +236,6 @@ public interface ActivityController extends LayoutListener,
void startSearch();
/**
- * Exit the search mode, popping off one activity so that the back stack is fine.
- */
- void exitSearchMode();
-
- /**
* Supports dragging conversations to a folder.
*/
boolean supportsDrag(DragEvent event, Folder folder);
@@ -281,21 +246,11 @@ public interface ActivityController extends LayoutListener,
void handleDrop(DragEvent event, Folder folder);
/**
- * Load the default inbox associated with the current account.
- */
- public void loadAccountInbox();
-
- /**
* Return the folder currently being viewed by the activity.
*/
public Folder getHierarchyFolder();
/**
- * Set the folder currently selected in the folder selection hierarchy fragments.
- */
- void setHierarchyFolder(Folder folder);
-
- /**
* Handles the animation end of the animated adapter.
*/
void onAnimationEnd(AnimatedAdapter animatedAdapter);
diff --git a/src/com/android/mail/ui/ControllableActivity.java b/src/com/android/mail/ui/ControllableActivity.java
index c899d34dd..0937947ba 100644
--- a/src/com/android/mail/ui/ControllableActivity.java
+++ b/src/com/android/mail/ui/ControllableActivity.java
@@ -48,12 +48,6 @@ public interface ControllableActivity extends RestrictedActivity,
ConversationListCallbacks getListHandler();
/**
- * Return the folder change listener for this activity
- * @return
- */
- FolderChangeListener getFolderChangeListener();
-
- /**
* Get the set of currently selected conversations. This method returns a non-null value.
* In case no conversation is currently selected, it returns an empty selection set.
* @return
@@ -131,6 +125,4 @@ public interface ControllableActivity extends RestrictedActivity,
* Shows help to user, could be in browser or another activity.
*/
void showHelp(Account account, int viewMode);
-
- SearchRecentSuggestionsProvider getSuggestionsProvider();
}
diff --git a/src/com/android/mail/ui/FolderChangeListener.java b/src/com/android/mail/ui/FolderChangeListener.java
deleted file mode 100644
index 0968fa757..000000000
--- a/src/com/android/mail/ui/FolderChangeListener.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (C) 2012 Google Inc.
- * Licensed to The Android Open Source Project.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *******************************************************************************/
-package com.android.mail.ui;
-
-import com.android.mail.providers.Folder;
-
-/**
- * The callback interface for when a list item has been selected.
- */
-public interface FolderChangeListener {
- /**
- * Handles selecting a folder from within the {@link FolderListFragment}.
- *
- * @param folder the selected folder
- * @param force <code>true</code> to force a folder change, <code>false</code> to disallow
- * changing to the current folder
- */
- void onFolderChanged(Folder folder, boolean force);
-}
diff --git a/src/com/android/mail/ui/FolderSelectionActivity.java b/src/com/android/mail/ui/FolderSelectionActivity.java
index 045311449..01d96c443 100644
--- a/src/com/android/mail/ui/FolderSelectionActivity.java
+++ b/src/com/android/mail/ui/FolderSelectionActivity.java
@@ -53,7 +53,7 @@ import java.util.ArrayList;
* This activity displays the list of available folders for the current account.
*/
public class FolderSelectionActivity extends ActionBarActivity implements OnClickListener,
- DialogInterface.OnClickListener, FolderChangeListener, ControllableActivity,
+ DialogInterface.OnClickListener, ControllableActivity,
FolderSelector {
public static final String EXTRA_ACCOUNT_SHORTCUT = "account-shortcut";
@@ -258,8 +258,7 @@ public class FolderSelectionActivity extends ActionBarActivity implements OnClic
}
}
- @Override
- public void onFolderChanged(Folder folder, final boolean force) {
+ private void onFolderChanged(Folder folder, final boolean force) {
if (!folder.equals(mSelectedFolder)) {
mSelectedFolder = folder;
Intent resultIntent = new Intent();
@@ -323,11 +322,6 @@ public class FolderSelectionActivity extends ActionBarActivity implements OnClic
}
@Override
- public FolderChangeListener getFolderChangeListener() {
- return this;
- }
-
- @Override
public ConversationSelectionSet getSelectedSet() {
return null;
}
@@ -488,10 +482,4 @@ public class FolderSelectionActivity extends ActionBarActivity implements OnClic
public void showHelp(Account account, int viewMode) {
// Unsupported
}
-
- @Override
- public SearchRecentSuggestionsProvider getSuggestionsProvider() {
- // Unsupported;
- return null;
- }
}
diff --git a/src/com/android/mail/ui/MailActivity.java b/src/com/android/mail/ui/MailActivity.java
index bd640c563..4df24b6a1 100644
--- a/src/com/android/mail/ui/MailActivity.java
+++ b/src/com/android/mail/ui/MailActivity.java
@@ -340,11 +340,6 @@ public class MailActivity extends AbstractMailActivity implements ControllableAc
}
@Override
- public FolderChangeListener getFolderChangeListener() {
- return mController;
- }
-
- @Override
public FolderSelector getFolderSelector() {
return mController;
}
@@ -499,7 +494,6 @@ public class MailActivity extends AbstractMailActivity implements ControllableAc
Utils.showHelp(this, account, getString(helpContext));
}
- @Override
public SearchRecentSuggestionsProvider getSuggestionsProvider() {
return new SuggestionsProvider(this);
}
diff --git a/src/com/android/mail/ui/OnePaneController.java b/src/com/android/mail/ui/OnePaneController.java
index c68680949..fed11a668 100644
--- a/src/com/android/mail/ui/OnePaneController.java
+++ b/src/com/android/mail/ui/OnePaneController.java
@@ -192,8 +192,7 @@ public final class OnePaneController extends AbstractActivityController {
}
@Override
- public void showConversationList(ConversationListContext listContext) {
- super.showConversationList(listContext);
+ protected void showConversationList(ConversationListContext listContext) {
enableCabMode();
mConversationListVisible = true;
if (ConversationListContext.isSearchResult(listContext)) {
@@ -273,7 +272,7 @@ public final class OnePaneController extends AbstractActivityController {
}
@Override
- public void showWaitForInitialization() {
+ protected void showWaitForInitialization() {
super.showWaitForInitialization();
replaceFragment(getWaitFragment(), FragmentTransaction.TRANSIT_FRAGMENT_OPEN, TAG_WAIT,
R.id.content_pane);
diff --git a/src/com/android/mail/ui/TwoPaneController.java b/src/com/android/mail/ui/TwoPaneController.java
index bf8353b7e..b8ee17738 100644
--- a/src/com/android/mail/ui/TwoPaneController.java
+++ b/src/com/android/mail/ui/TwoPaneController.java
@@ -139,8 +139,7 @@ public final class TwoPaneController extends AbstractActivityController implemen
}
@Override
- public void showConversationList(ConversationListContext listContext) {
- super.showConversationList(listContext);
+ protected void showConversationList(ConversationListContext listContext) {
initializeConversationListFragment();
}
@@ -445,7 +444,7 @@ public final class TwoPaneController extends AbstractActivityController implemen
}
@Override
- public void showWaitForInitialization() {
+ protected void showWaitForInitialization() {
super.showWaitForInitialization();
FragmentTransaction fragmentTransaction = mActivity.getFragmentManager().beginTransaction();
@@ -545,16 +544,6 @@ public final class TwoPaneController extends AbstractActivityController implemen
}
@Override
- public void exitSearchMode() {
- final int mode = mViewMode.getMode();
- if (mode == ViewMode.SEARCH_RESULTS_LIST
- || (mode == ViewMode.SEARCH_RESULTS_CONVERSATION
- && Utils.showTwoPaneSearchResults(mActivity.getApplicationContext()))) {
- mActivity.finish();
- }
- }
-
- @Override
public boolean shouldShowFirstConversation() {
return Intent.ACTION_SEARCH.equals(mActivity.getIntent().getAction())
&& shouldEnterSearchConvMode();