Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0de1e3b

Browse files
authored
fix: channel history indicator alignment and flickering [WPB-15859] (#4094)
1 parent5d8037e commit0de1e3b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

‎app/src/main/kotlin/com/wire/android/ui/common/PageLoadingIndicator.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import androidx.compose.ui.Alignment
3232
importandroidx.compose.ui.Modifier
3333
importandroidx.compose.ui.res.painterResource
3434
importandroidx.compose.ui.res.stringResource
35+
importandroidx.compose.ui.text.style.TextAlign
3536
importcom.wire.android.R
3637
importcom.wire.android.ui.theme.WireTheme
3738
importcom.wire.android.util.ui.PreviewMultipleThemes
@@ -68,6 +69,7 @@ fun PageLoadingIndicator(
6869
text= text,
6970
style= typography().subline01,
7071
color= colorsScheme().secondaryText,
72+
textAlign=TextAlign.Center,
7173
)
7274
}
7375
}

‎app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationScreen.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ import androidx.compose.ui.res.painterResource
7373
importandroidx.compose.ui.res.stringResource
7474
importandroidx.compose.ui.text.style.TextOverflow
7575
importandroidx.hilt.navigation.compose.hiltViewModel
76+
importandroidx.paging.LoadState
7677
importandroidx.paging.PagingData
7778
importandroidx.paging.compose.LazyPagingItems
7879
importandroidx.paging.compose.collectAsLazyPagingItems
@@ -1333,7 +1334,18 @@ fun MessageList(
13331334
.fillMaxWidth()
13341335
.padding(dimensions().spacing16x),
13351336
) {
1336-
val (text, prefixIconResId)=when (lazyPagingMessages.loadState.prepend.endOfPaginationReached) {
1337+
var allMessagesPrepended by remember { mutableStateOf(false) }
1338+
LaunchedEffect(lazyPagingMessages.loadState) {
1339+
// When the list is being refreshed, the load state for prepend is cleared so the app doesn't know if
1340+
// the end of pagination is reached or not for prepend until the refresh is done, so we don't want to
1341+
// update the allMessagesPrepended state while refreshing and in that case keep the last updated state,
1342+
// otherwise the indicator will flicker while refreshing.
1343+
if (lazyPagingMessages.loadState.refreshisLoadState.NotLoading) {
1344+
allMessagesPrepended= lazyPagingMessages.loadState.prepend.endOfPaginationReached
1345+
}
1346+
}
1347+
1348+
val (text, prefixIconResId)=when (allMessagesPrepended) {
13371349
true-> stringResource(R.string.conversation_history_loaded) tonull
13381350
false-> stringResource(R.string.conversation_history_loading) toR.drawable.ic_undo
13391351
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp