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
ac3bc276
Commit
ac3bc276
authored
Jun 02, 2020
by
shaode.lsd
Committed by
justin
Jun 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pick from support banch
f3aff2af
parent
c2f75ac5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
17 deletions
+39
-17
.gitignore
.gitignore
+1
-0
android/src/main/java/com/idlefish/flutterboost/XPlatformPlugin.java
.../main/java/com/idlefish/flutterboost/XPlatformPlugin.java
+9
-10
android/src/main/java/com/idlefish/flutterboost/containers/BoostFlutterActivity.java
...dlefish/flutterboost/containers/BoostFlutterActivity.java
+3
-2
android/src/main/java/com/idlefish/flutterboost/containers/BoostViewUtils.java
.../com/idlefish/flutterboost/containers/BoostViewUtils.java
+24
-0
android/src/main/java/com/idlefish/flutterboost/containers/FlutterActivityAndFragmentDelegate.java
...rboost/containers/FlutterActivityAndFragmentDelegate.java
+1
-1
android/src/main/java/com/idlefish/flutterboost/containers/FlutterFragment.java
...com/idlefish/flutterboost/containers/FlutterFragment.java
+1
-4
No files found.
.gitignore
View file @
ac3bc276
...
@@ -17,3 +17,4 @@ example/android/app/.classpath
...
@@ -17,3 +17,4 @@ example/android/app/.classpath
example/android/app/.project
example/android/app/.project
example/android/.project
example/android/.project
flutter_boost
flutter_boost
.flutter-plugins-dependencies
android/src/main/java/com/idlefish/flutterboost/XPlatformPlugin.java
View file @
ac3bc276
...
@@ -28,8 +28,8 @@ public class XPlatformPlugin {
...
@@ -28,8 +28,8 @@ public class XPlatformPlugin {
public
static
final
int
DEFAULT_SYSTEM_UI
=
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
public
static
final
int
DEFAULT_SYSTEM_UI
=
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
|
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
;
|
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
;
private
Activity
activity
;
private
Activity
activity
;
private
PlatformChannel
platformChannel
;
private
PlatformChannel
platformChannel
;
private
PlatformChannel
.
SystemChromeStyle
currentTheme
;
private
PlatformChannel
.
SystemChromeStyle
currentTheme
;
private
int
mEnabledOverlays
;
private
int
mEnabledOverlays
;
...
@@ -95,26 +95,25 @@ public class XPlatformPlugin {
...
@@ -95,26 +95,25 @@ public class XPlatformPlugin {
}
}
};
};
public
XPlatformPlugin
(
PlatformChannel
platformChannel
)
{
public
XPlatformPlugin
(
PlatformChannel
platformChannel
)
{
this
.
platformChannel
=
platformChannel
;
this
.
platformChannel
=
platformChannel
;
this
.
platformChannel
.
setPlatformMessageHandler
(
mPlatformMessageHandler
);
mEnabledOverlays
=
DEFAULT_SYSTEM_UI
;
mEnabledOverlays
=
DEFAULT_SYSTEM_UI
;
}
}
public
void
attachToActivity
(
Activity
activity
){
public
void
attachToActivity
(
Activity
activity
){
this
.
activity
=
activity
;
this
.
activity
=
activity
;
this
.
platformChannel
.
setPlatformMessageHandler
(
mPlatformMessageHandler
);
}
}
/**
/**
* Releases all resources held by this {@code PlatformPlugin}.
* Releases all resources held by this {@code PlatformPlugin}.
* <p>
* <p>
* Do not invoke any methods on a {@code PlatformPlugin} after invoking this method.
* Do not invoke any methods on a {@code PlatformPlugin} after invoking this method.
*/
*/
public
void
detachActivity
()
{
public
void
detachActivity
(
Activity
activity
)
{
this
.
activity
=
null
;
if
(
activity
==
this
.
activity
)
{
this
.
mPlatformMessageHandler
=
null
;
this
.
activity
=
null
;
}
}
}
private
void
playSystemSound
(
PlatformChannel
.
SoundType
soundType
)
{
private
void
playSystemSound
(
PlatformChannel
.
SoundType
soundType
)
{
...
...
android/src/main/java/com/idlefish/flutterboost/containers/BoostFlutterActivity.java
View file @
ac3bc276
...
@@ -56,6 +56,7 @@ public class BoostFlutterActivity extends Activity
...
@@ -56,6 +56,7 @@ public class BoostFlutterActivity extends Activity
// Default configuration.
// Default configuration.
protected
static
final
String
DEFAULT_BACKGROUND_MODE
=
BackgroundMode
.
opaque
.
name
();
protected
static
final
String
DEFAULT_BACKGROUND_MODE
=
BackgroundMode
.
opaque
.
name
();
private
static
XPlatformPlugin
sXPlatformPlugin
;
public
static
Intent
createDefaultIntent
(
@NonNull
Context
launchContext
)
{
public
static
Intent
createDefaultIntent
(
@NonNull
Context
launchContext
)
{
return
withNewEngine
().
build
(
launchContext
);
return
withNewEngine
().
build
(
launchContext
);
...
@@ -440,8 +441,8 @@ public class BoostFlutterActivity extends Activity
...
@@ -440,8 +441,8 @@ public class BoostFlutterActivity extends Activity
@Nullable
@Nullable
@Override
@Override
public
XPlatformPlugin
providePlatformPlugin
(
@NonNull
FlutterEngine
flutterEngine
)
{
public
XPlatformPlugin
providePlatformPlugin
(
@NonNull
FlutterEngine
flutterEngine
)
{
return
new
XPlatformPlugin
(
flutterEngine
.
getPlatformChannel
());
return
BoostViewUtils
.
getPlatformPlugin
(
flutterEngine
.
getPlatformChannel
());
}
}
/**
/**
...
...
android/src/main/java/com/idlefish/flutterboost/containers/BoostViewUtils.java
0 → 100644
View file @
ac3bc276
package
com.idlefish.flutterboost.containers
;
import
com.idlefish.flutterboost.XPlatformPlugin
;
import
io.flutter.embedding.engine.systemchannels.PlatformChannel
;
class
BoostViewUtils
{
private
static
volatile
XPlatformPlugin
mInstance
;
private
BoostViewUtils
()
{
}
public
static
XPlatformPlugin
getPlatformPlugin
(
PlatformChannel
channel
)
{
if
(
mInstance
==
null
)
{
synchronized
(
BoostViewUtils
.
class
)
{
if
(
mInstance
==
null
)
{
mInstance
=
new
XPlatformPlugin
(
channel
);
}
}
}
return
mInstance
;
}
}
android/src/main/java/com/idlefish/flutterboost/containers/FlutterActivityAndFragmentDelegate.java
View file @
ac3bc276
...
@@ -230,7 +230,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
...
@@ -230,7 +230,7 @@ public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer
// Null out the platformPlugin to avoid a possible retain cycle between the plugin, this Fragment,
// Null out the platformPlugin to avoid a possible retain cycle between the plugin, this Fragment,
// and this Fragment's Activity.
// and this Fragment's Activity.
if
(
platformPlugin
!=
null
)
{
if
(
platformPlugin
!=
null
)
{
platformPlugin
.
detachActivity
();
platformPlugin
.
detachActivity
(
getContextActivity
()
);
platformPlugin
=
null
;
platformPlugin
=
null
;
}
}
...
...
android/src/main/java/com/idlefish/flutterboost/containers/FlutterFragment.java
View file @
ac3bc276
...
@@ -14,13 +14,11 @@ import androidx.fragment.app.Fragment;
...
@@ -14,13 +14,11 @@ import androidx.fragment.app.Fragment;
import
androidx.fragment.app.FragmentActivity
;
import
androidx.fragment.app.FragmentActivity
;
import
com.idlefish.flutterboost.FlutterBoost
;
import
com.idlefish.flutterboost.FlutterBoost
;
import
com.idlefish.flutterboost.Utils
;
import
com.idlefish.flutterboost.XFlutterView
;
import
com.idlefish.flutterboost.XFlutterView
;
import
com.idlefish.flutterboost.XPlatformPlugin
;
import
com.idlefish.flutterboost.XPlatformPlugin
;
import
io.flutter.embedding.android.*
;
import
io.flutter.embedding.android.*
;
import
io.flutter.embedding.engine.FlutterEngine
;
import
io.flutter.embedding.engine.FlutterEngine
;
import
io.flutter.embedding.engine.FlutterShellArgs
;
import
io.flutter.embedding.engine.FlutterShellArgs
;
import
io.flutter.plugin.platform.PlatformPlugin
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -469,8 +467,7 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm
...
@@ -469,8 +467,7 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm
@Nullable
@Nullable
@Override
@Override
public
XPlatformPlugin
providePlatformPlugin
(
@NonNull
FlutterEngine
flutterEngine
)
{
public
XPlatformPlugin
providePlatformPlugin
(
@NonNull
FlutterEngine
flutterEngine
)
{
return
new
XPlatformPlugin
(
flutterEngine
.
getPlatformChannel
());
return
BoostViewUtils
.
getPlatformPlugin
(
flutterEngine
.
getPlatformChannel
());
}
}
/**
/**
...
...
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