From 0a17139f9ce1264e523bee8b34bf0795e5161c22 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Sun, 15 Dec 2024 00:57:43 +0200 Subject: [PATCH] Padded all systems bars in all activities --- app/src/main/kotlin/com/tutpro/baresip/AboutActivity.kt | 7 +++---- app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt | 7 +++---- app/src/main/kotlin/com/tutpro/baresip/AccountsActivity.kt | 7 +++---- app/src/main/kotlin/com/tutpro/baresip/AudioActivity.kt | 2 +- .../main/kotlin/com/tutpro/baresip/CallDetailsActivity.kt | 2 +- app/src/main/kotlin/com/tutpro/baresip/CallsActivity.kt | 2 +- app/src/main/kotlin/com/tutpro/baresip/ChatActivity.kt | 2 +- app/src/main/kotlin/com/tutpro/baresip/ChatsActivity.kt | 2 +- app/src/main/kotlin/com/tutpro/baresip/CodecsActivity.kt | 2 +- app/src/main/kotlin/com/tutpro/baresip/ConfigActivity.kt | 7 +++---- app/src/main/kotlin/com/tutpro/baresip/ContactActivity.kt | 2 +- app/src/main/kotlin/com/tutpro/baresip/ContactsActivity.kt | 2 +- 12 files changed, 20 insertions(+), 24 deletions(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/AboutActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/AboutActivity.kt index 98bdd3e1..dd599f60 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/AboutActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/AboutActivity.kt @@ -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), diff --git a/app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt index a552ab3a..cc0353be 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt @@ -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 diff --git a/app/src/main/kotlin/com/tutpro/baresip/AccountsActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/AccountsActivity.kt index 31f74a9d..904c1f4b 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/AccountsActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/AccountsActivity.kt @@ -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") diff --git a/app/src/main/kotlin/com/tutpro/baresip/AudioActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/AudioActivity.kt index 8f5dfe43..7129c7cf 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/AudioActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/AudioActivity.kt @@ -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 diff --git a/app/src/main/kotlin/com/tutpro/baresip/CallDetailsActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/CallDetailsActivity.kt index f8bb6a0e..7d5040f2 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/CallDetailsActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/CallDetailsActivity.kt @@ -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 diff --git a/app/src/main/kotlin/com/tutpro/baresip/CallsActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/CallsActivity.kt index b4494aa0..fe9b0865 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/CallsActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/CallsActivity.kt @@ -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 diff --git a/app/src/main/kotlin/com/tutpro/baresip/ChatActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/ChatActivity.kt index 4c0a1751..a158ba47 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/ChatActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/ChatActivity.kt @@ -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 diff --git a/app/src/main/kotlin/com/tutpro/baresip/ChatsActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/ChatsActivity.kt index 3bf2d465..6a7654bd 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/ChatsActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/ChatsActivity.kt @@ -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 diff --git a/app/src/main/kotlin/com/tutpro/baresip/CodecsActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/CodecsActivity.kt index c4bfa5b9..af7d0278 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/CodecsActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/CodecsActivity.kt @@ -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 diff --git a/app/src/main/kotlin/com/tutpro/baresip/ConfigActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/ConfigActivity.kt index bb9168fc..0e131dfb 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/ConfigActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/ConfigActivity.kt @@ -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) diff --git a/app/src/main/kotlin/com/tutpro/baresip/ContactActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/ContactActivity.kt index a4a41167..4d0b9596 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/ContactActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/ContactActivity.kt @@ -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 diff --git a/app/src/main/kotlin/com/tutpro/baresip/ContactsActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/ContactsActivity.kt index f5253d4f..8e6e9716 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/ContactsActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/ContactsActivity.kt @@ -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