Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,5 @@ flutter {
dependencies {
// Dependency required by flutter_local_notifications package
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
implementation("androidx.core:core-splashscreen:1.0.1")
}
10 changes: 2 additions & 8 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,13 @@
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:theme="@style/SplashTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:resizeableActivity="false"
android:supportsPictureInPicture="false"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"/>
Comment on lines -32 to -38
Copy link
Contributor Author

@poliver poliver Jun 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to no longer be necessary with Flutter 2.5 based on a note here. This meta data is not applied in the corresponding sample app.


<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package org.lichess.mobileV2
import android.app.ActivityManager
import android.content.Context
import android.graphics.Rect
import android.os.Bundle
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.core.view.ViewCompat
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
Expand All @@ -12,6 +14,11 @@ class MainActivity: FlutterActivity() {
private val GESTURES_CHANNEL = "mobile.lichess.org/gestures_exclusion"
private val SYSTEM_CHANNEL = "mobile.lichess.org/system"

override fun onCreate(savedInstanceState: Bundle?) {
installSplashScreen()
super.onCreate(savedInstanceState)
}

override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, GESTURES_CHANNEL).setMethodCallHandler {
Expand Down
12 changes: 12 additions & 0 deletions android/app/src/main/res/drawable-anydpi/ic_splash.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:strokeWidth="1"
android:pathData="M68.59,27C64.78,27.45 61.62,27.98 58.55,30.23C32.44,28.39 25.71,46.51 27.19,58.23C30.24,80.79 60.98,86.82 71.16,71.58C63.11,79.9 50.31,81.05 40.53,74.91C30.74,68.78 25.91,56.1 31.52,45.47C37.14,34.84 47,31.37 57.86,33.39C60.49,31.85 63.51,29.91 66.14,29.94L64.31,35.2L78.1,58.32C77.62,64.44 72.19,64.93 72.19,64.93C71.57,63.34 70.43,61.75 66.96,58.4C63.49,55.06 48.07,47.39 49.88,40.87C47.72,48.41 61.03,56.18 65.07,59.98C69.1,63.78 70.94,66.51 71.33,67.29C71.33,67.29 81.49,64.58 79.81,57.63L66.91,34.22L68.59,27Z"
android:strokeLineJoin="round"
android:fillColor="@color/ic_splash"
android:strokeColor="@color/ic_splash"/>
</vector>
Binary file not shown.
Binary file removed android/app/src/main/res/drawable-hdpi/splash.png
Binary file not shown.
Binary file not shown.
Binary file removed android/app/src/main/res/drawable-mdpi/splash.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed android/app/src/main/res/drawable-night/background.png
Binary file not shown.
9 changes: 0 additions & 9 deletions android/app/src/main/res/drawable-night/launch_background.xml

This file was deleted.

Binary file removed android/app/src/main/res/drawable-v21/background.png
Binary file not shown.
9 changes: 0 additions & 9 deletions android/app/src/main/res/drawable-v21/launch_background.xml

This file was deleted.

Binary file not shown.
Binary file removed android/app/src/main/res/drawable-xhdpi/splash.png
Binary file not shown.
Binary file not shown.
Binary file removed android/app/src/main/res/drawable-xxhdpi/splash.png
Binary file not shown.
Binary file not shown.
Binary file removed android/app/src/main/res/drawable-xxxhdpi/splash.png
Binary file not shown.
Binary file removed android/app/src/main/res/drawable/background.png
Binary file not shown.
9 changes: 0 additions & 9 deletions android/app/src/main/res/drawable/launch_background.xml

This file was deleted.

21 changes: 0 additions & 21 deletions android/app/src/main/res/values-night-v31/styles.xml

This file was deleted.

5 changes: 5 additions & 0 deletions android/app/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="bg_splash">#000000</color>
<color name="ic_splash">#FFFFFF</color>
</resources>
18 changes: 7 additions & 11 deletions android/app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Shim in the system UI overrides -->
<style name="SplashTheme.NightAdjusted" parent="Theme.SplashScreen">
<item name="android:windowLightStatusBar">false</item>
<item name="android:windowLightNavigationBar" tools:targetApi="27">false</item>
</style>

<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">@color/launch_black</item>
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
21 changes: 0 additions & 21 deletions android/app/src/main/res/values-v31/styles.xml

This file was deleted.

3 changes: 2 additions & 1 deletion android/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#131416</color>
<color name="launch_black">#131416</color>
<color name="bg_splash">#FFFFFF</color>
<color name="ic_splash">#000000</color>
</resources>
24 changes: 13 additions & 11 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Shim in the system UI overrides -->
<style name="SplashTheme.NightAdjusted" parent="Theme.SplashScreen">
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowLightNavigationBar" tools:targetApi="27">true</item>
</style>

<style name="SplashTheme" parent="SplashTheme.NightAdjusted">
<item name="windowSplashScreenBackground">@color/bg_splash</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_splash</item>
<item name="postSplashScreenTheme">@style/NormalTheme</item>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what tells Android to switch themes once the app is loaded.

</style>

<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">@color/launch_black</item>
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
Binary file removed assets/images/android12logo-black.png
Binary file not shown.
Binary file removed assets/images/android12logo-white.png
Diff not rendered.
11 changes: 4 additions & 7 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,13 @@ flutter:
generate: true

flutter_native_splash:
android: false
ios: true
web: false

color: '#ffffff'
image: assets/images/logo-black.png

color_dark: '#000000'
image_dark: assets/images/logo-white.png

android_12:
color: '#ffffff'
image: assets/images/android12logo-black.png

color_dark: '#000000'
image_dark: assets/images/android12logo-white.png