summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/launcher2/Launcher.java10
-rw-r--r--src/com/android/launcher2/PagedView.java1
2 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 6d2ec3a05..9fa15ceb9 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -2582,21 +2582,25 @@ public final class Launcher extends Activity
// if successful in getting icon, return it; otherwise, set button to use default drawable
private Drawable.ConstantState updateTextButtonWithIconFromExternalActivity(
int buttonId, ComponentName activityName, int fallbackDrawableId) {
- TextView button = (TextView) findViewById(buttonId);
Drawable toolbarIcon = getExternalPackageToolbarIcon(activityName);
Resources r = getResources();
int w = r.getDimensionPixelSize(R.dimen.toolbar_external_icon_width);
int h = r.getDimensionPixelSize(R.dimen.toolbar_external_icon_height);
+ TextView button = (TextView) findViewById(buttonId);
// If we were unable to find the icon via the meta-data, use a generic one
if (toolbarIcon == null) {
toolbarIcon = r.getDrawable(fallbackDrawableId);
toolbarIcon.setBounds(0, 0, w, h);
- button.setCompoundDrawables(toolbarIcon, null, null, null);
+ if (button != null) {
+ button.setCompoundDrawables(toolbarIcon, null, null, null);
+ }
return null;
} else {
toolbarIcon.setBounds(0, 0, w, h);
- button.setCompoundDrawables(toolbarIcon, null, null, null);
+ if (button != null) {
+ button.setCompoundDrawables(toolbarIcon, null, null, null);
+ }
return toolbarIcon.getConstantState();
}
}
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index 3d2deb8f1..9b3a339df 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -713,7 +713,6 @@ public abstract class PagedView extends ViewGroup {
rightScreen++;
x += getScaledMeasuredWidth(getPageAt(rightScreen)) + mPageSpacing;
}
- rightScreen = Math.min(getChildCount() - 1, rightScreen);
final long drawingTime = getDrawingTime();
// Clip to the bounds