Skip to content
Snippets Groups Projects
Commit be4b9738 authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Enable splash screen (launch screen)

parent 221c28a6
No related branches found
No related tags found
No related merge requests found
Pipeline #3129 canceled
Showing
with 65 additions and 62 deletions
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</item>
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</item>
</layer-list>
android/app/src/main/res/mipmap-hdpi/ic_launcher.png

1.89 KiB | W: | H:

android/app/src/main/res/mipmap-hdpi/ic_launcher.png

157 B | W: | H:

android/app/src/main/res/mipmap-hdpi/ic_launcher.png
android/app/src/main/res/mipmap-hdpi/ic_launcher.png
android/app/src/main/res/mipmap-hdpi/ic_launcher.png
android/app/src/main/res/mipmap-hdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
android/app/src/main/res/mipmap-hdpi/launch_image.png

157 B

android/app/src/main/res/mipmap-mdpi/ic_launcher.png

1.21 KiB | W: | H:

android/app/src/main/res/mipmap-mdpi/ic_launcher.png

155 B | W: | H:

android/app/src/main/res/mipmap-mdpi/ic_launcher.png
android/app/src/main/res/mipmap-mdpi/ic_launcher.png
android/app/src/main/res/mipmap-mdpi/ic_launcher.png
android/app/src/main/res/mipmap-mdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
android/app/src/main/res/mipmap-mdpi/launch_image.png

155 B

android/app/src/main/res/mipmap-xhdpi/ic_launcher.png

2.62 KiB | W: | H:

android/app/src/main/res/mipmap-xhdpi/ic_launcher.png

160 B | W: | H:

android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
android/app/src/main/res/mipmap-xhdpi/launch_image.png

160 B

android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png

4.05 KiB | W: | H:

android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png

168 B | W: | H:

android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
android/app/src/main/res/mipmap-xxhdpi/launch_image.png

168 B

android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png

5.68 KiB | W: | H:

android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png

170 B | W: | H:

android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
android/app/src/main/res/mipmap-xxxhdpi/launch_image.png

170 B

<?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
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</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">?android:colorBackground</item>
</style>
......
<?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
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</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.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
......
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
app.versionName=1.0.13
app.versionCode=14
app.versionName=1.0.14
app.versionCode=15
fastlane/metadata/android/en-US/images/icon.png

18.7 KiB | W: | H:

fastlane/metadata/android/en-US/images/icon.png

197 B | W: | H:

fastlane/metadata/android/en-US/images/icon.png
fastlane/metadata/android/en-US/images/icon.png
fastlane/metadata/android/en-US/images/icon.png
fastlane/metadata/android/en-US/images/icon.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -8,21 +8,28 @@ command -v optipng >/dev/null 2>&1 || { echo >&2 "I require optipng but it's not
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
BASE_DIR="$(dirname "${CURRENT_DIR}")"
SOURCE="${CURRENT_DIR}/icon.svg"
SOURCE_ICON="${CURRENT_DIR}/icon.svg"
SOURCE_FASTLANE="${CURRENT_DIR}/featureGraphic.svg"
SOURCE_LAUNCH_IMAGE="${CURRENT_DIR}/icon.svg"
OPTIPNG_OPTIONS="-preserve -quiet -o7"
if [ ! -f "${SOURCE}" ]; then
echo "Missing file: ${SOURCE}"
if [ ! -f "${SOURCE_ICON}" ]; then
echo "Missing file: ${SOURCE_ICON}"
fi
if [ ! -f "${SOURCE_FASTLANE}" ]; then
echo "Missing file: ${SOURCE_FASTLANE}"
fi
# optimize svg
cp ${SOURCE} ${SOURCE}.tmp
if [ ! -f "${SOURCE_LAUNCH_IMAGE}" ]; then
echo "Missing file: ${SOURCE_LAUNCH_IMAGE}"
fi
function optimize_svg() {
SVG="$1"
cp ${SVG} ${SVG}.tmp
scour \
--remove-descriptive-elements \
--enable-id-stripping \
......@@ -30,12 +37,18 @@ scour \
--enable-comment-stripping \
--nindent=4 \
--quiet \
-i ${SOURCE}.tmp \
-o ${SOURCE}
rm ${SOURCE}.tmp
-i ${SVG}.tmp \
-o ${SVG}
rm ${SVG}.tmp
}
# optimize source svg files
optimize_svg ${SOURCE_ICON}
optimize_svg ${SOURCE_FASTLANE}
optimize_svg ${SOURCE_LAUNCH_IMAGE}
# build icons
function build_icon() {
function build_application_icon() {
ICON_SIZE="$1"
TARGET="$2"
......@@ -60,18 +73,6 @@ function build_fastlane_image() {
echo "Building ${TARGET}"
cp ${SOURCE_FASTLANE} ${SOURCE_FASTLANE}.tmp
scour \
--remove-descriptive-elements \
--enable-id-stripping \
--enable-viewboxing \
--enable-comment-stripping \
--nindent=4 \
--quiet \
-i ${SOURCE_FASTLANE}.tmp \
-o ${SOURCE_FASTLANE}
rm ${SOURCE_FASTLANE}.tmp
TARGET_PNG="${TARGET}.png"
inkscape \
......@@ -83,11 +84,35 @@ function build_fastlane_image() {
optipng ${OPTIPNG_OPTIONS} ${TARGET_PNG}
}
build_icon 72 ${BASE_DIR}/android/app/src/main/res/mipmap-hdpi/ic_launcher
build_icon 48 ${BASE_DIR}/android/app/src/main/res/mipmap-mdpi/ic_launcher
build_icon 96 ${BASE_DIR}/android/app/src/main/res/mipmap-xhdpi/ic_launcher
build_icon 144 ${BASE_DIR}/android/app/src/main/res/mipmap-xxhdpi/ic_launcher
build_icon 192 ${BASE_DIR}/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher
build_icon 512 ${BASE_DIR}/fastlane/metadata/android/en-US/images/icon
# build launch images (splash screen)
function build_launch_image() {
ICON_SIZE="$1"
TARGET="$2"
echo "Building ${TARGET}"
TARGET_PNG="${TARGET}.png"
inkscape \
--export-width=${ICON_SIZE} \
--export-height=${ICON_SIZE} \
--export-filename=${TARGET_PNG} \
${SOURCE}
optipng ${OPTIPNG_OPTIONS} ${TARGET_PNG}
}
build_application_icon 72 ${BASE_DIR}/android/app/src/main/res/mipmap-hdpi/ic_launcher
build_application_icon 48 ${BASE_DIR}/android/app/src/main/res/mipmap-mdpi/ic_launcher
build_application_icon 96 ${BASE_DIR}/android/app/src/main/res/mipmap-xhdpi/ic_launcher
build_application_icon 144 ${BASE_DIR}/android/app/src/main/res/mipmap-xxhdpi/ic_launcher
build_application_icon 192 ${BASE_DIR}/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher
build_application_icon 512 ${BASE_DIR}/fastlane/metadata/android/en-US/images/icon
build_launch_image 72 ${BASE_DIR}/android/app/src/main/res/mipmap-hdpi/launch_image
build_launch_image 48 ${BASE_DIR}/android/app/src/main/res/mipmap-mdpi/launch_image
build_launch_image 96 ${BASE_DIR}/android/app/src/main/res/mipmap-xhdpi/launch_image
build_launch_image 144 ${BASE_DIR}/android/app/src/main/res/mipmap-xxhdpi/launch_image
build_launch_image 192 ${BASE_DIR}/android/app/src/main/res/mipmap-xxxhdpi/launch_image
build_fastlane_image 1024 500 ${BASE_DIR}/fastlane/metadata/android/en-US/images/featureGraphic
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment