Revert "app: remove custom edge to edge setup"
This reverts commit f134d3e11b.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user