-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
1,639 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 30 additions & 23 deletions
53
android/src/main/kotlin/com/yuxiaor/flutter/g_faraday/FaradayFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
android/src/main/kotlin/io/flutter/embedding/android/FlutterViewSnapshotSplashScreen.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package io.flutter.embedding.android; | ||
|
||
import android.animation.Animator; | ||
import android.content.Context; | ||
import android.graphics.Bitmap; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.ImageView; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
|
||
import io.flutter.embedding.engine.FlutterEngine; | ||
|
||
public class FlutterViewSnapshotSplashScreen implements SplashScreen { | ||
|
||
@NonNull private final Bitmap flutterViewSnapshot; | ||
@Nullable private View splashView; | ||
|
||
public FlutterViewSnapshotSplashScreen(@NonNull FlutterEngine flutterEngine) { | ||
flutterViewSnapshot = flutterEngine.getRenderer().getBitmap(); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public View createSplashView(@NonNull Context context, @Nullable Bundle savedInstanceState) { | ||
ImageView splash = new ImageView(context); | ||
splash.setImageBitmap(flutterViewSnapshot); | ||
splashView = splash; | ||
return splash; | ||
} | ||
|
||
@Override | ||
public void transitionToFlutter(@NonNull final Runnable onTransitionComplete) { | ||
if (splashView == null) { | ||
onTransitionComplete.run(); | ||
return; | ||
} | ||
|
||
splashView | ||
.animate() | ||
.alpha(0.0f) | ||
.setDuration(500) | ||
.setListener( | ||
new Animator.AnimatorListener() { | ||
@Override | ||
public void onAnimationStart(Animator animation) {} | ||
|
||
@Override | ||
public void onAnimationEnd(Animator animation) { | ||
onTransitionComplete.run(); | ||
} | ||
|
||
@Override | ||
public void onAnimationCancel(Animator animation) { | ||
onTransitionComplete.run(); | ||
} | ||
|
||
@Override | ||
public void onAnimationRepeat(Animator animation) {} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.