Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
Expand All @@ -60,6 +59,7 @@ import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.wire.android.di.wireViewModel
import com.ramcosta.composedestinations.result.NavResult
import com.ramcosta.composedestinations.result.ResultBackNavigator
Expand Down Expand Up @@ -153,7 +153,7 @@ fun GroupConversationDetailsScreen(
val resources = LocalContext.current.resources
val snackbarHostState = LocalSnackbarHostState.current
val sheetState = rememberWireModalSheetState<ConversationSheetState>()
val groupOptions by viewModel.groupOptionsState.collectAsState()
val groupOptions by viewModel.groupOptionsState.collectAsStateWithLifecycle()

val onSearchConversationMessagesClick: () -> Unit = {
navigator.navigate(
Expand Down Expand Up @@ -392,6 +392,7 @@ private fun GroupConversationDetailsContent(
)
val currentTabState by remember { derivedStateOf { pagerState.calculateCurrentTab() } }
val legalHoldSubjectDialogState = rememberVisibilityState<Unit>()
val isLoading by isScreenLoading.collectAsStateWithLifecycle()

CollapsingTopBarScaffold(
topBarHeader = {
Expand Down Expand Up @@ -428,7 +429,7 @@ private fun GroupConversationDetailsContent(
}

AnimatedContent(
targetState = isScreenLoading.collectAsState().value,
targetState = isLoading,
transitionSpec = {
val enter = fadeIn(tween(durationMillis = 500, delayMillis = 100))
val exit = fadeOut()
Expand Down Expand Up @@ -456,8 +457,8 @@ private fun GroupConversationDetailsContent(
}
},
topBarFooter = {
Crossfade(isScreenLoading.collectAsState().value) {
if (it) {
Crossfade(isLoading) { loading ->
if (loading) {
LoadingWireTabRow()
} else {
WireTabRow(
Expand Down Expand Up @@ -508,7 +509,7 @@ private fun GroupConversationDetailsContent(
contentLazyListState = lazyListStates[currentTabState],
) {
AnimatedVisibility(
visible = isScreenLoading.collectAsState().value,
visible = isLoading,
enter = fadeIn(),
exit = fadeOut()
) {
Expand All @@ -520,7 +521,7 @@ private fun GroupConversationDetailsContent(
val focusManager = LocalFocusManager.current

AnimatedVisibility(
visible = !isScreenLoading.collectAsState().value,
visible = !isLoading,
enter = fadeIn(
animationSpec = tween(durationMillis = 500, delayMillis = 100)
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package com.wire.android.ui.home.conversations.details

import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.background
import androidx.compose.foundation.focusGroup
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -71,6 +72,7 @@ fun GroupConversationDetailsTopBarCollapsing(
modifier = modifier
.fillMaxWidth()
.wrapContentHeight()
.focusGroup()
) {
Box(contentAlignment = Alignment.Center) {
GroupConversationAvatar(
Expand Down
Loading