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

Merge branch '56-fix-splashscreen' into 'master'

Resolve "Enable splash screen"

Closes #56

See merge request !50
parents 86c99335 47da31f1
No related branches found
Tags Release_0.0.49_49
1 merge request!50Resolve "Enable splash screen"
Pipeline #3204 passed
Showing
with 68 additions and 63 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/launch_image.png

1.57 KiB

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

988 B

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

1.86 KiB

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

3.58 KiB

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

4.86 KiB

<?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=0.0.48
app.versionCode=48
app.versionName=0.0.49
app.versionCode=49
Enable launch screen with image
Activation de l'écran de chargement avec image
......@@ -8,34 +8,47 @@ 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
scour \
--remove-descriptive-elements \
--enable-id-stripping \
--enable-viewboxing \
--enable-comment-stripping \
--nindent=4 \
--quiet \
-i ${SOURCE}.tmp \
-o ${SOURCE}
rm ${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 \
--enable-viewboxing \
--enable-comment-stripping \
--nindent=4 \
--quiet \
-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"
......@@ -47,7 +60,7 @@ function build_icon() {
--export-width=${ICON_SIZE} \
--export-height=${ICON_SIZE} \
--export-filename=${TARGET_PNG} \
${SOURCE}
${SOURCE_ICON}
optipng ${OPTIPNG_OPTIONS} ${TARGET_PNG}
}
......@@ -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_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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment