summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-10-21 10:54:40 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-10-21 10:54:40 -0700
commit54103eb3f9fb6e1fd4d1b83c784a23b80323ec75 (patch)
tree11a3e24ca71b57c4d04a3316b2455fa6f8b42474 /src
parent442b53259fe19626c322ea5aaeddc8edba6109f9 (diff)
parent097e6c71b12ad1fdc9beba5f74c466521508df9d (diff)
downloadandroid_packages_apps_Trebuchet-54103eb3f9fb6e1fd4d1b83c784a23b80323ec75.tar.gz
android_packages_apps_Trebuchet-54103eb3f9fb6e1fd4d1b83c784a23b80323ec75.tar.bz2
android_packages_apps_Trebuchet-54103eb3f9fb6e1fd4d1b83c784a23b80323ec75.zip
Merge "Adding additional checks to prevent launcher crash when we can't compose animation buffer. (Bug: 5478481)" into ics-mr0
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/AppsCustomizeTabHost.java21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java
index 8d67e5d66..688ea152d 100644
--- a/src/com/android/launcher2/AppsCustomizeTabHost.java
+++ b/src/com/android/launcher2/AppsCustomizeTabHost.java
@@ -167,6 +167,14 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
mAppsCustomizePane.hideScrollingIndicator(false);
}
+ private void reloadCurrentPage() {
+ if (!LauncherApplication.isScreenLarge()) {
+ mAppsCustomizePane.flashScrollingIndicator();
+ }
+ mAppsCustomizePane.loadAssociatedPages(mAppsCustomizePane.getCurrentPage());
+ mAppsCustomizePane.requestFocus();
+ }
+
private void onTabChangedEnd(AppsCustomizePagedView.ContentType type) {
mAppsCustomizePane.setContentType(type);
}
@@ -188,6 +196,12 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
post(new Runnable() {
@Override
public void run() {
+ if (mAppsCustomizePane.getMeasuredWidth() <= 0 ||
+ mAppsCustomizePane.getMeasuredHeight() <= 0) {
+ reloadCurrentPage();
+ return;
+ }
+
// Setup the animation buffer
Bitmap b = Bitmap.createBitmap(mAppsCustomizePane.getMeasuredWidth(),
mAppsCustomizePane.getMeasuredHeight(), Bitmap.Config.ARGB_8888);
@@ -217,12 +231,7 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
inAnim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
- if (!LauncherApplication.isScreenLarge()) {
- mAppsCustomizePane.flashScrollingIndicator();
- }
- mAppsCustomizePane.loadAssociatedPages(
- mAppsCustomizePane.getCurrentPage());
- mAppsCustomizePane.requestFocus();
+ reloadCurrentPage();
}
});
AnimatorSet animSet = new AnimatorSet();