mIconSize = am.getLauncherLargeIconSize();
public ShortcutIntentBuilder(Context context, OnShortcutIntentCreatedListener listener) { mContext = context; mListener = listener; mResources = context.getResources(); final ActivityManager am = (ActivityManager) context .getSystemService(Context.ACTIVITY_SERVICE); mIconSize = mResources.getDimensionPixelSize(R.dimen.shortcut_icon_size); if (mIconSize == 0) { mIconSize = am.getLauncherLargeIconSize(); } mIconDensity = am.getLauncherLargeIconDensity(); mOverlayTextBackgroundColor = mResources.getColor(R.color.shortcut_overlay_text_background); }
/** * Returns whether the given icon matches the size requirements to be used on the home screen. * @param width Icon width, in pixels. * @param height Icon height, in pixels. * @return whether the given icon matches the size requirements to be used on the home screen. */ @CalledByNative public static boolean isIconLargeEnoughForLauncher(int width, int height) { Context context = ContextUtils.getApplicationContext(); ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); final int minimalSize = am.getLauncherLargeIconSize() / 2; return width >= minimalSize && height >= minimalSize; }
int maxInnerSize = Math.round(am.getLauncherLargeIconSize() * MAX_INNER_SIZE_RATIO); int innerSize = Math.min(maxInnerSize, Math.max(webIcon.getWidth(), webIcon.getHeight())); int padding = Math.round(ICON_PADDING_RATIO * innerSize);
Context context = ContextUtils.getApplicationContext(); ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); final int outerSize = am.getLauncherLargeIconSize(); final int iconDensity = am.getLauncherLargeIconDensity();
mIconSize = am.getLauncherLargeIconSize();
mIconSize = am.getLauncherLargeIconSize();
int iconSize = activityManager.getLauncherLargeIconSize(); final String pkgName = getIntent().getStringExtra("package"); iconName = getIntent().getStringExtra("icon_name");