Как реализовать сквозное взаимодействие с помощью диалогового окна нижнего листа AndroidAndroid

Форум для тех, кто программирует под Android
Ответить Пред. темаСлед. тема
Anonymous
 Как реализовать сквозное взаимодействие с помощью диалогового окна нижнего листа Android

Сообщение Anonymous »


I have an android application entirely based on immersive mode. I have managed to go edge-to-edge for the entire application but when I open a bottom sheet dialog with peek height of uptop 90% of the screen and a scrollview to accomodate a long form. However, when I open the bottom sheet, there is a blank space at the bottom of the view which is exactly the size of the system navigation bar. Is there a way to remove that space and have the bottom sheet extend right upto the bottom of the screen?

Here's a snapshot of the bottom sheet fully expanded
Изображение


EDIT: Added Example of My bottomsheet dialog class-

class MyBottomSheetDialog constructor(val ctx: Context, val height: Int) : BaseDialog(ctx) { ... override fun onStart() { super.onStart() binding.root.layoutParams.height = height binding.root.requestLayout() } override fun onAttachedToWindow() { super.onAttachedToWindow() window?.let { WindowCompat.setDecorFitsSystemWindows( it,false ) } findViewById(com.google.android.material.R.id.container)?.fitsSystemWindows = false findViewById(com.google.android.material.R.id.coordinator)?.fitsSystemWindows = false } ... } And The base class is-
open class BaseDialog constructor( private val dialogContext: Context) : BottomSheetDialog(dialogContext, style) { override fun onStart() { super.onStart() hideNavigation() } private fun hideNavigation() { window?.apply { val uiOptions: Int = decorView.systemUiVisibility val newUiOptions = uiOptions or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_FULLSCREEN decorView.systemUiVisibility = newUiOptions setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)) setGravity(Gravity.BOTTOM) } } }

Источник: https://stackoverflow.com/questions/720 ... og-android
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Android»