mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 08:17:04 +05:30
Use material3 color for SwipeRefreshIndicator (#299)
This commit is contained in:
parent
34393ef2dc
commit
3b833083e1
1 changed files with 12 additions and 0 deletions
|
@ -3,11 +3,14 @@ package dev.msfjarvis.claw.android.ui.lists
|
|||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.lazy.LazyListState
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.contentColorFor
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.paging.LoadState
|
||||
import androidx.paging.compose.LazyPagingItems
|
||||
import com.google.accompanist.swiperefresh.SwipeRefresh
|
||||
import com.google.accompanist.swiperefresh.SwipeRefreshIndicator
|
||||
import com.google.accompanist.swiperefresh.rememberSwipeRefreshState
|
||||
import dev.msfjarvis.claw.common.posts.PostActions
|
||||
import dev.msfjarvis.claw.database.local.SavedPost
|
||||
|
@ -26,6 +29,15 @@ fun HottestPosts(
|
|||
SwipeRefresh(
|
||||
state = rememberSwipeRefreshState(isRefreshing),
|
||||
onRefresh = reloadPosts,
|
||||
indicator = { state, trigger ->
|
||||
val backgroundColor = MaterialTheme.colorScheme.surface
|
||||
SwipeRefreshIndicator(
|
||||
state = state,
|
||||
refreshTriggerDistance = trigger,
|
||||
backgroundColor = backgroundColor,
|
||||
contentColor = contentColorFor(backgroundColor)
|
||||
)
|
||||
}
|
||||
) {
|
||||
if (items.itemCount == 0) {
|
||||
Box(modifier = Modifier.fillMaxSize())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue