mirror of
https://github.com/setube/ogame-vue-ts.git
synced 2026-05-12 07:55:11 +08:00
补全翻译
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
package games.wenzi.ogame;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.animation.AccelerateDecelerateInterpolator;
|
||||
import android.webkit.WebChromeClient;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
@@ -22,6 +27,29 @@ public class MainActivity extends BridgeActivity {
|
||||
// 保持 SplashScreen 直到 WebView 加载完成
|
||||
splashScreen.setKeepOnScreenCondition(() -> !isWebViewReady);
|
||||
|
||||
// 设置淡出退出动画
|
||||
splashScreen.setOnExitAnimationListener(splashScreenView -> {
|
||||
// 创建淡出动画
|
||||
ObjectAnimator fadeOut = ObjectAnimator.ofFloat(
|
||||
splashScreenView.getView(),
|
||||
View.ALPHA,
|
||||
1f,
|
||||
0f
|
||||
);
|
||||
fadeOut.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||
fadeOut.setDuration(300);
|
||||
|
||||
// 动画结束后移除 SplashScreen
|
||||
fadeOut.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
splashScreenView.remove();
|
||||
}
|
||||
});
|
||||
|
||||
fadeOut.start();
|
||||
});
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
Window window = getWindow();
|
||||
|
||||
9
android/app/src/main/res/drawable/splash_icon.xml
Normal file
9
android/app/src/main/res/drawable/splash_icon.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 启动画面专用图标,使用较小的尺寸避免模糊 -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:width="96dp"
|
||||
android:height="96dp"
|
||||
android:gravity="center"
|
||||
android:drawable="@mipmap/ic_launcher_foreground" />
|
||||
</layer-list>
|
||||
@@ -22,7 +22,12 @@
|
||||
<!-- 启动画面主题 - 延长显示直到 WebView 加载完成 -->
|
||||
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
|
||||
<item name="windowSplashScreenBackground">@color/splash_background</item>
|
||||
<item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher</item>
|
||||
<!-- 使用较小的自定义图标避免模糊 -->
|
||||
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_icon</item>
|
||||
<!-- 图标大小限制 -->
|
||||
<item name="windowSplashScreenIconBackgroundColor">@color/splash_background</item>
|
||||
<!-- 退出动画时长 -->
|
||||
<item name="android:windowSplashScreenAnimationDuration">500</item>
|
||||
<item name="postSplashScreenTheme">@style/AppTheme.NoActionBar</item>
|
||||
</style>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user