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
247cfe16
Commit
247cfe16
authored
Oct 17, 2019
by
yangwu.jia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决页面切换 黑一下问题
parent
765e8977
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
23 deletions
+42
-23
android/src/main/java/com/idlefish/flutterboost/containers/FlutterSplashView.java
...m/idlefish/flutterboost/containers/FlutterSplashView.java
+31
-17
android/src/main/java/com/idlefish/flutterboost/containers/NewBoostFlutterActivity.java
...fish/flutterboost/containers/NewBoostFlutterActivity.java
+10
-4
example/android/app/src/main/AndroidManifest.xml
example/android/app/src/main/AndroidManifest.xml
+1
-2
No files found.
android/src/main/java/com/idlefish/flutterboost/containers/FlutterSplashView.java
View file @
247cfe16
package
com.idlefish.flutterboost.containers
;
import
android.content.Context
;
import
android.graphics.Color
;
import
android.os.Bundle
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
...
...
@@ -43,7 +44,8 @@ public class FlutterSplashView extends FrameLayout {
@Override
public
void
onFlutterEngineAttachedToFlutterView
(
@NonNull
FlutterEngine
engine
)
{
flutterView
.
removeFlutterEngineAttachmentListener
(
this
);
displayFlutterViewWithSplash
(
flutterView
,
splashScreen
);
// displayFlutterViewWithSplash(flutterView, splashScreen);
// splashScreenTransitionNeededNow();
}
@Override
...
...
@@ -131,25 +133,37 @@ public class FlutterSplashView extends FrameLayout {
// Display the new splash screen, if needed.
if
(
splashScreen
!=
null
)
{
if
(
isSplashScreenNeededNow
())
{
Log
.
v
(
TAG
,
"Showing splash screen UI."
);
// This is the typical case. A FlutterEngine is attached to the FlutterView and we're
// waiting for the first frame to render. Show a splash UI until that happens.
splashScreenView
=
splashScreen
.
createSplashView
(
getContext
(),
splashScreenState
);
addView
(
this
.
splashScreenView
);
flutterView
.
addOnFirstFrameRenderedListener
(
onFirstFrameRenderedListener
);
}
else
if
(
isSplashScreenTransitionNeededNow
())
{
Log
.
v
(
TAG
,
"Showing an immediate splash transition to Flutter due to previously interrupted transition."
);
splashScreenView
=
splashScreen
.
createSplashView
(
getContext
(),
splashScreenState
);
addView
(
splashScreenView
);
transitionToFlutter
();
}
else
if
(!
flutterView
.
isAttachedToFlutterEngine
())
{
Log
.
v
(
TAG
,
"FlutterView is not yet attached to a FlutterEngine. Showing nothing until a FlutterEngine is attached."
);
flutterView
.
addFlutterEngineAttachmentListener
(
flutterEngineAttachmentListener
);
}
splashScreenView
=
splashScreen
.
createSplashView
(
getContext
(),
splashScreenState
);
splashScreenView
.
setBackgroundColor
(
Color
.
WHITE
);
addView
(
this
.
splashScreenView
);
flutterView
.
addOnFirstFrameRenderedListener
(
onFirstFrameRenderedListener
);
// if (splashScreen != null) {
// if (this.isSplashScreenNeededNow()) {
// Log.v(TAG, "Showing splash screen UI.");
// this.splashScreenView = splashScreen.createSplashView(this.getContext(), this.splashScreenState);
// this.addView(this.splashScreenView);
// flutterView.addOnFirstFrameRenderedListener(this.onFirstFrameRenderedListener);
// } else if (this.isSplashScreenTransitionNeededNow()) {
// Log.v(TAG, "Showing an immediate splash transition to Flutter due to previously interrupted transition.");
// this.splashScreenView = splashScreen.createSplashView(this.getContext(), this.splashScreenState);
// this.addView(this.splashScreenView);
// this.transitionToFlutter();
// } else if (!flutterView.isAttachedToFlutterEngine()) {
// Log.v(TAG, "FlutterView is not yet attached to a FlutterEngine. Showing nothing until a FlutterEngine is attached.");
// flutterView.addFlutterEngineAttachmentListener(this.flutterEngineAttachmentListener);
// }
// }
}
}
/**
* Returns true if current conditions require a splash UI to be displayed.
* <p>
...
...
android/src/main/java/com/idlefish/flutterboost/containers/NewBoostFlutterActivity.java
View file @
247cfe16
...
...
@@ -17,9 +17,8 @@ import android.os.Build;
import
android.os.Bundle
;
import
android.support.annotation.NonNull
;
import
android.support.annotation.Nullable
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.view.*
;
import
android.widget.*
;
import
com.idlefish.flutterboost.NewFlutterBoost
;
import
com.idlefish.flutterboost.Utils
;
import
io.flutter.Log
;
...
...
@@ -175,7 +174,7 @@ public class NewBoostFlutterActivity extends Activity
public
SplashScreen
provideSplashScreen
()
{
Drawable
manifestSplashDrawable
=
getSplashScreenFromManifest
();
if
(
manifestSplashDrawable
!=
null
)
{
return
new
DrawableSplashScreen
(
manifestSplashDrawable
);
return
new
DrawableSplashScreen
(
manifestSplashDrawable
,
ImageView
.
ScaleType
.
CENTER
,
500L
);
}
else
{
return
null
;
}
...
...
@@ -469,8 +468,15 @@ public class NewBoostFlutterActivity extends Activity
@Override
public
void
onFirstFrameRendered
()
{
}
@Override
public
void
finishContainer
(
Map
<
String
,
Object
>
result
)
{
Activity
activity
=
this
.
getActivity
();
...
...
example/android/app/src/main/AndroidManifest.xml
View file @
247cfe16
...
...
@@ -35,14 +35,13 @@
</activity>
<activity
android:name=
"com.idlefish.flutterboost.containers.NewBoostFlutterActivity"
android:theme=
"@style/Theme.AppCompat"
android:configChanges=
"orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated=
"true"
android:windowSoftInputMode=
"adjustResize"
>
<
!--<meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable" android:resource="@drawable/page_loading"/>--
>
<
meta-data
android:name=
"io.flutter.embedding.android.SplashScreenDrawable"
android:resource=
"@drawable/page_loading"
/
>
</activity>
<activity
...
...
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