summaryrefslogtreecommitdiffstats
path: root/src/com/android/mail/ui/FolderSelectionActivity.java
diff options
context:
space:
mode:
authorRohan Shah <shahrk@google.com>2013-04-19 17:06:37 -0700
committerRohan Shah <shahrk@google.com>2013-04-22 14:09:50 -0700
commit0f73d905c5e935a5280f8eb647cc924c2854b7de (patch)
tree77ce0e79e53dc2c7cca47c53ebfb2719a460ecfa /src/com/android/mail/ui/FolderSelectionActivity.java
parentab36f8e082cf814d0492d18684194665b50f71b6 (diff)
downloadandroid_packages_apps_UnifiedEmail-0f73d905c5e935a5280f8eb647cc924c2854b7de.tar.gz
android_packages_apps_UnifiedEmail-0f73d905c5e935a5280f8eb647cc924c2854b7de.tar.bz2
android_packages_apps_UnifiedEmail-0f73d905c5e935a5280f8eb647cc924c2854b7de.zip
Remove drawer jank and load less aggressively
Added an observer that only allows account/folder changes to continue once the drawer is closed to avoid jank/awful fps that we saw before. Bug: 8661186 Change-Id: I859882b40a8cdf86d0b825eb7e4203b4e3516ecd
Diffstat (limited to 'src/com/android/mail/ui/FolderSelectionActivity.java')
-rw-r--r--src/com/android/mail/ui/FolderSelectionActivity.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/com/android/mail/ui/FolderSelectionActivity.java b/src/com/android/mail/ui/FolderSelectionActivity.java
index 192f02845..ce819de3b 100644
--- a/src/com/android/mail/ui/FolderSelectionActivity.java
+++ b/src/com/android/mail/ui/FolderSelectionActivity.java
@@ -24,6 +24,7 @@ import android.appwidget.AppWidgetManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
+import android.database.DataSetObservable;
import android.database.DataSetObserver;
import android.os.Bundle;
import android.util.Log;
@@ -39,6 +40,7 @@ import com.android.mail.ui.FolderListFragment.FolderListSelectionListener;
import com.android.mail.ui.ViewMode.ModeChangeListener;
import com.android.mail.utils.LogTag;
import com.android.mail.utils.LogUtils;
+import com.android.mail.utils.Observable;
import com.android.mail.utils.Utils;
import com.android.mail.utils.VeiledAddressMatcher;
import com.android.mail.widget.WidgetProvider;
@@ -65,6 +67,8 @@ public class FolderSelectionActivity extends Activity implements OnClickListener
protected boolean mConfigureWidget;
private int mAppWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID;
private int mMode = -1;
+ /** Empty placeholder for communicating to the consumer of the drawer observer. */
+ private final DataSetObservable mDrawerObservers = new Observable("Drawer");
private final AccountController mAccountController = new AccountController() {
@Override
@@ -114,6 +118,24 @@ public class FolderSelectionActivity extends Activity implements OnClickListener
Log.wtf(LOG_TAG,"FolderSelectionActivity.switchToDefaultInboxOrChangeAccount() " +
"called when NOT expected.");
}
+
+ @Override
+ public void registerDrawerClosedObserver(final DataSetObserver observer) {
+ mDrawerObservers.registerObserver(observer);
+ }
+
+ @Override
+ public void unregisterDrawerClosedObserver(final DataSetObserver observer) {
+ mDrawerObservers.unregisterObserver(observer);
+ }
+
+ /**
+ * Since there is no drawer to wait for, notifyChanged to the observers.
+ */
+ @Override
+ public void closeDrawerForNewList() {
+ mDrawerObservers.notifyChanged();
+ }
};
@Override