Added edge-to-edge support to Config activity
This commit is contained in:
@ -42,11 +42,11 @@ class AboutActivity : AppCompatActivity() {
|
||||
if (!Utils.isDarkTheme(this))
|
||||
WindowInsetsControllerCompat(window, binding.root).isAppearanceLightStatusBars = true
|
||||
|
||||
Utils.addActivity("about")
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 35)
|
||||
binding.aboutText.updatePadding(top = 172)
|
||||
|
||||
Utils.addActivity("about")
|
||||
|
||||
val text = String.format(getString(R.string.about_text),
|
||||
BuildConfig.VERSION_NAME)
|
||||
binding.aboutText.text = HtmlCompat.fromHtml(text, HtmlCompat.FROM_HTML_MODE_LEGACY)
|
||||
|
||||
@ -29,6 +29,11 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.graphics.Insets
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.WindowInsetsControllerCompat
|
||||
import androidx.core.view.updatePadding
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.tutpro.baresip.Utils.copyInputStreamToFile
|
||||
@ -89,8 +94,6 @@ class ConfigActivity : AppCompatActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
||||
theme.applyStyle(R.style.OptOutEdgeToEdgeEnforcement,false)
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
val contactsPermissions = arrayOf(Manifest.permission.READ_CONTACTS, Manifest.permission.WRITE_CONTACTS)
|
||||
@ -99,6 +102,18 @@ class ConfigActivity : AppCompatActivity() {
|
||||
setContentView(binding.root)
|
||||
layout = binding.ConfigView
|
||||
|
||||
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { v: View, insets: WindowInsetsCompat ->
|
||||
val systemBars: Insets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||
v.setPadding(0, systemBars.top, 0, systemBars.bottom)
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user