diff --git a/README.md b/README.md index 1931c2b..6cf558a 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ You can build an Android app ready for the Play Store with the following command ```bash export KEYSTORE_PASSWORD="pass" export KEYSTORE_ALIAS_PASSWORD="word" -vab -prod --name "V App" --package-id "com.example.app.id" --icon /path/to/file.png --version-code --keystore /path/to/sign.keystore --keystore-alias "example" /path/to/v/source/file/or/dir +vab -prod --name "V App" --package-id "com.example.app.id" --icon-mipmaps --icon /path/to/file.png --version-code --keystore /path/to/sign.keystore --keystore-alias "example" /path/to/v/source/file/or/dir ``` Do not submit apps using default values. Please make sure to adhere to all [guidelines](https://developer.android.com/studio/publish) of the app store you're publishing to. diff --git a/cli/cli.v b/cli/cli.v index a930d2e..1ab59c8 100644 --- a/cli/cli.v +++ b/cli/cli.v @@ -188,6 +188,7 @@ pub fn args_to_options(arguments []string, defaults Options) !(Options, &flag.Fl activity_name: fp.string('activity-name', 0, defaults.activity_name, 'The name of the main activity (e.g. "VActivity")') icon: fp.string('icon', 0, defaults.icon, 'App icon') + icon_mipmaps: fp.bool('icon-mipmaps', 0, defaults.icon_mipmaps, 'Generate App mipmap(-xxxhdpi etc.) icons from either `--icon` or, if exists, a .png in app skeleton "res/mipmap" directory') version_code: fp.int('version-code', 0, defaults.version_code, 'Build version code (android:versionCode)') // output: fp.string('output', `o`, defaults.output, 'Path to output (dir/file)') diff --git a/cli/options.v b/cli/options.v index 40d3431..c68dd91 100644 --- a/cli/options.v +++ b/cli/options.v @@ -64,7 +64,7 @@ pub mut: c_flags []string @[long: 'cflag'; short: c; xdoc: 'Additional flags for the C compiler'] v_flags []string @[long: 'flag'; short: f; xdoc: 'Additional flags for the V compiler'] lib_name string @[ignore] // Generated field depending on names in input/flags - icon_mipmaps bool @[xdoc: 'Generate App mipmap(-xxxhdpi etc.) icons from either `--icon` or, if exists app skeleton'] + icon_mipmaps bool @[xdoc: 'Generate App mipmap(-xxxhdpi etc.) icons from either `--icon` or, if exists, a .png in app skeleton "res/mipmap" directory'] assets_extra []string @[long: 'assets'; short: a; xdoc: 'Asset dir(s) to include in build'] libs_extra []string @[long: 'libs'; short: l; xdoc: 'Lib dir(s) to include in build'] version_code int @[xdoc: 'Build version code (android:versionCode)'] diff --git a/docs/FAQ.md b/docs/FAQ.md index 220aeaa..c6c20bf 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -1,6 +1,7 @@ # Freqently Asked Questions - [Where is the `examples` folder?](#where-is-the-examples-folder) +- [Generating `mipmap-xxxhdpi` icons in the APK/AAB](#generating-mipmap-xxxhdpi-icons-in-the-apkaab) - [`vab` can't find my device when deploying?](#vab-cant-find-my-device-when-deploying) - [The app force closes/crashes when I start it?](#the-app-force-closescrashes-when-i-start-it) - [`vab` can't find my SDK/NDK/JAVA_HOME?](#vab-cant-find-my-SDKNDKJAVA_HOME) @@ -25,6 +26,19 @@ Note that not all of V's examples have been written with Android in mind and may thus fail to compile or run properly, pull requests with Android fixes are welcome. +## Generating `mipmap-xxxhdpi` icons in the APK/AAB + +Yes. Pass `--icon-mipmaps` when building your application. + +The icon mipmaps will be generated based on the image passed via `--icon /path/to/icon.png`, +or if `--icon` is *not* passed (or invalid) `vab` will try and generate the mipmaps +based on what image that may reside in the "package base files" directory's "`res/mipmap"`. + +For a vanilla build of `vab` the mipmap icons will be generated based on: +`platforms/android/res/mipmap/icon.png` + +See [Package base files](https://github.com/vlang/vab/blob/master/docs/docs.md#package-base-files) for more info. + ## `vab` can't find my device when deploying? You [need to enable debugging](https://developer.android.com/studio/command-line/adb#Enabling) on your device.