@@ -66,7 +66,7 @@ class AndroidBuild extends JavaBuild {
66
66
static public final String min_sdk_watchface = "21" ; // Lollipop (5.0)
67
67
68
68
// Hard-coded target SDK, no longer user-selected.
69
- static public final String target_sdk = "22 " ; // Lollipop (5.1 )
69
+ static public final String target_sdk = "23 " ; // Marshmallow (6.0 )
70
70
static public final String target_platform = "android-" + target_sdk ;
71
71
72
72
static public int appComponent = FRAGMENT ;
@@ -941,6 +941,8 @@ private void writeLocalProps(final File file) {
941
941
writer .close ();
942
942
}
943
943
944
+ static final String ICON_192 = "icon-192.png" ;
945
+ static final String ICON_144 = "icon-144.png" ;
944
946
static final String ICON_96 = "icon-96.png" ;
945
947
static final String ICON_72 = "icon-72.png" ;
946
948
static final String ICON_48 = "icon-48.png" ;
@@ -974,18 +976,24 @@ private void writeRes(File resFolder,
974
976
File localIcon48 = new File (sketchFolder , ICON_48 );
975
977
File localIcon72 = new File (sketchFolder , ICON_72 );
976
978
File localIcon96 = new File (sketchFolder , ICON_96 );
979
+ File localIcon144 = new File (sketchFolder , ICON_144 );
980
+ File localIcon192 = new File (sketchFolder , ICON_192 );
977
981
978
982
// File drawableFolder = new File(resFolder, "drawable");
979
983
// drawableFolder.mkdirs()
980
984
File buildIcon48 = new File (resFolder , "drawable/icon.png" );
981
985
File buildIcon36 = new File (resFolder , "drawable-ldpi/icon.png" );
982
986
File buildIcon72 = new File (resFolder , "drawable-hdpi/icon.png" );
983
987
File buildIcon96 = new File (resFolder , "drawable-xhdpi/icon.png" );
988
+ File buildIcon144 = new File (resFolder , "drawable-xxhdpi/icon.png" );
989
+ File buildIcon192 = new File (resFolder , "drawable-xxxhdpi/icon.png" );
984
990
985
991
if (!localIcon36 .exists () &&
986
992
!localIcon48 .exists () &&
987
993
!localIcon72 .exists () &&
988
- !localIcon96 .exists ()) {
994
+ !localIcon96 .exists () &&
995
+ !localIcon144 .exists () &&
996
+ !localIcon192 .exists ()) {
989
997
try {
990
998
// if no icons are in the sketch folder, then copy all the defaults
991
999
if (buildIcon36 .getParentFile ().mkdirs ()) {
@@ -1008,6 +1016,16 @@ private void writeRes(File resFolder,
1008
1016
} else {
1009
1017
System .err .println ("Could not create \" drawable-xhdpi\" folder." );
1010
1018
}
1019
+ if (buildIcon144 .getParentFile ().mkdirs ()) {
1020
+ Util .copyFile (mode .getContentFile ("icons/" + ICON_144 ), buildIcon144 );
1021
+ } else {
1022
+ System .err .println ("Could not create \" drawable-xxhdpi\" folder." );
1023
+ }
1024
+ if (buildIcon192 .getParentFile ().mkdirs ()) {
1025
+ Util .copyFile (mode .getContentFile ("icons/" + ICON_192 ), buildIcon192 );
1026
+ } else {
1027
+ System .err .println ("Could not create \" drawable-xxxhdpi\" folder." );
1028
+ }
1011
1029
} catch (IOException e ) {
1012
1030
e .printStackTrace ();
1013
1031
//throw new SketchException("Could not get Android icons");
@@ -1035,6 +1053,16 @@ private void writeRes(File resFolder,
1035
1053
Util .copyFile (localIcon96 , buildIcon96 );
1036
1054
}
1037
1055
}
1056
+ if (localIcon144 .exists ()) {
1057
+ if (new File (resFolder , "drawable-xxhdpi" ).mkdirs ()) {
1058
+ Util .copyFile (localIcon144 , buildIcon144 );
1059
+ }
1060
+ }
1061
+ if (localIcon192 .exists ()) {
1062
+ if (new File (resFolder , "drawable-xxxhdpi" ).mkdirs ()) {
1063
+ Util .copyFile (localIcon192 , buildIcon192 );
1064
+ }
1065
+ }
1038
1066
} catch (IOException e ) {
1039
1067
System .err .println ("Problem while copying icons." );
1040
1068
e .printStackTrace ();
0 commit comments