Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animating article items being dismissed #688

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -240,6 +240,7 @@ private const val SwipeActionDelay = 300L
@OptIn(ExperimentalMaterial3Api::class, ExperimentalComposeUiApi::class)
@Composable
fun SwipeableArticleItem(
modifier: Modifier = Modifier,
articleWithFeed: ArticleWithFeed,
isFilterUnread: Boolean = false,
articleListTonalElevation: Int = 0,
Expand Down Expand Up @@ -333,6 +334,7 @@ fun SwipeableArticleItem(
var menuOffset by remember { mutableStateOf(Offset(0f, 0f)) }

SwipeToDismissBox(
modifier = modifier,
state = swipeState,
enabled = !isSwipeEnabled(),
/*** create dismiss alert background box */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ fun LazyListScope.ArticleList(
is ArticleFlowItem.Article -> {
item(key = item.articleWithFeed.article.id) {
SwipeableArticleItem(
modifier = Modifier.animateItemPlacement(),
articleWithFeed = item.articleWithFeed,
isFilterUnread = isFilterUnread,
articleListTonalElevation = articleListTonalElevation,
Expand Down
Loading