app: remove custom edge to edge setup
I think this conflicts with the weird default behavior of Android 15.
This commit is contained in:
parent
10aaf0afd2
commit
f134d3e11b
8 changed files with 4 additions and 75 deletions
|
@ -21,6 +21,7 @@ package org.oxycblt.auxio
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
|
@ -56,12 +57,12 @@ class MainActivity : AppCompatActivity() {
|
||||||
@Inject lateinit var uiSettings: UISettings
|
@Inject lateinit var uiSettings: UISettings
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
enableEdgeToEdge()
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setupTheme()
|
setupTheme()
|
||||||
// Inflate the views after setting up the theme so that the theme attributes are applied.
|
// Inflate the views after setting up the theme so that the theme attributes are applied.
|
||||||
val binding = ActivityMainBinding.inflate(layoutInflater)
|
val binding = ActivityMainBinding.inflate(layoutInflater)
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
setupEdgeToEdge(binding.root)
|
|
||||||
L.d("Activity created")
|
L.d("Activity created")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,17 +99,6 @@ 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
|
* Transform an [Intent] given to [MainActivity] into a [DeferredPlayback] that can be used in
|
||||||
* the playback system.
|
* the playback system.
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<!-- Template theme that handles edge-to-edge on other styles variants -->
|
|
||||||
<style name="Theme.Auxio.V27" parent="Theme.Auxio.V23">
|
|
||||||
<item name="android:navigationBarColor">@color/chrome_transparent_ish</item>
|
|
||||||
<item name="android:statusBarColor">@color/chrome_transparent_ish</item>
|
|
||||||
<item name="android:windowLightStatusBar">false</item>
|
|
||||||
<item name="android:windowLightNavigationBar">false</item>
|
|
||||||
</style>
|
|
||||||
</resources>
|
|
|
@ -1,11 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<!--
|
|
||||||
Used on devices when we can technically use "transparent" system bars, but fully
|
|
||||||
transparent system bars would actually be made translucent by the OS.
|
|
||||||
-->
|
|
||||||
<color name="chrome_transparent_ish">#01000000</color>
|
|
||||||
|
|
||||||
<!-- Replicate extra theme values for widgets -->
|
<!-- Replicate extra theme values for widgets -->
|
||||||
<color name="widget_surface">@color/material_dynamic_secondary20</color>
|
<color name="widget_surface">@color/material_dynamic_secondary20</color>
|
||||||
<color name="widget_surface_inverse">@color/material_dynamic_neutral90</color>
|
<color name="widget_surface_inverse">@color/material_dynamic_neutral90</color>
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
|
|
||||||
<style name="Theme.Auxio.V27" parent="Theme.Auxio.V23">
|
|
||||||
<item name="android:navigationBarColor">@color/chrome_transparent_ish</item>
|
|
||||||
<item name="android:statusBarColor">@color/chrome_transparent_ish</item>
|
|
||||||
<item name="android:windowLightStatusBar">true</item>
|
|
||||||
<item name="android:windowLightNavigationBar">true</item>
|
|
||||||
</style>
|
|
||||||
</resources>
|
|
|
@ -1,15 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
|
|
||||||
<style name="Theme.Auxio.V29" parent="Theme.Auxio.V27">
|
|
||||||
<!--
|
|
||||||
Android 10 finally allows you to use fully transparent system bars without it automatically
|
|
||||||
forcing contrast.
|
|
||||||
-->
|
|
||||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
|
||||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
|
||||||
<item name="android:enforceNavigationBarContrast">false</item>
|
|
||||||
<item name="android:enforceStatusBarContrast">false</item>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
</resources>
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="Theme.Auxio.V31" parent="Theme.Auxio.V29">
|
<style name="Theme.Auxio.V31" parent="Theme.Auxio">
|
||||||
<item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_splash_anim</item>
|
<item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_splash_anim</item>
|
||||||
<item name="android:windowSplashScreenAnimationDuration">1000</item>
|
<item name="android:windowSplashScreenAnimationDuration">1000</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,14 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<!-- Used on devices when we cannot set dark/light mode on the system bars. -->
|
|
||||||
<color name="chrome_translucent">#80000000</color>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Used on devices when we can technically use "transparent" system bars, but fully
|
|
||||||
transparent system bars would actually be made translucent by the OS.
|
|
||||||
-->
|
|
||||||
<color name="chrome_transparent_ish">#01ffffff</color>
|
|
||||||
|
|
||||||
<!-- Replicate extra theme values for widgets -->
|
<!-- Replicate extra theme values for widgets -->
|
||||||
<color name="widget_surface">@color/material_dynamic_primary95</color>
|
<color name="widget_surface">@color/material_dynamic_primary95</color>
|
||||||
<color name="widget_surface_inverse">@color/material_dynamic_neutral20</color>
|
<color name="widget_surface_inverse">@color/material_dynamic_neutral20</color>
|
||||||
|
|
|
@ -2,23 +2,12 @@
|
||||||
<resources>
|
<resources>
|
||||||
<!-- Master parent theme -->
|
<!-- Master parent theme -->
|
||||||
<style name="Theme.Auxio" parent="Theme.Material3.DynamicColors.DayNight" />
|
<style name="Theme.Auxio" parent="Theme.Material3.DynamicColors.DayNight" />
|
||||||
<!-- Adds nicer selector attributes not supported on lollipop -->
|
|
||||||
<style name="Theme.Auxio.V23" parent="Theme.Auxio" />
|
|
||||||
<!-- Handles edge-to-edge on other styles variants -->
|
|
||||||
<style name="Theme.Auxio.V27" parent="Theme.Auxio.V23">
|
|
||||||
<item name="android:statusBarColor">@color/chrome_translucent</item>
|
|
||||||
<item name="android:navigationBarColor">@color/chrome_translucent</item>
|
|
||||||
</style>
|
|
||||||
<!-- Adds fully transparent system bars -->
|
|
||||||
<style name="Theme.Auxio.V29" parent="Theme.Auxio.V27" />
|
|
||||||
<!-- Adds an animated splash screen. -->
|
<!-- Adds an animated splash screen. -->
|
||||||
<style name="Theme.Auxio.V31" parent="Theme.Auxio.V29" />
|
<style name="Theme.Auxio.V31" parent="Theme.Auxio" />
|
||||||
|
|
||||||
<!-- Base theme -->
|
<!-- Base theme -->
|
||||||
<style name="Theme.Auxio.Base" parent="Theme.Auxio.V31">
|
<style name="Theme.Auxio.Base" parent="Theme.Auxio.V31">
|
||||||
|
|
||||||
<!-- Material configuration -->
|
<!-- Material configuration -->
|
||||||
<!-- <item name="colorOutline">@color/overlay_stroke</item>-->
|
|
||||||
<item name="toolbarStyle">@style/Widget.Auxio.Toolbar</item>
|
<item name="toolbarStyle">@style/Widget.Auxio.Toolbar</item>
|
||||||
<item name="materialAlertDialogTheme">@style/Theme.Auxio.Dialog</item>
|
<item name="materialAlertDialogTheme">@style/Theme.Auxio.Dialog</item>
|
||||||
<item name="sliderStyle">@style/Widget.Auxio.Slider</item>
|
<item name="sliderStyle">@style/Widget.Auxio.Slider</item>
|
||||||
|
|
Loading…
Reference in a new issue