summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaxwen <max.weninger@gmail.com>2012-10-27 15:05:44 +0200
committermaxwen <max.weninger@gmail.com>2012-10-27 15:05:44 +0200
commitdfbe72bd94593968a84bda0d9eb84ed23f73e6ac (patch)
treeab631fc9d700ac09b2f44179ffa014e4279a29b7
parentbf387dc6f512ec43fa632d7ed42350cd9a3f34e9 (diff)
downloadandroid_packages_apps_Trebuchet-dfbe72bd94593968a84bda0d9eb84ed23f73e6ac.tar.gz
android_packages_apps_Trebuchet-dfbe72bd94593968a84bda0d9eb84ed23f73e6ac.tar.bz2
android_packages_apps_Trebuchet-dfbe72bd94593968a84bda0d9eb84ed23f73e6ac.zip
Fix for NPE in showAllAppsCling
Added check for getTabHost() E/AndroidRuntime( 1880): FATAL EXCEPTION: main E/AndroidRuntime( 1880): java.lang.NullPointerException E/AndroidRuntime( 1880): at com.cyanogenmod.trebuchet.AppsCustomizePagedView.showAllAppsCling(AppsCustomizePagedView.java:575) E/AndroidRuntime( 1880): at com.cyanogenmod.trebuchet.AppsCustomizeTabHost.onLauncherTransitionEnd(AppsCustomizeTabHost.java:455) E/AndroidRuntime( 1880): at com.cyanogenmod.trebuchet.Launcher.dispatchOnLauncherTransitionEnd(Launcher.java:2401) E/AndroidRuntime( 1880): at com.cyanogenmod.trebuchet.Launcher.access$2100(Launcher.java:120) E/AndroidRuntime( 1880): at com.cyanogenmod.trebuchet.Launcher$14.onAnimationEnd(Launcher.java:2519) E/AndroidRuntime( 1880): at android.animation.AnimatorSet$AnimatorSetListener.onAnimationEnd(AnimatorSet.java:765) E/AndroidRuntime( 1880): at com.cyanogenmod.trebuchet.LauncherViewPropertyAnimator.onAnimationEnd(LauncherViewPropertyAnimator.java:111) Change-Id: I4aa0b4bacc03fb7aa87029d3e9406570bc82830f
-rw-r--r--src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java b/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java
index 364b3b30e..86dcce8a5 100644
--- a/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java
+++ b/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java
@@ -572,22 +572,25 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
void showAllAppsCling() {
- Cling allAppsCling = (Cling) getTabHost().findViewById(R.id.all_apps_cling);
- if (!mHasShownAllAppsCling && isDataReady()) {
- mHasShownAllAppsCling = true;
- // Calculate the position for the cling punch through
- int[] offset = new int[2];
- int[] pos = mWidgetSpacingLayout.estimateCellPosition(mClingFocusedX, mClingFocusedY);
- mLauncher.getDragLayer().getLocationInDragLayer(this, offset);
- // PagedViews are centered horizontally but top aligned
- pos[0] += (getMeasuredWidth() - mWidgetSpacingLayout.getMeasuredWidth()) / 2 +
- offset[0];
- pos[1] += offset[1];
- mLauncher.showFirstRunAllAppsCling(pos);
- } else if (!mHasShownAllAppsSortCling && isDataReady() &&
- allAppsCling != null && allAppsCling.isDismissed()) {
- mHasShownAllAppsSortCling = true;
- mLauncher.showFirstRunAllAppsSortCling();
+ AppsCustomizeTabHost tabHost = getTabHost();
+ if (tabHost != null) {
+ Cling allAppsCling = (Cling) tabHost.findViewById(R.id.all_apps_cling);
+ if (!mHasShownAllAppsCling && isDataReady()) {
+ mHasShownAllAppsCling = true;
+ // Calculate the position for the cling punch through
+ int[] offset = new int[2];
+ int[] pos = mWidgetSpacingLayout.estimateCellPosition(mClingFocusedX, mClingFocusedY);
+ mLauncher.getDragLayer().getLocationInDragLayer(this, offset);
+ // PagedViews are centered horizontally but top aligned
+ pos[0] += (getMeasuredWidth() - mWidgetSpacingLayout.getMeasuredWidth()) / 2 +
+ offset[0];
+ pos[1] += offset[1];
+ mLauncher.showFirstRunAllAppsCling(pos);
+ } else if (!mHasShownAllAppsSortCling && isDataReady() &&
+ allAppsCling != null && allAppsCling.isDismissed()) {
+ mHasShownAllAppsSortCling = true;
+ mLauncher.showFirstRunAllAppsSortCling();
+ }
}
}