mirror of
https://github.com/xoureldeen/Vectras-VM-Android.git
synced 2026-04-30 07:19:58 +00:00
Almond cake
This commit is contained in:
parent
a3892f7865
commit
0a8b24bff3
7 changed files with 31 additions and 38 deletions
|
|
@ -119,26 +119,28 @@ public class AdapterRoms extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
|||
intent.putExtra("arch", current.itemArch);
|
||||
RomsManagerActivity.activity.startActivity(intent);
|
||||
|
||||
//Save image to icon folder
|
||||
myHolder.ivIcon.buildDrawingCache();
|
||||
Bitmap bm = myHolder.ivIcon.getDrawingCache();
|
||||
OutputStream fOut = null;
|
||||
Uri outputFileUri;
|
||||
try {
|
||||
File root = new File(AppConfig.maindirpath + "/icons/");
|
||||
root.mkdirs();
|
||||
File sdImageMainDirectory = new File(root, current.itemPath + ".png");
|
||||
outputFileUri = Uri.fromFile(sdImageMainDirectory);
|
||||
fOut = new FileOutputStream(sdImageMainDirectory);
|
||||
} catch (FileNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (!current.itemPath.endsWith(".cvbi")) {
|
||||
//Save image to icon folder
|
||||
myHolder.ivIcon.buildDrawingCache();
|
||||
Bitmap bm = myHolder.ivIcon.getDrawingCache();
|
||||
OutputStream fOut = null;
|
||||
Uri outputFileUri;
|
||||
try {
|
||||
File root = new File(AppConfig.maindirpath + "/icons/");
|
||||
root.mkdirs();
|
||||
File sdImageMainDirectory = new File(root, current.itemPath + ".png");
|
||||
outputFileUri = Uri.fromFile(sdImageMainDirectory);
|
||||
fOut = new FileOutputStream(sdImageMainDirectory);
|
||||
} catch (FileNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
try {
|
||||
bm.compress(Bitmap.CompressFormat.PNG, 100, fOut);
|
||||
fOut.flush();
|
||||
fOut.close();
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
bm.compress(Bitmap.CompressFormat.PNG, 100, fOut);
|
||||
fOut.flush();
|
||||
fOut.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue