mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
AdaptiveSheet: Don't blindly consume back event (#8760)
This commit is contained in:
parent
c44db54d9f
commit
9d2d78ae5b
1 changed files with 4 additions and 4 deletions
|
@ -16,7 +16,7 @@ import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.layout.WindowInsets
|
import androidx.compose.foundation.layout.WindowInsets
|
||||||
import androidx.compose.foundation.layout.WindowInsetsSides
|
import androidx.compose.foundation.layout.WindowInsetsSides
|
||||||
import androidx.compose.foundation.layout.asPaddingValues
|
import androidx.compose.foundation.layout.asPaddingValues
|
||||||
import androidx.compose.foundation.layout.consumedWindowInsets
|
import androidx.compose.foundation.layout.consumeWindowInsets
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.navigationBars
|
import androidx.compose.foundation.layout.navigationBars
|
||||||
import androidx.compose.foundation.layout.offset
|
import androidx.compose.foundation.layout.offset
|
||||||
|
@ -194,7 +194,7 @@ fun AdaptiveSheetImpl(
|
||||||
shape = MaterialTheme.shapes.extraLarge,
|
shape = MaterialTheme.shapes.extraLarge,
|
||||||
tonalElevation = tonalElevation,
|
tonalElevation = tonalElevation,
|
||||||
content = {
|
content = {
|
||||||
BackHandler(onBack = internalOnDismissRequest)
|
BackHandler(enabled = alpha > 0f, onBack = internalOnDismissRequest)
|
||||||
content()
|
content()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -264,14 +264,14 @@ fun AdaptiveSheetImpl(
|
||||||
WindowInsets.systemBars
|
WindowInsets.systemBars
|
||||||
.only(WindowInsetsSides.Top + WindowInsetsSides.Horizontal),
|
.only(WindowInsetsSides.Top + WindowInsetsSides.Horizontal),
|
||||||
)
|
)
|
||||||
.consumedWindowInsets(
|
.consumeWindowInsets(
|
||||||
WindowInsets.systemBars
|
WindowInsets.systemBars
|
||||||
.only(WindowInsetsSides.Top + WindowInsetsSides.Horizontal),
|
.only(WindowInsetsSides.Top + WindowInsetsSides.Horizontal),
|
||||||
),
|
),
|
||||||
shape = MaterialTheme.shapes.extraLarge.copy(bottomStart = ZeroCornerSize, bottomEnd = ZeroCornerSize),
|
shape = MaterialTheme.shapes.extraLarge.copy(bottomStart = ZeroCornerSize, bottomEnd = ZeroCornerSize),
|
||||||
tonalElevation = tonalElevation,
|
tonalElevation = tonalElevation,
|
||||||
content = {
|
content = {
|
||||||
BackHandler(onBack = internalOnDismissRequest)
|
BackHandler(enabled = swipeState.targetValue == 0, onBack = internalOnDismissRequest)
|
||||||
content()
|
content()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue