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
@@ -35,16 +35,15 @@ class AboutActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat -> ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) 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 WindowInsetsCompat.CONSUMED
} }
if (!Utils.isDarkTheme(this)) if (!Utils.isDarkTheme(this))
WindowInsetsControllerCompat(window, binding.root).isAppearanceLightStatusBars = true WindowInsetsControllerCompat(window, binding.root).isAppearanceLightStatusBars = true
if (Build.VERSION.SDK_INT >= 35)
binding.aboutText.updatePadding(top = 172)
Utils.addActivity("about") Utils.addActivity("about")
val text = String.format(getString(R.string.about_text), val text = String.format(getString(R.string.about_text),
@@ -88,16 +88,15 @@ class AccountActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat -> ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) 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 WindowInsetsCompat.CONSUMED
} }
if (!Utils.isDarkTheme(this)) if (!Utils.isDarkTheme(this))
WindowInsetsControllerCompat(window, binding.root).isAppearanceLightStatusBars = true WindowInsetsControllerCompat(window, binding.root).isAppearanceLightStatusBars = true
if (Build.VERSION.SDK_INT >= 35)
binding.AccountView.updatePadding(top = 172)
supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayHomeAsUpEnabled(true)
uri = binding.Uri uri = binding.Uri
@@ -37,16 +37,15 @@ class AccountsActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat -> ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) 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 WindowInsetsCompat.CONSUMED
} }
if (!Utils.isDarkTheme(this)) if (!Utils.isDarkTheme(this))
WindowInsetsControllerCompat(window, binding.root).isAppearanceLightStatusBars = true WindowInsetsControllerCompat(window, binding.root).isAppearanceLightStatusBars = true
if (Build.VERSION.SDK_INT >= 35)
binding.AccountsView.updatePadding(top = 172)
aor = intent.getStringExtra("aor")!! aor = intent.getStringExtra("aor")!!
Utils.addActivity("accounts,$aor") Utils.addActivity("accounts,$aor")
@@ -52,7 +52,7 @@ class AudioActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat -> ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) 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) if (Build.VERSION.SDK_INT >= 35)
binding.AudioView.updatePadding(top = systemBars.top + 56) binding.AudioView.updatePadding(top = systemBars.top + 56)
WindowInsetsCompat.CONSUMED WindowInsetsCompat.CONSUMED
@@ -40,7 +40,7 @@ class CallDetailsActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat -> ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) 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) if (Build.VERSION.SDK_INT >= 35)
binding.CallDetailsView.updatePadding(top = systemBars.top + 56) binding.CallDetailsView.updatePadding(top = systemBars.top + 56)
WindowInsetsCompat.CONSUMED WindowInsetsCompat.CONSUMED
@@ -45,7 +45,7 @@ class CallsActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat -> ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) 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) if (Build.VERSION.SDK_INT >= 35)
binding.CallsView.updatePadding(top = systemBars.top + 56) binding.CallsView.updatePadding(top = systemBars.top + 56)
WindowInsetsCompat.CONSUMED WindowInsetsCompat.CONSUMED
@@ -56,7 +56,7 @@ class ChatActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat -> ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) 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) if (Build.VERSION.SDK_INT >= 35)
binding.ChatView.updatePadding(top = systemBars.top + 56) binding.ChatView.updatePadding(top = systemBars.top + 56)
WindowInsetsCompat.CONSUMED WindowInsetsCompat.CONSUMED
@@ -49,7 +49,7 @@ class ChatsActivity: AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat -> ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) 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) if (Build.VERSION.SDK_INT >= 35)
binding.ChatsView.updatePadding(top = systemBars.top + 56) binding.ChatsView.updatePadding(top = systemBars.top + 56)
WindowInsetsCompat.CONSUMED WindowInsetsCompat.CONSUMED
@@ -46,7 +46,7 @@ class CodecsActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat -> ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) 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) if (Build.VERSION.SDK_INT >= 35)
binding.CodecsView.updatePadding(top = systemBars.top + 64) binding.CodecsView.updatePadding(top = systemBars.top + 64)
WindowInsetsCompat.CONSUMED WindowInsetsCompat.CONSUMED
@@ -104,16 +104,15 @@ class ConfigActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat -> ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) 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 WindowInsetsCompat.CONSUMED
} }
if (!Utils.isDarkTheme(this)) if (!Utils.isDarkTheme(this))
WindowInsetsControllerCompat(window, binding.root).isAppearanceLightStatusBars = true WindowInsetsControllerCompat(window, binding.root).isAppearanceLightStatusBars = true
if (Build.VERSION.SDK_INT >= 35)
binding.ConfigView.updatePadding(top = 172)
Utils.addActivity("config") Utils.addActivity("config")
baresipService = Intent(this@ConfigActivity, BaresipService::class.java) baresipService = Intent(this@ConfigActivity, BaresipService::class.java)
@@ -70,7 +70,7 @@ class ContactActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat -> ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) 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) if (Build.VERSION.SDK_INT >= 35)
binding.ContactView.updatePadding(top = systemBars.top + 56) binding.ContactView.updatePadding(top = systemBars.top + 56)
WindowInsetsCompat.CONSUMED WindowInsetsCompat.CONSUMED
@@ -42,7 +42,7 @@ class ContactsActivity : AppCompatActivity() {
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat -> ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars()) 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) if (Build.VERSION.SDK_INT >= 35)
binding.ContactsView.updatePadding(top = systemBars.top + 56) binding.ContactsView.updatePadding(top = systemBars.top + 56)
WindowInsetsCompat.CONSUMED WindowInsetsCompat.CONSUMED