mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
centralize handlePNG function
This commit is contained in:
parent
a466cfd109
commit
78f1aa5f66
1 changed files with 13 additions and 26 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue