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

Merge branch '19-fix-splash-screen' into 'master'

Resolve "Enable splash screen"

Closes #19

See merge request !17
parents feccb01d db96d343
No related branches found
No related tags found
1 merge request!17Resolve "Enable splash screen"
Pipeline #3416 passed
Showing with 70 additions and 44 deletions
<?xml version="1.0" encoding="utf-8"?> <?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"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" /> <item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here --> <item>
<!-- <item>
<bitmap <bitmap
android:gravity="center" android:gravity="center"
android:src="@mipmap/launch_image" /> android:src="@mipmap/launch_image" />
</item> --> </item>
</layer-list> </layer-list>
android/app/src/main/res/mipmap-hdpi/launch_image.png

2.31 KiB

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

1.44 KiB

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

2.99 KiB

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

4.75 KiB

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

6.47 KiB

<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> <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> <item name="android:windowBackground">@drawable/launch_background</item>
</style> </style>
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources> </resources>
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
app.versionName=1.0.12 app.versionName=1.0.13
app.versionCode=13 app.versionCode=14
Enable launch screen with image
Activation de l'écran de chargement avec image
...@@ -8,21 +8,28 @@ command -v optipng >/dev/null 2>&1 || { echo >&2 "I require optipng but it's not ...@@ -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)" CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
BASE_DIR="$(dirname "${CURRENT_DIR}")" BASE_DIR="$(dirname "${CURRENT_DIR}")"
SOURCE="${CURRENT_DIR}/icon.svg" SOURCE_ICON="${CURRENT_DIR}/icon.svg"
SOURCE_FASTLANE="${CURRENT_DIR}/featureGraphic.svg" SOURCE_FASTLANE="${CURRENT_DIR}/featureGraphic.svg"
SOURCE_LAUNCH_IMAGE="${CURRENT_DIR}/icon.svg"
OPTIPNG_OPTIONS="-preserve -quiet -o7" OPTIPNG_OPTIONS="-preserve -quiet -o7"
if [ ! -f "${SOURCE}" ]; then if [ ! -f "${SOURCE_ICON}" ]; then
echo "Missing file: ${SOURCE}" echo "Missing file: ${SOURCE_ICON}"
fi fi
if [ ! -f "${SOURCE_FASTLANE}" ]; then if [ ! -f "${SOURCE_FASTLANE}" ]; then
echo "Missing file: ${SOURCE_FASTLANE}" echo "Missing file: ${SOURCE_FASTLANE}"
fi fi
# optimize svg if [ ! -f "${SOURCE_LAUNCH_IMAGE}" ]; then
cp ${SOURCE} ${SOURCE}.tmp echo "Missing file: ${SOURCE_LAUNCH_IMAGE}"
fi
function optimize_svg() {
SVG="$1"
cp ${SVG} ${SVG}.tmp
scour \ scour \
--remove-descriptive-elements \ --remove-descriptive-elements \
--enable-id-stripping \ --enable-id-stripping \
...@@ -30,12 +37,18 @@ scour \ ...@@ -30,12 +37,18 @@ scour \
--enable-comment-stripping \ --enable-comment-stripping \
--nindent=4 \ --nindent=4 \
--quiet \ --quiet \
-i ${SOURCE}.tmp \ -i ${SVG}.tmp \
-o ${SOURCE} -o ${SVG}
rm ${SOURCE}.tmp rm ${SVG}.tmp
}
# optimize source svg files
optimize_svg ${SOURCE_ICON}
optimize_svg ${SOURCE_FASTLANE}
optimize_svg ${SOURCE_LAUNCH_IMAGE}
# build icons # build icons
function build_icon() { function build_application_icon() {
ICON_SIZE="$1" ICON_SIZE="$1"
TARGET="$2" TARGET="$2"
...@@ -47,7 +60,7 @@ function build_icon() { ...@@ -47,7 +60,7 @@ function build_icon() {
--export-width=${ICON_SIZE} \ --export-width=${ICON_SIZE} \
--export-height=${ICON_SIZE} \ --export-height=${ICON_SIZE} \
--export-filename=${TARGET_PNG} \ --export-filename=${TARGET_PNG} \
${SOURCE} ${SOURCE_ICON}
optipng ${OPTIPNG_OPTIONS} ${TARGET_PNG} optipng ${OPTIPNG_OPTIONS} ${TARGET_PNG}
} }
...@@ -60,18 +73,6 @@ function build_fastlane_image() { ...@@ -60,18 +73,6 @@ function build_fastlane_image() {
echo "Building ${TARGET}" 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" TARGET_PNG="${TARGET}.png"
inkscape \ inkscape \
...@@ -83,11 +84,35 @@ function build_fastlane_image() { ...@@ -83,11 +84,35 @@ function build_fastlane_image() {
optipng ${OPTIPNG_OPTIONS} ${TARGET_PNG} optipng ${OPTIPNG_OPTIONS} ${TARGET_PNG}
} }
build_icon 72 ${BASE_DIR}/android/app/src/main/res/mipmap-hdpi/ic_launcher # build launch images (splash screen)
build_icon 48 ${BASE_DIR}/android/app/src/main/res/mipmap-mdpi/ic_launcher function build_launch_image() {
build_icon 96 ${BASE_DIR}/android/app/src/main/res/mipmap-xhdpi/ic_launcher ICON_SIZE="$1"
build_icon 144 ${BASE_DIR}/android/app/src/main/res/mipmap-xxhdpi/ic_launcher TARGET="$2"
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 echo "Building ${TARGET}"
TARGET_PNG="${TARGET}.png"
inkscape \
--export-width=${ICON_SIZE} \
--export-height=${ICON_SIZE} \
--export-filename=${TARGET_PNG} \
${SOURCE_LAUNCH_IMAGE}
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 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