diff --git a/cargo-apk/CHANGELOG.md b/cargo-apk/CHANGELOG.md index 74e314e6..a4dbc248 100644 --- a/cargo-apk/CHANGELOG.md +++ b/cargo-apk/CHANGELOG.md @@ -1,5 +1,9 @@ # Unreleased +# 0.5.5 (2020-11-21) + +- Updated to use [ndk-build 0.1.3](../ndk-build/CHANGELOG.md#012-2020-11-21) + # 0.5.4 (2020-11-01) - Added support for activity metadata entries. diff --git a/cargo-apk/Cargo.toml b/cargo-apk/Cargo.toml index 446948f7..a8d1cbe0 100644 --- a/cargo-apk/Cargo.toml +++ b/cargo-apk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-apk" -version = "0.5.4" +version = "0.5.5" authors = ["The Rust Windowing contributors"] edition = "2018" description = "Helps cargo build APKs" @@ -16,7 +16,7 @@ cargo-subcommand = "0.4.6" dunce = "1.0" env_logger = "0.7.1" log = "0.4.8" -ndk-build = { path = "../ndk-build", version = "0.1.2" } +ndk-build = { path = "../ndk-build", version = "0.1.3" } serde = "1.0.104" thiserror = "1.0" toml = "0.5.6" diff --git a/cargo-apk/README.md b/cargo-apk/README.md index e44a4cb4..23262de5 100644 --- a/cargo-apk/README.md +++ b/cargo-apk/README.md @@ -43,6 +43,11 @@ icon = "@mipmap/ic_launcher" # Defaults to false. fullscreen = false +# Set the instruction of how the activity should be launched +# See https://developer.android.com/guide/topics/manifest/activity-element#lmode +# Defaults to standard. +launch_mode = "standard" + # Set the minimum required OpenGL ES version. # Defaults to [3, 1] opengles_version = [3, 0] diff --git a/ndk-build/CHANGELOG.md b/ndk-build/CHANGELOG.md index d21c3c64..4a003845 100644 --- a/ndk-build/CHANGELOG.md +++ b/ndk-build/CHANGELOG.md @@ -1,5 +1,9 @@ # Unreleased +# 0.1.3 (2020-11-21) + +- `android:launchMode` is configurable. + # 0.1.2 (2020-09-15) - `android:label` is configurable. diff --git a/ndk-build/Cargo.toml b/ndk-build/Cargo.toml index b79f19b6..8f90b2fa 100644 --- a/ndk-build/Cargo.toml +++ b/ndk-build/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ndk-build" -version = "0.1.2" +version = "0.1.3" authors = ["The Rust Windowing contributors"] edition = "2018" description = "Utilities for building Android binaries" diff --git a/ndk-build/src/apk.rs b/ndk-build/src/apk.rs index f8c44fa7..02900236 100644 --- a/ndk-build/src/apk.rs +++ b/ndk-build/src/apk.rs @@ -67,6 +67,7 @@ impl ApkConfig { icon: metadata.icon, fullscreen: metadata.fullscreen.unwrap_or(false), orientation: metadata.orientation, + launch_mode: metadata.launch_mode, application_metadatas, activity_metadatas, }; diff --git a/ndk-build/src/config.rs b/ndk-build/src/config.rs index dc0f7734..6d222b21 100644 --- a/ndk-build/src/config.rs +++ b/ndk-build/src/config.rs @@ -28,6 +28,7 @@ pub struct Metadata { pub icon: Option, pub fullscreen: Option, pub orientation: Option, + pub launch_mode: Option, pub opengles_version: Option<(u8, u8)>, pub feature: Option>, pub permission: Option>, diff --git a/ndk-build/src/manifest.rs b/ndk-build/src/manifest.rs index 6d858d50..eed98398 100644 --- a/ndk-build/src/manifest.rs +++ b/ndk-build/src/manifest.rs @@ -19,6 +19,7 @@ pub struct Manifest { pub icon: Option, pub fullscreen: bool, pub orientation: Option, + pub launch_mode: Option, pub debuggable: bool, pub split: Option, pub application_metadatas: Vec, @@ -48,6 +49,7 @@ impl Manifest { }; let orientation = self.orientation.as_deref().unwrap_or("unspecified"); + let launch_mode = self.launch_mode.as_deref().unwrap_or("standard"); let features: Vec = self.features.iter().map(|f| f.to_string()).collect(); let permissions: Vec = self.permissions.iter().map(|p| p.to_string()).collect(); @@ -88,6 +90,7 @@ impl Manifest { android:name="android.app.NativeActivity" android:label="{package_label}" android:screenOrientation="{orientation}" + android:launchMode="{launch_mode}" android:configChanges="orientation|keyboardHidden|screenSize"> {activity_metadatas} @@ -111,6 +114,7 @@ impl Manifest { icon = icon, fullscreen = fullscreen, orientation = orientation, + launch_mode = launch_mode, application_metadatas = application_metadatas.join("\n"), activity_metadatas = activity_metadatas.join("\n"), debuggable = self.debuggable,