summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/drawable-hdpi/appwidget_item_bg_normal.9.pngbin267 -> 274 bytes
-rw-r--r--res/drawable-mdpi/appwidget_item_bg_normal.9.pngbin243 -> 250 bytes
-rw-r--r--res/drawable-xhdpi/appwidget_item_bg_normal.9.pngbin316 -> 359 bytes
-rw-r--r--src/com/android/settings/KeyguardAppWidgetPickActivity.java23
4 files changed, 4 insertions, 19 deletions
diff --git a/res/drawable-hdpi/appwidget_item_bg_normal.9.png b/res/drawable-hdpi/appwidget_item_bg_normal.9.png
index 6fd0e6e..36552d4 100644
--- a/res/drawable-hdpi/appwidget_item_bg_normal.9.png
+++ b/res/drawable-hdpi/appwidget_item_bg_normal.9.png
Binary files differ
diff --git a/res/drawable-mdpi/appwidget_item_bg_normal.9.png b/res/drawable-mdpi/appwidget_item_bg_normal.9.png
index 47009b4..08a94f5 100644
--- a/res/drawable-mdpi/appwidget_item_bg_normal.9.png
+++ b/res/drawable-mdpi/appwidget_item_bg_normal.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/appwidget_item_bg_normal.9.png b/res/drawable-xhdpi/appwidget_item_bg_normal.9.png
index 3cb534a..cbbd8f6 100644
--- a/res/drawable-xhdpi/appwidget_item_bg_normal.9.png
+++ b/res/drawable-xhdpi/appwidget_item_bg_normal.9.png
Binary files differ
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) {
}