Enabled auto-scaling of bitmaps

This commit is contained in:
daniel oeh 2012-08-06 12:53:52 +02:00
parent 0b62b06cdf
commit 8bde0e0fe2
3 changed files with 6 additions and 4 deletions

View File

@ -19,7 +19,7 @@
android:largeScreens="true" android:largeScreens="true"
android:normalScreens="true" android:normalScreens="true"
android:smallScreens="false" android:smallScreens="false"
android:xlargeScreens="true" /> android:xlargeScreens="true" android:anyDensity="true"/>
<application <application
android:name="de.danoeh.antennapod.PodcastApp" android:name="de.danoeh.antennapod.PodcastApp"

View File

@ -120,7 +120,7 @@ public class FeedImageLoader {
} }
public void loadThumbnailBitmap(FeedImage image, ImageView target) { public void loadThumbnailBitmap(FeedImage image, ImageView target) {
if (image.getFile_url() != null) { if (image != null && image.getFile_url() != null) {
Bitmap bitmap = getBitmapFromThumbnailCache(image.getFile_url()); Bitmap bitmap = getBitmapFromThumbnailCache(image.getFile_url());
if (bitmap != null) { if (bitmap != null) {
target.setImageBitmap(bitmap); target.setImageBitmap(bitmap);

View File

@ -41,6 +41,7 @@ public class BitmapDecoder {
options.inJustDecodeBounds = false; options.inJustDecodeBounds = false;
options.inSampleSize = sampleSize; options.inSampleSize = sampleSize;
options.inPreferredConfig = Bitmap.Config.ARGB_8888; options.inPreferredConfig = Bitmap.Config.ARGB_8888;
options.inScaled = false;
Bitmap decodedBitmap = BitmapFactory.decodeFile(fileUrl, options); Bitmap decodedBitmap = BitmapFactory.decodeFile(fileUrl, options);
if (decodedBitmap == null) { if (decodedBitmap == null) {
@ -50,10 +51,11 @@ public class BitmapDecoder {
decodedBitmap = BitmapFactory.decodeFile(fileUrl); decodedBitmap = BitmapFactory.decodeFile(fileUrl);
} }
if (decodedBitmap != null) { if (decodedBitmap != null) {
return decodedBitmap;
/*
return Bitmap.createScaledBitmap(decodedBitmap, return Bitmap.createScaledBitmap(decodedBitmap,
preferredLength, preferredLength, false); preferredLength, preferredLength, false);
*/
} else { } else {
return null; return null;
} }