///|
/// AndroidManifest.xml
fn android_manifest_xml(c : ProjectConfig) -> String {
let theme_name = c.theme_name
let orientation = c.orientation
let package_id = c.package_id
(
#|
#|
#|
#|
#|
#|
#|
#|
#|
#|
#|
#|
#|
#|
#|
#|
#|
#|
#|
)
}
///|
/// MainActivity.kt
fn main_activity_kt(c : ProjectConfig) -> String {
let package_id = c.package_id
(
$|package com.example.\{package_id}
#|
#|import android.app.NativeActivity
#|import android.os.Bundle
#|import android.view.WindowManager
#|import androidx.core.view.WindowCompat
#|import androidx.core.view.WindowInsetsCompat
#|import androidx.core.view.WindowInsetsControllerCompat
#|
#|class MainActivity : NativeActivity() {
#|
#| override fun onCreate(savedInstanceState: Bundle?) {
#| super.onCreate(savedInstanceState)
#| window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
#| }
#|
#| override fun onWindowFocusChanged(hasFocus: Boolean) {
#| super.onWindowFocusChanged(hasFocus)
#| if (hasFocus) {
#| hideSystemUi()
#| }
#| }
#|
#| private fun hideSystemUi() {
#| val windowInsetsController = WindowCompat.getInsetsController(window, window.decorView)
#| windowInsetsController.systemBarsBehavior =
#| WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
#| windowInsetsController.hide(WindowInsetsCompat.Type.systemBars())
#| }
#|}
#|
)
}
///|
/// res/values/strings.xml
fn strings_xml(c : ProjectConfig) -> String {
let display_name = c.display_name
(
#|
$| \{display_name}
#|
#|
)
}
///|
/// res/values/themes.xml
fn themes_xml(c : ProjectConfig) -> String {
let theme_name = c.theme_name
(
#|
#|
$|
#|
#|
)
}
///|
/// res/values-night/themes.xml
fn themes_night_xml(c : ProjectConfig) -> String {
let theme_name = c.theme_name
(
#|
#|
$|
#|
#|
)
}