add devkit to example app

This commit is contained in:
yao 2020-03-20 14:24:22 +08:00 committed by osborn
parent 55c5bf2a7b
commit 365b89cfa6
7 changed files with 35 additions and 8 deletions

View File

@ -19,13 +19,13 @@
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-keep class com.github.penfeizhou.doric.extension.bridge.DoricPlugin
-keep class com.github.penfeizhou.doric.extension.bridge.DoricMethod
-keep class pub.doric.extension.bridge.DoricPlugin
-keep class pub.doric.extension.bridge.DoricMethod
-keep @com.github.penfeizhou.doric.extension.bridge.DoricPlugin class * {*;}
-keep @pub.doric.extension.bridge.DoricPlugin class * {*;}
-keepclasseswithmembers @com.github.penfeizhou.doric.extension.bridge.DoricPlugin class * {*;}
-keepclasseswithmembers @pub.doric.extension.bridge.DoricPlugin class * {*;}
-keep class * {
@com.github.penfeizhou.doric.extension.bridge.DoricMethod <fields>;
@pub.doric.extension.bridge.DoricMethod <fields>;
}

View File

@ -8,6 +8,7 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:networkSecurityConfig="@xml/network_security_config"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">

View File

@ -1,8 +1,14 @@
package pub.doric.example;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import pub.doric.DoricActivity;
import androidx.appcompat.app.AppCompatActivity;
import pub.doric.DoricFragment;
import pub.doric.devkit.DoricDev;
import pub.doric.navbar.BaseDoricNavBar;
public class MainActivity extends AppCompatActivity {
private final String BUNDLE_NAME = "__$__";
@ -13,7 +19,22 @@ public class MainActivity extends AppCompatActivity {
getIntent().putExtra("source", source);
getIntent().putExtra("alias", BUNDLE_NAME);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
this.getSupportFragmentManager().beginTransaction().add(R.id.container, new DoricFragment()).commit();
BaseDoricNavBar doricNavBar = findViewById(R.id.doric_nav_bar);
doricNavBar.setBackIconVisible(false);
TextView textView = new TextView(this);
textView.setText("Devkit");
textView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DoricDev.getInstance().openDevMode();
}
});
textView.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
doricNavBar.setRight(textView);
}
}

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>

View File

@ -4005,7 +4005,7 @@ return __module.exports;
var doric_web = (function (exports, axios, sandbox) {
'use strict';
axios = axios && axios.hasOwnProperty('default') ? axios['default'] : axios;
axios = axios && Object.prototype.hasOwnProperty.call(axios, 'default') ? axios['default'] : axios;
class DoricPlugin {
constructor(context) {

File diff suppressed because one or more lines are too long

View File

@ -8,4 +8,5 @@ CURRENT_DIR=$(cd $(dirname $0); pwd)
cd $CURRENT_DIR/doric-js && npm install && npm run build
cd $CURRENT_DIR/doric-demo && npm install && npm run build
cd $CURRENT_DIR/doric-web && npm install && npm run build
cd $CURRENT_DIR/doric-cli && npm install && npm link