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
1
Merge Requests
1
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
e0374167
Commit
e0374167
authored
Sep 27, 2020
by
ColdPaleLight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
platform can provide custom flutter engine now
parent
253f2d67
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
android/src/main/java/com/idlefish/flutterboost/FlutterBoost.java
...src/main/java/com/idlefish/flutterboost/FlutterBoost.java
+20
-2
android/src/main/java/com/idlefish/flutterboost/Platform.java
...oid/src/main/java/com/idlefish/flutterboost/Platform.java
+6
-0
No files found.
android/src/main/java/com/idlefish/flutterboost/FlutterBoost.java
View file @
e0374167
...
@@ -9,6 +9,8 @@ import android.os.Bundle;
...
@@ -9,6 +9,8 @@ import android.os.Bundle;
import
android.support.annotation.NonNull
;
import
android.support.annotation.NonNull
;
import
com.idlefish.flutterboost.interfaces.*
;
import
com.idlefish.flutterboost.interfaces.*
;
import
io.flutter.embedding.android.FlutterEngineProvider
;
import
io.flutter.embedding.android.FlutterView
;
import
io.flutter.embedding.android.FlutterView
;
import
io.flutter.embedding.engine.FlutterEngine
;
import
io.flutter.embedding.engine.FlutterEngine
;
import
io.flutter.embedding.engine.FlutterJNI
;
import
io.flutter.embedding.engine.FlutterJNI
;
...
@@ -216,6 +218,8 @@ public class FlutterBoost {
...
@@ -216,6 +218,8 @@ public class FlutterBoost {
private
BoostLifecycleListener
lifecycleListener
;
private
BoostLifecycleListener
lifecycleListener
;
private
FlutterEngineProvider
flutterEngineProvider
=
null
;
...
@@ -255,6 +259,11 @@ public class FlutterBoost {
...
@@ -255,6 +259,11 @@ public class FlutterBoost {
return
this
;
return
this
;
}
}
public
ConfigBuilder
flutterEngineProvider
(
FlutterEngineProvider
flutterEngineProvider
)
{
this
.
flutterEngineProvider
=
flutterEngineProvider
;
return
this
;
}
public
Platform
build
()
{
public
Platform
build
()
{
Platform
platform
=
new
Platform
()
{
Platform
platform
=
new
Platform
()
{
...
@@ -286,11 +295,14 @@ public class FlutterBoost {
...
@@ -286,11 +295,14 @@ public class FlutterBoost {
public
FlutterView
.
RenderMode
renderMode
()
{
public
FlutterView
.
RenderMode
renderMode
()
{
return
ConfigBuilder
.
this
.
renderMode
;
return
ConfigBuilder
.
this
.
renderMode
;
}
}
public
FlutterEngineProvider
flutterEngineProvider
()
{
return
flutterEngineProvider
;
}
};
};
platform
.
lifecycleListener
=
this
.
lifecycleListener
;
platform
.
lifecycleListener
=
this
.
lifecycleListener
;
return
platform
;
return
platform
;
}
}
}
}
...
@@ -323,8 +335,14 @@ public class FlutterBoost {
...
@@ -323,8 +335,14 @@ public class FlutterBoost {
FlutterShellArgs
flutterShellArgs
=
new
FlutterShellArgs
(
new
String
[
0
]);
FlutterShellArgs
flutterShellArgs
=
new
FlutterShellArgs
(
new
String
[
0
]);
FlutterMain
.
ensureInitializationComplete
(
FlutterMain
.
ensureInitializationComplete
(
mPlatform
.
getApplication
().
getApplicationContext
(),
flutterShellArgs
.
toArray
());
mPlatform
.
getApplication
().
getApplicationContext
(),
flutterShellArgs
.
toArray
());
if
(
mPlatform
.
flutterEngineProvider
()
!=
null
)
{
mEngine
=
mPlatform
.
flutterEngineProvider
().
provideFlutterEngine
(
mPlatform
.
getApplication
().
getApplicationContext
());
}
if
(
mEngine
==
null
)
{
mEngine
=
new
FlutterEngine
(
mPlatform
.
getApplication
().
getApplicationContext
(),
FlutterLoader
.
getInstance
(),
new
FlutterJNI
(),
null
,
false
);
}
mEngine
=
new
FlutterEngine
(
mPlatform
.
getApplication
().
getApplicationContext
(),
FlutterLoader
.
getInstance
(),
new
FlutterJNI
(),
null
,
false
);
// registerPlugins(mEngine);
// registerPlugins(mEngine);
mRegistry
=
new
BoostPluginRegistry
(
createEngine
());
mRegistry
=
new
BoostPluginRegistry
(
createEngine
());
mPlatform
.
registerPlugins
(
mRegistry
);
mPlatform
.
registerPlugins
(
mRegistry
);
...
...
android/src/main/java/com/idlefish/flutterboost/Platform.java
View file @
e0374167
...
@@ -8,7 +8,9 @@ import com.idlefish.flutterboost.interfaces.IContainerRecord;
...
@@ -8,7 +8,9 @@ import com.idlefish.flutterboost.interfaces.IContainerRecord;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
import
java.util.Map
;
import
java.util.Map
;
import
io.flutter.embedding.android.FlutterEngineProvider
;
import
io.flutter.embedding.android.FlutterView
;
import
io.flutter.embedding.android.FlutterView
;
import
io.flutter.embedding.engine.FlutterEngine
;
import
io.flutter.plugin.common.PluginRegistry
;
import
io.flutter.plugin.common.PluginRegistry
;
/**
/**
...
@@ -59,4 +61,8 @@ public abstract class Platform {
...
@@ -59,4 +61,8 @@ public abstract class Platform {
Log
.
i
(
"flutterboost.platform"
,
t
.
toString
());
Log
.
i
(
"flutterboost.platform"
,
t
.
toString
());
}
}
}
}
public
FlutterEngineProvider
flutterEngineProvider
()
{
return
null
;
}
}
}
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