@@ -313,7 +313,7 @@ public void onClick(View v) {
313
313
}
314
314
} else if (cbAddFrame .isChecked ()) {
315
315
if (finalListBitmaps .get (0 ).getHeight () != 144 && finalListBitmaps .get (0 ).getHeight () != 224 ) {
316
- Utils .toast (getContext (), "Can't add this image as a frame" );//Add string
316
+ Utils .toast (getContext (), getString ( R . string . cant_add_frame ) );//Add string
317
317
btnAddImages .setEnabled (true );
318
318
} else frameNameDialog ();
319
319
}
@@ -337,27 +337,27 @@ private void frameNameDialog() {
337
337
EditText etFrameName = view .findViewById (R .id .etFrameName );
338
338
AlertDialog .Builder builder = new AlertDialog .Builder (getContext ());
339
339
builder .setView (view );
340
- AlertDialog alertdialog = builder .create ();
340
+ AlertDialog alertdialog = builder .create ();
341
341
342
342
etFrameName .setImeOptions (EditorInfo .IME_ACTION_DONE );//When pressing enter
343
- builder .setTitle ("Set new Frame name" );//Add string
343
+ // builder.setTitle("Set new Frame name");//Add string
344
344
Button btnSaveFrame = view .findViewById (R .id .btnSaveFrame );
345
345
btnSaveFrame .setOnClickListener (new View .OnClickListener () {
346
346
@ Override
347
347
public void onClick (View v ) {
348
348
GbcFrame gbcFrame = new GbcFrame ();
349
349
gbcFrame .setFrameBitmap (filledFrame );
350
- if (filledFrame .getHeight ()== 224 ){
350
+ if (filledFrame .getHeight () == 224 ) {
351
351
gbcFrame .setWildFrame (true );
352
352
}
353
353
List <GbcFrame > newFrameImages = new ArrayList <>();
354
354
//Add here the dialog for the frame name
355
355
String frameName = etFrameName .getText ().toString ();
356
356
if (frameName .equals ("" )) {
357
- Utils .toast (getContext (), "Name must not be empty" ); //Add string
357
+ Utils .toast (getContext (), getString ( R . string . no_empty_frame_name ));
358
358
etFrameName .setBackgroundColor (Color .parseColor ("#FF0000" ));
359
359
} else if (frameName .contains (" " )) {
360
- Utils .toast (getContext (), "Text must no contain empty spaces." );//Add string
360
+ Utils .toast (getContext (), getString ( R . string . no_spaces_frame_name ) );//Add string
361
361
etFrameName .setBackgroundColor (Color .parseColor ("#FF0000" ));
362
362
} else {
363
363
gbcFrame .setFrameName (frameName );
@@ -367,7 +367,7 @@ public void onClick(View v) {
367
367
if (frame .getFrameName ().toLowerCase (Locale .ROOT ).equals (gbcFrame .getFrameName ())) {
368
368
alreadyAdded = true ;
369
369
etFrameName .setBackgroundColor (Color .parseColor ("#FF0000" ));
370
- Utils .toast (getContext (), "This frame name already exists." );//Add string
370
+ Utils .toast (getContext (), getString ( R . string . frame_name_exists ) );//Add string
371
371
break ;
372
372
}
373
373
}
@@ -857,7 +857,7 @@ public void onActivityResult(ActivityResult result) {
857
857
858
858
} else {
859
859
tvFileName .setText (getString (R .string .file_name ) + fileName );
860
- tvFileName .setText ("Not a valid image file" );
860
+ tvFileName .setText (getString ( R . string . no_valid_image_file ) );
861
861
btnExtractFile .setVisibility (View .GONE );
862
862
btnAddImages .setVisibility (View .GONE );
863
863
layoutCb .setVisibility (View .GONE );
@@ -898,7 +898,6 @@ public boolean extractSavImages() {
898
898
listImportedImageBytes = extractor .extractBytes (fileBytes );
899
899
//Check for Magic or FF bytes
900
900
if (!magicIsReal (fileBytes )) {
901
- System .out .println ("NO VALID FILE///////////////////////" );
902
901
return false ;
903
902
}
904
903
int nameIndex = 1 ;
@@ -917,7 +916,7 @@ public boolean extractSavImages() {
917
916
String hashHex = Utils .bytesToHex (hash );
918
917
gbcImage .setHashCode (hashHex );
919
918
ImageCodec imageCodec = new ImageCodec (128 , 112 , gbcImage .isLockFrame ());
920
- Bitmap image = imageCodec .decodeWithPalette (Utils .hashPalettes .get (gbcImage .getPaletteId ()).getPaletteColorsInt (), imageBytes , false ,false );
919
+ Bitmap image = imageCodec .decodeWithPalette (Utils .hashPalettes .get (gbcImage .getPaletteId ()).getPaletteColorsInt (), imageBytes , false , false );
921
920
if (image .getHeight () == 112 && image .getWidth () == 128 ) {
922
921
//I need to use copy because if not it's inmutable bitmap
923
922
Bitmap framed = Utils .framesList .get (3 ).getFrameBitmap ().copy (Bitmap .Config .ARGB_8888 , true );
@@ -961,7 +960,7 @@ public static void extractHexImages(String fileContent) throws NoSuchAlgorithmEx
961
960
gbcImage .setName (fileName + " " + formattedIndex );
962
961
int height = (data .length () + 1 ) / 120 ;//To get the real height of the image
963
962
ImageCodec imageCodec = new ImageCodec (160 , height , false );
964
- Bitmap image = imageCodec .decodeWithPalette (Utils .hashPalettes .get (gbcImage .getPaletteId ()).getPaletteColorsInt (), gbcImage .getImageBytes (), false ,false );
963
+ Bitmap image = imageCodec .decodeWithPalette (Utils .hashPalettes .get (gbcImage .getPaletteId ()).getPaletteColorsInt (), gbcImage .getImageBytes (), false , false );
965
964
importedImagesBitmaps .add (image );
966
965
importedImagesList .add (gbcImage );
967
966
}
0 commit comments