Merge "Fix NPE" into ics-mr1
This commit is contained in:
committed by
Android (Google) Code Review
commit
6e8dc3572f
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user