centralize handlePNG function

This commit is contained in:
Andy Scherzinger 2016-06-25 15:09:01 +02:00
parent a466cfd109
commit 78f1aa5f66

View file

@ -325,19 +325,6 @@ public class ThumbnailsCacheManager {
}
private Bitmap handlePNG(Bitmap bitmap, int px){
Bitmap resultBitmap = Bitmap.createBitmap(px,
px,
Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(resultBitmap);
c.drawColor(MainApp.getAppContext().getResources().
getColor(R.color.background_color));
c.drawBitmap(bitmap, 0, 0, null);
return resultBitmap;
}
private Bitmap doFileInBackground() {
File file = (File)mFile;
@ -509,19 +496,6 @@ public class ThumbnailsCacheManager {
return avatar;
}
private Bitmap handlePNG(Bitmap bitmap, int px){
Bitmap resultBitmap = Bitmap.createBitmap(px,
px,
Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(resultBitmap);
c.drawColor(MainApp.getAppContext().getResources().
getColor(R.color.background_color));
c.drawBitmap(bitmap, 0, 0, null);
return resultBitmap;
}
private Bitmap doFileInBackground() {
File file = (File) mUsername;
@ -673,4 +647,17 @@ public class ThumbnailsCacheManager {
return avatarWorkerTaskReference.get();
}
}
private static Bitmap handlePNG(Bitmap bitmap, int px){
Bitmap resultBitmap = Bitmap.createBitmap(px,
px,
Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(resultBitmap);
c.drawColor(MainApp.getAppContext().getResources().
getColor(R.color.background_color));
c.drawBitmap(bitmap, 0, 0, null);
return resultBitmap;
}
}