fix: fullscreen bottom sheets
Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
parent
80e55fbdcc
commit
aa443d2acb
|
|
@ -1,12 +1,13 @@
|
|||
package chat.revolt.components.generic
|
||||
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.navigationBars
|
||||
import androidx.compose.foundation.layout.windowInsetsPadding
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Composable
|
||||
fun SheetEnd(modifier: Modifier = Modifier) {
|
||||
Spacer(modifier.height(8.dp))
|
||||
Spacer(modifier.windowInsetsPadding(WindowInsets.navigationBars))
|
||||
}
|
||||
|
|
@ -1,10 +1,20 @@
|
|||
package chat.revolt.internals.extensions
|
||||
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.exclude
|
||||
import androidx.compose.foundation.layout.navigationBars
|
||||
import androidx.compose.material3.BottomSheetDefaults
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.NonRestartableComposable
|
||||
|
||||
val WindowInsets.Companion.zero: WindowInsets
|
||||
@Composable
|
||||
@NonRestartableComposable
|
||||
get() = WindowInsets(left = 0, right = 0, top = 0, bottom = 0)
|
||||
get() = WindowInsets(left = 0, right = 0, top = 0, bottom = 0)
|
||||
|
||||
val BottomSheetInsets: WindowInsets
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
@NonRestartableComposable
|
||||
get() = BottomSheetDefaults.windowInsets.exclude(WindowInsets.navigationBars)
|
||||
Loading…
Reference in New Issue