mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-17 22:37:03 +05:30
Rename LobstersItemRedux to LobstersItem
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
974076c5f1
commit
5acab43669
3 changed files with 4 additions and 10 deletions
|
@ -30,7 +30,7 @@ fun HottestPosts(
|
|||
if (posts.lastIndex == index) {
|
||||
overscrollAction.invoke()
|
||||
}
|
||||
LobstersItemRedux(
|
||||
LobstersItem(
|
||||
post = item,
|
||||
onClick = { post -> urlLauncher.launch(post.url.ifEmpty { post.commentsUrl }) },
|
||||
onLongClick = { post -> urlLauncher.launch(post.commentsUrl) },
|
||||
|
|
|
@ -55,14 +55,8 @@ val TEST_POST = LobstersPost(
|
|||
listOf("openbsd", "linux", "containers", "hack the planet", "no thanks"),
|
||||
)
|
||||
|
||||
/**
|
||||
* A temporary replacement for [LobstersItem] that implements the same functionality backed by
|
||||
* a UI that's built upon [ConstraintLayout] rather than Column and Row. This allows us to add a
|
||||
* dedicated save button without needing to add swipe actions, which have been hard to get right
|
||||
* and thus resulted in a variety of bugs (see https://msfjarvis.dev/g/compose-lobsters/issues/65).
|
||||
*/
|
||||
@Composable
|
||||
fun LobstersItemRedux(
|
||||
fun LobstersItem(
|
||||
post: LobstersPost,
|
||||
onClick: (LobstersPost) -> Unit = {},
|
||||
onLongClick: (LobstersPost) -> Unit = {},
|
||||
|
@ -157,7 +151,7 @@ fun TagRow(
|
|||
fun Preview() {
|
||||
LobstersTheme {
|
||||
LazyColumnFor(items = listOf(TEST_POST, TEST_POST, TEST_POST, TEST_POST, TEST_POST)) { item ->
|
||||
LobstersItemRedux(
|
||||
LobstersItem(
|
||||
post = item,
|
||||
)
|
||||
}
|
|
@ -26,7 +26,7 @@ fun SavedPosts(
|
|||
state = listState,
|
||||
modifier = Modifier.padding(horizontal = 8.dp).then(modifier)
|
||||
) { item ->
|
||||
LobstersItemRedux(
|
||||
LobstersItem(
|
||||
post = item,
|
||||
onClick = { post -> urlLauncher.launch(post.url.ifEmpty { post.commentsUrl }) },
|
||||
onLongClick = { post -> urlLauncher.launch(post.commentsUrl) },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue