diff --git a/app/src/main/java/org/oxycblt/auxio/MainActivity.kt b/app/src/main/java/org/oxycblt/auxio/MainActivity.kt index 03c9e02b3..a7b5faac6 100644 --- a/app/src/main/java/org/oxycblt/auxio/MainActivity.kt +++ b/app/src/main/java/org/oxycblt/auxio/MainActivity.kt @@ -20,7 +20,7 @@ package org.oxycblt.auxio import android.content.Intent import android.os.Bundle -import androidx.activity.enableEdgeToEdge +import android.view.View import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatDelegate @@ -53,12 +53,12 @@ class MainActivity : AppCompatActivity() { @Inject lateinit var uiSettings: UISettings override fun onCreate(savedInstanceState: Bundle?) { - enableEdgeToEdge() super.onCreate(savedInstanceState) setupTheme() // Inflate the views after setting up the theme so that the theme attributes are applied. val binding = ActivityMainBinding.inflate(layoutInflater) setContentView(binding.root) + setupEdgeToEdge(binding.root) L.d("Activity created") } @@ -95,6 +95,17 @@ class MainActivity : AppCompatActivity() { } } + private fun setupEdgeToEdge(contentView: View) { + WindowCompat.setDecorFitsSystemWindows(window, false) + contentView.setOnApplyWindowInsetsListener { view, insets -> + // Automatically inset the view to the left/right, as component support for + // these insets are highly lacking. + val bars = insets.systemBarInsetsCompat + view.updatePadding(left = bars.left, right = bars.right) + insets + } + } + /** * Transform an [Intent] given to [MainActivity] into a [DeferredPlayback] that can be used in * the playback system. diff --git a/app/src/main/res/values-night-v27/styles_core.xml b/app/src/main/res/values-night-v27/styles_core.xml new file mode 100644 index 000000000..41e8408da --- /dev/null +++ b/app/src/main/res/values-night-v27/styles_core.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-night/colors_android.xml b/app/src/main/res/values-night/colors_android.xml index fb3023ee7..36d82280f 100644 --- a/app/src/main/res/values-night/colors_android.xml +++ b/app/src/main/res/values-night/colors_android.xml @@ -1,5 +1,11 @@ + + #01000000 + @color/material_dynamic_secondary20 @color/material_dynamic_neutral90 diff --git a/app/src/main/res/values-v27/styles_core.xml b/app/src/main/res/values-v27/styles_core.xml new file mode 100644 index 000000000..562529e99 --- /dev/null +++ b/app/src/main/res/values-v27/styles_core.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-v29/styles_core.xml b/app/src/main/res/values-v29/styles_core.xml new file mode 100644 index 000000000..4fd811f41 --- /dev/null +++ b/app/src/main/res/values-v29/styles_core.xml @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/values-v31/styles_core.xml b/app/src/main/res/values-v31/styles_core.xml index b27d7450c..d538418f2 100644 --- a/app/src/main/res/values-v31/styles_core.xml +++ b/app/src/main/res/values-v31/styles_core.xml @@ -1,7 +1,7 @@ - diff --git a/app/src/main/res/values/colors_android.xml b/app/src/main/res/values/colors_android.xml index f94ea37f9..f107ae056 100644 --- a/app/src/main/res/values/colors_android.xml +++ b/app/src/main/res/values/colors_android.xml @@ -1,5 +1,14 @@ + + #80000000 + + + #01ffffff + @color/material_dynamic_primary95 @color/material_dynamic_neutral20 diff --git a/app/src/main/res/values/styles_core.xml b/app/src/main/res/values/styles_core.xml index 9164374c3..6cc3b58da 100644 --- a/app/src/main/res/values/styles_core.xml +++ b/app/src/main/res/values/styles_core.xml @@ -2,12 +2,23 @@ + +