Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
flutter_boost_1.22.4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢冠章
flutter_boost_1.22.4
Commits
343191d2
Commit
343191d2
authored
Mar 16, 2020
by
justin
Committed by
GitHub
Mar 16, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #606 from mk-wang/v1.12.13-hotfixes
只在 doInitialFlutter 调用 createEngine,其他只检查mEngine
parents
e9fe2517
bfa6d1f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
android/src/main/java/com/idlefish/flutterboost/FlutterBoost.java
...src/main/java/com/idlefish/flutterboost/FlutterBoost.java
+6
-11
No files found.
android/src/main/java/com/idlefish/flutterboost/FlutterBoost.java
View file @
343191d2
...
@@ -14,12 +14,10 @@ import io.flutter.embedding.engine.dart.DartExecutor;
...
@@ -14,12 +14,10 @@ import io.flutter.embedding.engine.dart.DartExecutor;
import
io.flutter.plugin.common.PluginRegistry
;
import
io.flutter.plugin.common.PluginRegistry
;
import
io.flutter.view.FlutterMain
;
import
io.flutter.view.FlutterMain
;
import
java.lang.reflect.Method
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
public
class
FlutterBoost
{
public
class
FlutterBoost
{
private
Platform
mPlatform
;
private
Platform
mPlatform
;
private
FlutterViewContainerManager
mManager
;
private
FlutterViewContainerManager
mManager
;
...
@@ -64,7 +62,6 @@ public class FlutterBoost {
...
@@ -64,7 +62,6 @@ public class FlutterBoost {
if
(
mPlatform
.
whenEngineStart
()
==
ConfigBuilder
.
ANY_ACTIVITY_CREATED
)
{
if
(
mPlatform
.
whenEngineStart
()
==
ConfigBuilder
.
ANY_ACTIVITY_CREATED
)
{
doInitialFlutter
();
doInitialFlutter
();
}
}
}
}
@Override
@Override
...
@@ -75,7 +72,7 @@ public class FlutterBoost {
...
@@ -75,7 +72,7 @@ public class FlutterBoost {
if
(
mCurrentActiveActivity
==
null
)
{
if
(
mCurrentActiveActivity
==
null
)
{
Debuger
.
log
(
"Application entry foreground"
);
Debuger
.
log
(
"Application entry foreground"
);
if
(
createEngine
()
!=
null
)
{
if
(
mEngine
!=
null
)
{
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"type"
,
"foreground"
);
map
.
put
(
"type"
,
"foreground"
);
channel
().
sendEvent
(
"lifecycle"
,
map
);
channel
().
sendEvent
(
"lifecycle"
,
map
);
...
@@ -107,7 +104,7 @@ public class FlutterBoost {
...
@@ -107,7 +104,7 @@ public class FlutterBoost {
if
(
mCurrentActiveActivity
==
activity
)
{
if
(
mCurrentActiveActivity
==
activity
)
{
Debuger
.
log
(
"Application entry background"
);
Debuger
.
log
(
"Application entry background"
);
if
(
createEngine
()
!=
null
)
{
if
(
mEngine
!=
null
)
{
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"type"
,
"background"
);
map
.
put
(
"type"
,
"background"
);
channel
().
sendEvent
(
"lifecycle"
,
map
);
channel
().
sendEvent
(
"lifecycle"
,
map
);
...
@@ -131,7 +128,7 @@ public class FlutterBoost {
...
@@ -131,7 +128,7 @@ public class FlutterBoost {
if
(
mCurrentActiveActivity
==
activity
)
{
if
(
mCurrentActiveActivity
==
activity
)
{
Debuger
.
log
(
"Application entry background"
);
Debuger
.
log
(
"Application entry background"
);
if
(
createEngine
()
!=
null
)
{
if
(
mEngine
!=
null
)
{
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"type"
,
"background"
);
map
.
put
(
"type"
,
"background"
);
channel
().
sendEvent
(
"lifecycle"
,
map
);
channel
().
sendEvent
(
"lifecycle"
,
map
);
...
@@ -152,9 +149,9 @@ public class FlutterBoost {
...
@@ -152,9 +149,9 @@ public class FlutterBoost {
}
}
public
void
doInitialFlutter
()
{
public
void
doInitialFlutter
()
{
if
(
mEngine
!=
null
)
{
return
;
if
(
mEngine
!=
null
)
return
;
}
if
(
mPlatform
.
lifecycleListener
!=
null
)
{
if
(
mPlatform
.
lifecycleListener
!=
null
)
{
mPlatform
.
lifecycleListener
.
beforeCreateEngine
();
mPlatform
.
lifecycleListener
.
beforeCreateEngine
();
...
@@ -176,7 +173,6 @@ public class FlutterBoost {
...
@@ -176,7 +173,6 @@ public class FlutterBoost {
);
);
flutterEngine
.
getDartExecutor
().
executeDartEntrypoint
(
entrypoint
);
flutterEngine
.
getDartExecutor
().
executeDartEntrypoint
(
entrypoint
);
}
}
...
@@ -312,7 +308,6 @@ public class FlutterBoost {
...
@@ -312,7 +308,6 @@ public class FlutterBoost {
private
FlutterEngine
createEngine
()
{
private
FlutterEngine
createEngine
()
{
if
(
mEngine
==
null
)
{
if
(
mEngine
==
null
)
{
FlutterMain
.
startInitialization
(
mPlatform
.
getApplication
());
FlutterMain
.
startInitialization
(
mPlatform
.
getApplication
());
FlutterShellArgs
flutterShellArgs
=
new
FlutterShellArgs
(
new
String
[
0
]);
FlutterShellArgs
flutterShellArgs
=
new
FlutterShellArgs
(
new
String
[
0
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment