Padded all systems bars in all activities

This commit is contained in:
Juha Heinanen
2024-12-15 00:57:43 +02:00
parent 04462f4fa9
commit 0a17139f9c
12 changed files with 20 additions and 24 deletions

View File

@ -35,16 +35,15 @@ class AboutActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(0, systemBars.top, 0, systemBars.bottom)
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
if (Build.VERSION.SDK_INT >= 35)
binding.aboutText.updatePadding(top = 172)
WindowInsetsCompat.CONSUMED
}
if (!Utils.isDarkTheme(this))
WindowInsetsControllerCompat(window, binding.root).isAppearanceLightStatusBars = true
if (Build.VERSION.SDK_INT >= 35)
binding.aboutText.updatePadding(top = 172)
Utils.addActivity("about")
val text = String.format(getString(R.string.about_text),

View File

@ -88,16 +88,15 @@ class AccountActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(0, systemBars.top, 0, systemBars.bottom)
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
if (Build.VERSION.SDK_INT >= 35)
binding.AccountView.updatePadding(top = 172)
WindowInsetsCompat.CONSUMED
}
if (!Utils.isDarkTheme(this))
WindowInsetsControllerCompat(window, binding.root).isAppearanceLightStatusBars = true
if (Build.VERSION.SDK_INT >= 35)
binding.AccountView.updatePadding(top = 172)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
uri = binding.Uri

View File

@ -37,16 +37,15 @@ class AccountsActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(0, systemBars.top, 0, systemBars.bottom)
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
if (Build.VERSION.SDK_INT >= 35)
binding.AccountsView.updatePadding(top = 172)
WindowInsetsCompat.CONSUMED
}
if (!Utils.isDarkTheme(this))
WindowInsetsControllerCompat(window, binding.root).isAppearanceLightStatusBars = true
if (Build.VERSION.SDK_INT >= 35)
binding.AccountsView.updatePadding(top = 172)
aor = intent.getStringExtra("aor")!!
Utils.addActivity("accounts,$aor")

View File

@ -52,7 +52,7 @@ class AudioActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(0, systemBars.top, 0, systemBars.bottom)
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
if (Build.VERSION.SDK_INT >= 35)
binding.AudioView.updatePadding(top = systemBars.top + 56)
WindowInsetsCompat.CONSUMED

View File

@ -40,7 +40,7 @@ class CallDetailsActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(0, systemBars.top, 0, systemBars.bottom)
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
if (Build.VERSION.SDK_INT >= 35)
binding.CallDetailsView.updatePadding(top = systemBars.top + 56)
WindowInsetsCompat.CONSUMED

View File

@ -45,7 +45,7 @@ class CallsActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(0, systemBars.top, 0, systemBars.bottom)
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
if (Build.VERSION.SDK_INT >= 35)
binding.CallsView.updatePadding(top = systemBars.top + 56)
WindowInsetsCompat.CONSUMED

View File

@ -56,7 +56,7 @@ class ChatActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(0, systemBars.top, 0, systemBars.bottom)
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
if (Build.VERSION.SDK_INT >= 35)
binding.ChatView.updatePadding(top = systemBars.top + 56)
WindowInsetsCompat.CONSUMED

View File

@ -49,7 +49,7 @@ class ChatsActivity: AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(0, systemBars.top, 0, systemBars.bottom)
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
if (Build.VERSION.SDK_INT >= 35)
binding.ChatsView.updatePadding(top = systemBars.top + 56)
WindowInsetsCompat.CONSUMED

View File

@ -46,7 +46,7 @@ class CodecsActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(0, systemBars.top, 0, systemBars.bottom)
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
if (Build.VERSION.SDK_INT >= 35)
binding.CodecsView.updatePadding(top = systemBars.top + 64)
WindowInsetsCompat.CONSUMED

View File

@ -104,16 +104,15 @@ class ConfigActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(0, systemBars.top, 0, systemBars.bottom)
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
if (Build.VERSION.SDK_INT >= 35)
binding.ConfigView.updatePadding(top = 172)
WindowInsetsCompat.CONSUMED
}
if (!Utils.isDarkTheme(this))
WindowInsetsControllerCompat(window, binding.root).isAppearanceLightStatusBars = true
if (Build.VERSION.SDK_INT >= 35)
binding.ConfigView.updatePadding(top = 172)
Utils.addActivity("config")
baresipService = Intent(this@ConfigActivity, BaresipService::class.java)

View File

@ -70,7 +70,7 @@ class ContactActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(0, systemBars.top, 0, systemBars.bottom)
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
if (Build.VERSION.SDK_INT >= 35)
binding.ContactView.updatePadding(top = systemBars.top + 56)
WindowInsetsCompat.CONSUMED

View File

@ -42,7 +42,7 @@ class ContactsActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(0, systemBars.top, 0, systemBars.bottom)
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
if (Build.VERSION.SDK_INT >= 35)
binding.ContactsView.updatePadding(top = systemBars.top + 56)
WindowInsetsCompat.CONSUMED