Skip to content

Commit

Permalink
Enable placeholders in paginated posts list
Browse files Browse the repository at this point in the history
fixes #272
  • Loading branch information
msasikanth committed Feb 7, 2024
1 parent 6911f24 commit bdcb3d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class HomePresenter(
}

val posts =
createPager(config = createPagingConfig(pageSize = 20, enablePlaceholders = false)) {
createPager(config = createPagingConfig(pageSize = 20, enablePlaceholders = true)) {
rssRepository.posts(
selectedFeedLink = selectedFeed?.link,
unreadOnly = unreadOnly,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ package dev.sasikanth.rss.reader.home.ui
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.requiredHeight
import androidx.compose.foundation.layout.requiredSize
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.layout.windowInsetsPadding
Expand Down Expand Up @@ -115,13 +117,15 @@ internal fun PostsList(
onPostSourceClick = { onPostSourceClick(post.feedLink) },
togglePostReadClick = { onTogglePostReadClick(post.link, post.read) }
)
} else {
Box(Modifier.requiredHeight(132.dp))
}

if (index != posts.itemCount - 1) {
Divider(
modifier = Modifier.fillParentMaxWidth().padding(horizontal = 24.dp),
color = AppTheme.colorScheme.surfaceContainer
)
}
if (index != posts.itemCount - 1) {
Divider(
modifier = Modifier.fillParentMaxWidth().padding(horizontal = 24.dp),
color = AppTheme.colorScheme.surfaceContainer
)
}
}
}
Expand Down

0 comments on commit bdcb3d1

Please sign in to comment.