Merge "Update layout so that conv items without labels dont look broken."
diff --git a/src/com/android/mail/ui/AbstractActivityController.java b/src/com/android/mail/ui/AbstractActivityController.java
index d1bdb6d..bba426d 100644
--- a/src/com/android/mail/ui/AbstractActivityController.java
+++ b/src/com/android/mail/ui/AbstractActivityController.java
@@ -476,11 +476,6 @@
// TODO(viki): Auto-generated method stub
}
- @Override
- public void reloadSearch(String string) {
- // TODO(viki): Auto-generated method stub
- }
-
/**
* @param savedState
*/
@@ -546,16 +541,6 @@
}
@Override
- public void startActionBarStatusCursorLoader(String account) {
- // TODO(viki): Auto-generated method stub
- }
-
- @Override
- public void stopActionBarStatusCursorLoader(String account) {
- // TODO(viki): Auto-generated method stub
- }
-
- @Override
public void toggleStar(boolean toggleOn, long conversationId, long maxMessageId) {
// TODO(viki): Auto-generated method stub
}
diff --git a/src/com/android/mail/ui/ActionBarView.java b/src/com/android/mail/ui/ActionBarView.java
index 30beac0..d5eaffb 100644
--- a/src/com/android/mail/ui/ActionBarView.java
+++ b/src/com/android/mail/ui/ActionBarView.java
@@ -50,44 +50,9 @@
*/
public final class ActionBarView extends LinearLayout implements OnNavigationListener,
ViewMode.ModeChangeListener, OnQueryTextListener {
- /**
- * This interface is used to send notifications back to the calling
- * activity. MenuHandler takes care of updating the provider, so this
- * interface should be used for notification purposes only (such as updating
- * the UI).
- */
- // TODO(viki): This callback is currently unused and may be entirely unnecessary in the new
- // code, where the Actionbar is switched into navigation mode, relying on the framework for most
- // heavy lifting. Also, we can switch ViewMode to the appropriate mode and rely on all UI
- // components updating through ViewMode change listeners.
- public interface Callback {
- /**
- * Returns the current account.
- */
- Account getCurrentAccount();
-
- /**
- * Called when the TwoPaneActionBar wants to get the current conversation list context.
- */
- ConversationListContext getCurrentListContext();
-
- /**
- * Invoked when the user is already viewing search results
- * and enters a new query.
- * @param string Query
- */
- void reloadSearch(String string);
-
- void showFolderList();
-
- void startActionBarStatusCursorLoader(String account);
-
- void stopActionBarStatusCursorLoader(String account);
- }
-
private ActionBar mActionBar;
private RestrictedActivity mActivity;
- private ActivityController mCallback;
+ private ActivityController mController;
private View mFolderView;
/**
* The current mode of the ActionBar. This references constants in {@link ViewMode}
@@ -178,7 +143,7 @@
public void initialize(RestrictedActivity activity, ActivityController callback,
ViewMode viewMode, ActionBar actionBar) {
mActionBar = actionBar;
- mCallback = callback;
+ mController = callback;
mActivity = activity;
mSpinner = new AccountSpinnerAdapter(getContext());
@@ -188,7 +153,7 @@
}
public void setAccounts(Account[] accounts) {
- Account currentAccount = mCallback.getCurrentAccount();
+ Account currentAccount = mController.getCurrentAccount();
mSpinner.setAccounts(accounts);
mSpinner.setCurrentAccount(currentAccount);
int position = -1;
@@ -230,12 +195,12 @@
// Get the capabilities associated with this account.
final Object item = mSpinner.getItem(position);
assert (item instanceof Account);
- mCallback.onAccountChanged((Account) mSpinner.getItem(position));
+ mController.onAccountChanged((Account) mSpinner.getItem(position));
break;
case AccountSpinnerAdapter.TYPE_FOLDER:
final Object folder = mSpinner.getItem(position);
assert (folder instanceof Folder);
- mCallback.onFolderChanged((Folder) folder);
+ mController.onFolderChanged((Folder) folder);
break;
}
return false;
@@ -247,11 +212,7 @@
public void onResume() {
}
- public void onStatusResult(String account, int status) {
- // Update the inbox folder if required
- mCallback.stopActionBarStatusCursorLoader(account);
- }
-
+ @Override
public void onViewModeChanged(int newMode) {
mMode = newMode;
// Always update the options menu and redraw. This will read the new mode and redraw
@@ -332,7 +293,7 @@
private void setPopulatedSearchView() {
if (mSearch != null) {
mSearch.expandActionView();
- ConversationListContext context = mCallback.getCurrentListContext();
+ ConversationListContext context = mController.getCurrentListContext();
if (context != null) {
mSearchWidget.setQuery(context.searchQuery, false);
}
diff --git a/src/com/android/mail/ui/ActivityController.java b/src/com/android/mail/ui/ActivityController.java
index e024bd9..b9f13fa 100644
--- a/src/com/android/mail/ui/ActivityController.java
+++ b/src/com/android/mail/ui/ActivityController.java
@@ -29,6 +29,7 @@
import com.android.mail.ConversationListContext;
import com.android.mail.browse.ConversationItemView.StarHandler;
+import com.android.mail.providers.Account;
import com.android.mail.providers.Conversation;
import com.android.mail.providers.Settings;
import com.android.mail.ui.ViewMode.ModeChangeListener;
@@ -39,7 +40,7 @@
* or respond to user action.
*/
public interface ActivityController extends MenuCallback, LayoutListener, SubjectDisplayChanger,
- ModeChangeListener, ActionBarView.Callback, StarHandler, ConversationListCallbacks,
+ ModeChangeListener, StarHandler, ConversationListCallbacks,
FolderChangeListener, AccountChangeListener, LoaderManager.LoaderCallbacks<Cursor> {
// As far as possible, the methods here that correspond to Activity lifecycle have the same name
@@ -72,6 +73,16 @@
void attachConversationView(ConversationViewFragment conversationViewFragment);
/**
+ * Returns the current account.
+ */
+ Account getCurrentAccount();
+
+ /**
+ * Returns the current conversation list context.
+ */
+ ConversationListContext getCurrentListContext();
+
+ /**
* Return the current mode the activity is in. Values need to be matched against constants in
* {@link ViewMode}.
* @return
@@ -226,7 +237,6 @@
/**
* Show the folder list associated with the currently selected account.
*/
- @Override
void showFolderList();
/**