diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index 7e0b267630df8bceeffabea83a7caa8073d25da7..fe101ccb9356c1012ae4cd662f4fb99894fc04bf 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index ff8512c86ee89ec8896a3954ff9c681bbf1654f1..b72f6c36549352f4d197754d6157d721a0e6fac9 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 5855c1b30bc636dbcd026e09c9ce6373704d1889..71b5b8cee003105523dc9c05ff3cfe4469c9c390 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index d1c5de70d59786eb4508d8d9003fa72fe699c0d2..a5edab2a1a288d06ba5ecdbc18501512cc10871d 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 938d42b0279fbd485de1ad65224d8a1d8221bb9e..b3c5f26f8982cfdbe370d0330802290d3054376b 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/gradle.properties b/android/gradle.properties index 9a7fb493bbdeb67a67f6271e0418d25f7e2c9668..4818be8ca52a6781003f81fbeb0e73520e42eba3 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true -app.versionName=1.0.10 -app.versionCode=11 +app.versionName=1.0.11 +app.versionCode=12 diff --git a/fastlane/metadata/android/en-US/images/featureGraphic.png b/fastlane/metadata/android/en-US/images/featureGraphic.png new file mode 100644 index 0000000000000000000000000000000000000000..d94cd4c48e61c0b2a131b828585ef141878cbe03 Binary files /dev/null and b/fastlane/metadata/android/en-US/images/featureGraphic.png differ diff --git a/fastlane/metadata/android/en-US/images/icon.png b/fastlane/metadata/android/en-US/images/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f8e5c73d17fc68d3c6841a72f57681e28e9be813 Binary files /dev/null and b/fastlane/metadata/android/en-US/images/icon.png differ diff --git a/icons/build_icons.sh b/icons/build_application_icons.sh similarity index 56% rename from icons/build_icons.sh rename to icons/build_application_icons.sh index 279506f63ef1b63ba907c16160e895798baaee8c..7d5ebb61276b80b4034edfc0f4703c7e60c4f5fe 100755 --- a/icons/build_icons.sh +++ b/icons/build_application_icons.sh @@ -4,14 +4,23 @@ command -v inkscape >/dev/null 2>&1 || { echo >&2 "I require inkscape but it's not installed. Aborting."; exit 1; } command -v scour >/dev/null 2>&1 || { echo >&2 "I require scour but it's not installed. Aborting."; exit 1; } command -v optipng >/dev/null 2>&1 || { echo >&2 "I require optipng but it's not installed. Aborting."; exit 1; } -command -v convert >/dev/null 2>&1 || { echo >&2 "I require convert (imagemagick) but it's not installed. Aborting."; exit 1; } CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" BASE_DIR="$(dirname "${CURRENT_DIR}")" -SOURCE="${CURRENT_DIR}/random.svg" +SOURCE="${CURRENT_DIR}/icon.svg" +SOURCE_FASTLANE="${CURRENT_DIR}/featureGraphic.svg" + OPTIPNG_OPTIONS="-preserve -quiet -o7" +if [ ! -f "${SOURCE}" ]; then + echo "Missing file: ${SOURCE}" +fi + +if [ ! -f "${SOURCE_FASTLANE}" ]; then + echo "Missing file: ${SOURCE_FASTLANE}" +fi + # optimize svg cp ${SOURCE} ${SOURCE}.tmp scour \ @@ -20,6 +29,7 @@ scour \ --enable-viewboxing \ --enable-comment-stripping \ --nindent=4 \ + --quiet \ -i ${SOURCE}.tmp \ -o ${SOURCE} rm ${SOURCE}.tmp @@ -29,6 +39,8 @@ function build_icon() { ICON_SIZE="$1" TARGET="$2" + echo "Building ${TARGET}" + TARGET_PNG="${TARGET}.png" inkscape \ @@ -40,9 +52,42 @@ function build_icon() { optipng ${OPTIPNG_OPTIONS} ${TARGET_PNG} } +# build fastlane image +function build_fastlane_image() { + WIDTH="$1" + HEIGHT="$2" + TARGET="$3" + + 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 \ + --export-width=${WIDTH} \ + --export-height=${HEIGHT} \ + --export-filename=${TARGET_PNG} \ + ${SOURCE_FASTLANE} + + 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_fastlane_image 1024 500 ${BASE_DIR}/fastlane/metadata/android/en-US/images/featureGraphic diff --git a/icons/build_game_icons.sh b/icons/build_game_icons.sh new file mode 100755 index 0000000000000000000000000000000000000000..218080d1eb12952690ba1e182a468f6e3cf03d65 --- /dev/null +++ b/icons/build_game_icons.sh @@ -0,0 +1,98 @@ +#! /bin/bash + +# Check dependencies +command -v inkscape >/dev/null 2>&1 || { echo >&2 "I require inkscape but it's not installed. Aborting."; exit 1; } +command -v scour >/dev/null 2>&1 || { echo >&2 "I require scour but it's not installed. Aborting."; exit 1; } +command -v optipng >/dev/null 2>&1 || { echo >&2 "I require optipng but it's not installed. Aborting."; exit 1; } + +CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +BASE_DIR="$(dirname "${CURRENT_DIR}")" +ASSETS_DIR="${BASE_DIR}/assets" + +OPTIPNG_OPTIONS="-preserve -quiet -o7" +ICON_SIZE=192 + +####################################################### + +# Game images +AVAILABLE_GAME_IMAGES=" +" + +# Settings images +AVAILABLES_GAME_SETTINGS=" +" + +####################################################### + +# optimize svg +function optimize_svg() { + SOURCE="$1" + + 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 +} + +# build icons +function build_icon() { + SOURCE="$1" + TARGET="$2" + + echo "Building ${TARGET}" + + if [ ! -f "${SOURCE}" ]; then + echo "Missing file: ${SOURCE}" + exit 1 + fi + + optimize_svg "${SOURCE}" + + inkscape \ + --export-width=${ICON_SIZE} \ + --export-height=${ICON_SIZE} \ + --export-filename=${TARGET} \ + ${SOURCE} + + optipng ${OPTIPNG_OPTIONS} ${TARGET} +} + +function build_settings_icons() { + INPUT_STRING="$1" + + SETTING_NAME="$(echo "${INPUT_STRING}" | cut -d":" -f1)" + SETTING_VALUES="$(echo "${INPUT_STRING}" | cut -d":" -f2 | tr "," " ")" + + for SETTING_VALUE in ${SETTING_VALUES} + do + SETTING_CODE="${SETTING_NAME}_${SETTING_VALUE}" + build_icon ${CURRENT_DIR}/${SETTING_CODE}.svg ${ASSETS_DIR}/icons/${SETTING_CODE}.png + done +} + +####################################################### + +# Create output folders +mkdir -p ${ASSETS_DIR}/icons + +# Delete existing generated images +find ${ASSETS_DIR}/icons -type f -name "*.png" -delete + +# build game images +for GAME_IMAGE in ${AVAILABLE_GAME_IMAGES} +do + build_icon ${CURRENT_DIR}/${GAME_IMAGE}.svg ${ASSETS_DIR}/icons/${GAME_IMAGE}.png +done + +# build settings images +for GAME_SETTING in ${AVAILABLES_GAME_SETTINGS} +do + build_settings_icons "${GAME_SETTING}" +done diff --git a/icons/featureGraphic.svg b/icons/featureGraphic.svg new file mode 100644 index 0000000000000000000000000000000000000000..2033f317c082bce27115e88ca068d358b08318d0 --- /dev/null +++ b/icons/featureGraphic.svg @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 1024 500" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect width="1024" height="500" rx="0" ry="0" fill="#977cff"/></svg> diff --git a/icons/random.svg b/icons/icon.svg similarity index 100% rename from icons/random.svg rename to icons/icon.svg diff --git a/lib/main.dart b/lib/main.dart index 3b387fa2d102d02d4bf935433a4f28c7347a9b4f..99d688f9d56215d61440201963f6da813f8decff 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -5,7 +5,6 @@ void main() { } class MyApp extends StatelessWidget { - // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( diff --git a/pubspec.lock b/pubspec.lock index 3317f5f8760ca76e88858ef443c38d580faf416e..7d27b51980f8e290e295bf9d2a7e3802ccf92fb8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -42,14 +42,14 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -73,7 +73,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -87,7 +87,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" sky_engine: dependency: transitive description: flutter @@ -99,7 +99,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -134,20 +134,13 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" + version: "0.4.9" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-0 <3.0.0" diff --git a/test/widget_test.dart b/test/widget_test.dart deleted file mode 100644 index 6729b81d7687c9c2dfccfb88141aeff5977122f9..0000000000000000000000000000000000000000 --- a/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility that Flutter provides. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:random/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -}