summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/KeyguardAppWidgetPickActivity.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-11-07 15:31:47 -0800
committerMichael Jurka <mikejurka@google.com>2012-11-07 15:32:23 -0800
commita108d9fc0edd3b4f741fae595e35a246fbc700ff (patch)
treee5f172730a069ee823789fcfa9eda7a25ac0fb7e /src/com/android/settings/KeyguardAppWidgetPickActivity.java
parentc74ef2f28b1b095ecb3dea78ff8d277daec84f58 (diff)
downloadpackages_apps_settings-a108d9fc0edd3b4f741fae595e35a246fbc700ff.zip
packages_apps_settings-a108d9fc0edd3b4f741fae595e35a246fbc700ff.tar.gz
packages_apps_settings-a108d9fc0edd3b4f741fae595e35a246fbc700ff.tar.bz2
Final tweaks to visuals of widget picker
Diffstat (limited to 'src/com/android/settings/KeyguardAppWidgetPickActivity.java')
-rw-r--r--src/com/android/settings/KeyguardAppWidgetPickActivity.java23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/com/android/settings/KeyguardAppWidgetPickActivity.java b/src/com/android/settings/KeyguardAppWidgetPickActivity.java
index db5f115..80dbc0c 100644
--- a/src/com/android/settings/KeyguardAppWidgetPickActivity.java
+++ b/src/com/android/settings/KeyguardAppWidgetPickActivity.java
@@ -216,7 +216,6 @@ public class KeyguardAppWidgetPickActivity extends Activity
mResources.getDimensionPixelSize(R.dimen.appwidget_preview_width);
int appWidgetPreviewHeight =
mResources.getDimensionPixelSize(R.dimen.appwidget_preview_height);
- // TODO: fix the hspan, vspan of the default preview
Bitmap b = getWidgetPreview(new ComponentName(packageName, className),
appWidgetPreviewId, iconId,
appWidgetPreviewWidth, appWidgetPreviewHeight);
@@ -322,32 +321,18 @@ public class KeyguardAppWidgetPickActivity extends Activity
bitmapHeight = drawable.getIntrinsicHeight();
} else {
// Generate a preview image if we couldn't load one
- bitmapWidth = maxWidth;
- bitmapHeight = maxHeight;
+ bitmapWidth = appIconSize;
+ bitmapHeight = appIconSize;
defaultPreview = Bitmap.createBitmap(bitmapWidth, bitmapHeight,
Config.ARGB_8888);
- final Canvas c = sCachedAppWidgetPreviewCanvas.get();
- c.setBitmap(defaultPreview);
- c.drawColor(0xFF2D2D2D);
- c.setBitmap(null);
-
- // Draw the icon in the top left corner
- final float marginPercentage = 0.125f;
- final float finalIconSize = (bitmapHeight / 2);
- float iconScale = finalIconSize / appIconSize;
try {
Drawable icon = null;
- int hoffset =
- (int) (finalIconSize * marginPercentage);
- int yoffset =
- (int) (finalIconSize * marginPercentage);
if (iconId > 0)
icon = getFullResIcon(packageName, iconId);
if (icon != null) {
- renderDrawableToBitmap(icon, defaultPreview, hoffset,
- yoffset, (int) (appIconSize * iconScale),
- (int) (appIconSize * iconScale));
+ renderDrawableToBitmap(icon, defaultPreview, 0,
+ 0, appIconSize, appIconSize);
}
} catch (Resources.NotFoundException e) {
}