fix(android): report fully drawn status

This commit is contained in:
Harsh Shandilya 2023-06-05 16:50:29 +05:30
parent 5f6d635c7a
commit 942b9f3fb4
No known key found for this signature in database
2 changed files with 4 additions and 0 deletions

View file

@ -6,6 +6,7 @@
*/ */
package dev.msfjarvis.claw.android.ui.lists package dev.msfjarvis.claw.android.ui.lists
import androidx.activity.compose.ReportDrawn
import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
@ -29,6 +30,7 @@ fun DatabasePosts(
postActions: PostActions, postActions: PostActions,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
ReportDrawn()
Box(modifier = modifier.fillMaxSize()) { Box(modifier = modifier.fillMaxSize()) {
LazyColumn( LazyColumn(
state = listState, state = listState,

View file

@ -6,6 +6,7 @@
*/ */
package dev.msfjarvis.claw.android.ui.lists package dev.msfjarvis.claw.android.ui.lists
import androidx.activity.compose.ReportDrawnWhen
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
@ -44,6 +45,7 @@ fun NetworkPosts(
postActions: PostActions, postActions: PostActions,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
ReportDrawnWhen { lazyPagingItems.itemCount > 0 }
val refreshLoadState = lazyPagingItems.loadState.refresh val refreshLoadState = lazyPagingItems.loadState.refresh
val isRefreshing = refreshLoadState == LoadState.Loading val isRefreshing = refreshLoadState == LoadState.Loading
val pullRefreshState = rememberPullRefreshState(isRefreshing, lazyPagingItems::refresh) val pullRefreshState = rememberPullRefreshState(isRefreshing, lazyPagingItems::refresh)