Join room : change state and view
This commit is contained in:
parent
ab8c31541b
commit
a2329fc7df
11 changed files with 228 additions and 165 deletions
|
|
@ -18,6 +18,7 @@ package io.element.android.libraries.designsystem.atomic.pages
|
|||
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.consumeWindowInsets
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
|
|
@ -43,6 +44,7 @@ import io.element.android.libraries.designsystem.theme.components.Text
|
|||
@Composable
|
||||
fun HeaderFooterPage(
|
||||
modifier: Modifier = Modifier,
|
||||
paddingValues: PaddingValues = PaddingValues(20.dp),
|
||||
background: @Composable () -> Unit = {},
|
||||
topBar: @Composable () -> Unit = {},
|
||||
header: @Composable () -> Unit = {},
|
||||
|
|
@ -57,7 +59,7 @@ fun HeaderFooterPage(
|
|||
background()
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.padding(all = 20.dp)
|
||||
.padding(paddingValues = paddingValues)
|
||||
.padding(padding)
|
||||
.consumeWindowInsets(padding)
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package io.element.android.libraries.matrix.impl.util
|
||||
|
||||
import io.element.android.libraries.core.data.tryOrNull
|
||||
import kotlinx.coroutines.channels.ProducerScope
|
||||
import kotlinx.coroutines.channels.awaitClose
|
||||
import kotlinx.coroutines.flow.callbackFlow
|
||||
|
|
@ -23,7 +24,9 @@ import org.matrix.rustcomponents.sdk.TaskHandle
|
|||
|
||||
internal fun <T> mxCallbackFlow(block: suspend ProducerScope<T>.() -> TaskHandle?) =
|
||||
callbackFlow {
|
||||
val taskHandle: TaskHandle? = block(this)
|
||||
val taskHandle: TaskHandle? = tryOrNull {
|
||||
block(this)
|
||||
}
|
||||
awaitClose {
|
||||
taskHandle?.cancelAndDestroy()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue