feat:fix when reloading call onCreate and onShow
This commit is contained in:
parent
eb6ba3ee36
commit
d713b04d51
@ -36,4 +36,5 @@ dependencies {
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'
|
||||
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0'
|
||||
implementation "com.qmuiteam:qmui:1.4.0"
|
||||
}
|
||||
|
@ -43,7 +43,6 @@ public class MainActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_main);
|
||||
final DoricSwipeLayout swipeLayout = findViewById(R.id.swipe_layout);
|
||||
swipeLayout.setOnRefreshListener(new DoricSwipeLayout.OnRefreshListener() {
|
||||
@ -64,6 +63,9 @@ public class MainActivity extends AppCompatActivity {
|
||||
String[] demos = getAssets().list("src");
|
||||
List<String> ret = new ArrayList<>();
|
||||
for (String str : demos) {
|
||||
if (str.endsWith(".es5.js")) {
|
||||
continue;
|
||||
}
|
||||
if (str.endsWith("js")) {
|
||||
ret.add(str);
|
||||
}
|
||||
|
@ -186,6 +186,7 @@ public class DoricContext {
|
||||
this.script = script;
|
||||
this.mRootNode.setId("");
|
||||
getDriver().createContext(mContextId, script, source);
|
||||
callEntity(DoricConstant.DORIC_ENTITY_CREATE);
|
||||
callEntity(DoricConstant.DORIC_ENTITY_INIT, this.initParams, extra);
|
||||
onShow();
|
||||
}
|
||||
|
@ -92,7 +92,8 @@ - (void)reload:(NSString *)script {
|
||||
self.rootNode.viewId = nil;
|
||||
self.script = script;
|
||||
[self.driver createContext:self.contextId script:script source:self.source];
|
||||
[self callEntity:DORIC_ENTITY_INIT, self.initialParams, nil];
|
||||
[self callEntity:DORIC_ENTITY_CREATE, nil];
|
||||
[self callEntity:DORIC_ENTITY_INIT, self.initialParams, self.extra, nil];
|
||||
[self onShow];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user