Skip to content

Commit

Permalink
enhance: no system bars
Browse files Browse the repository at this point in the history
  • Loading branch information
yadokani389 committed Jan 18, 2025
1 parent 96a96e5 commit ace06fc
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
package com.yadokani389.umegaemochi

class MainActivity : TauriActivity()
import android.os.Bundle
import androidx.core.view.WindowCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsControllerCompat

class MainActivity : TauriActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

// Allow content to extend under the system bars
WindowCompat.setDecorFitsSystemWindows(window, false)

// Get the insets controller to manage system UI
val windowInsetsController = WindowCompat.getInsetsController(window, window.decorView)

// Hide the status bar and navigation bar
windowInsetsController.hide(WindowInsetsCompat.Type.systemBars())

// Show the system bars when swiping from the edge
windowInsetsController.systemBarsBehavior =
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.umegaemochi" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
</resources>
</resources>
4 changes: 2 additions & 2 deletions src-tauri/gen/android/app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.umegaemochi" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
</resources>
</resources>

0 comments on commit ace06fc

Please sign in to comment.