@@ -767,8 +767,11 @@ private void writeLocalProps(final File file) {
767
767
private void writeRes (File resFolder ,
768
768
String className ) throws SketchException {
769
769
File layoutFolder = mkdirs (resFolder , "layout" );
770
- File layoutFile = new File (layoutFolder , "main.xml" );
771
- writeResLayoutMain (layoutFile );
770
+ File mainActivityLayoutFile = new File (layoutFolder , "main.xml" );
771
+ writeResLayoutMainActivity (mainActivityLayoutFile );
772
+
773
+ File mainFragmentLayoutFile = new File (layoutFolder , "fragment_main.xml" );
774
+ writeResLayoutMainFragment (mainFragmentLayoutFile );
772
775
773
776
// write the icon files
774
777
File sketchFolder = sketch .getFolder ();
@@ -875,7 +878,7 @@ private void writeMainActivity(final File file) {
875
878
}
876
879
877
880
878
- private void writeResLayoutMain (final File file ) {
881
+ private void writeResLayoutMainActivity (final File file ) {
879
882
final PrintWriter writer = PApplet .createWriter (file );
880
883
writer .println ("<fragment xmlns:android=\" http://schemas.android.com/apk/res/android\" " );
881
884
writer .println (" xmlns:tools=\" http://schemas.android.com/tools\" " );
@@ -887,6 +890,17 @@ private void writeResLayoutMain(final File file) {
887
890
writer .flush ();
888
891
writer .close ();
889
892
}
893
+
894
+
895
+ private void writeResLayoutMainFragment (final File file ) {
896
+ final PrintWriter writer = PApplet .createWriter (file );
897
+ writer .println ("<?xml version=\" 1.0\" encoding=\" utf-8\" ?>" );
898
+ writer .println ("<LinearLayout xmlns:android=\" http://schemas.android.com/apk/res/android\" " );
899
+ writer .println (" android:orientation=\" vertical\" " );
900
+ writer .println (" android:layout_width=\" fill_parent\" " );
901
+ writer .println (" android:layout_height=\" fill_parent\" >" );
902
+ writer .println ("</LinearLayout>" );
903
+ }
890
904
891
905
892
906
// This recommended to be a string resource so that it can be localized.
0 commit comments