From bcd1dd88443eb82819a5654fcb1c6bc200e1a2fb Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Sat, 14 Mar 2020 17:47:38 +0800 Subject: [PATCH] update cli template --- .../java/pub/doric/example/MainActivity.java | 15 ++++----------- .../app/src/main/res/layout/activity_main.xml | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/doric-cli/target/android/app/src/main/java/pub/doric/example/MainActivity.java b/doric-cli/target/android/app/src/main/java/pub/doric/example/MainActivity.java index 423fb76e..5b4ebd8a 100644 --- a/doric-cli/target/android/app/src/main/java/pub/doric/example/MainActivity.java +++ b/doric-cli/target/android/app/src/main/java/pub/doric/example/MainActivity.java @@ -1,24 +1,17 @@ package pub.doric.example; - import android.os.Bundle; -import androidx.appcompat.app.AppCompatActivity; - -import pub.doric.DoricFragment; +import pub.doric.DoricActivity; public class MainActivity extends AppCompatActivity { private final String BUNDLE_NAME = "__$__"; @Override protected void onCreate(Bundle savedInstanceState) { + String source = "assets://src/" + BUNDLE_NAME + ".js"; + getIntent().putExtra("source", source); + getIntent().putExtra("alias", BUNDLE_NAME); super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - if (savedInstanceState == null) { - String source = "assets://src/" + BUNDLE_NAME + ".js"; - getIntent().putExtra("source", source); - getIntent().putExtra("alias", BUNDLE_NAME); - this.getSupportFragmentManager().beginTransaction().add(R.id.root, new DoricFragment()).commit(); - } } } diff --git a/doric-cli/target/android/app/src/main/res/layout/activity_main.xml b/doric-cli/target/android/app/src/main/res/layout/activity_main.xml index c4576e97..11345c56 100644 --- a/doric-cli/target/android/app/src/main/res/layout/activity_main.xml +++ b/doric-cli/target/android/app/src/main/res/layout/activity_main.xml @@ -1,5 +1,16 @@ - \ No newline at end of file + android:layout_height="match_parent" + android:orientation="vertical"> + + + + + \ No newline at end of file