https://kotlinlang.org logo
#compose
Title
# compose
d

david.bilik

12/24/2019, 8:47 AM
👋 hi, I’m playing with JetNews sample and I was curious why the Ripple of simple Story item is not side-to-side of the screen and also why click events are not triggered when clicked on side but I cant see why is that in the code. There is no padding on the screen, the row looks like
Copy code
@Composable
fun PostCardSimple(post: Post) {
    Ripple(bounded = true) {
        Clickable(onClick = {
            navigateTo(Screen.Article(post.id))
        }) {
            Row(modifier = Spacing(16.dp)) {
                PostImage(modifier = Spacing(right = 16.dp), post = post)
                Column(modifier = Flexible(1f)) {
                    PostTitle(post)
                    AuthorAndReadTime(post)
                }
                BookmarkButton(
                    isBookmarked = isFavorite(postId = post.id),
                    onBookmark = { toggleBookmark(postId = post.id) }
                )
            }
        }
    }
}
and the padding is controled via
Spacing
modifier of the
Row
. Is it possible that both
Ripple
and
Clickable
react only for inner elements and ignores padding around them?
a

Andrey Kulikov

12/25/2019, 2:46 AM
Yes, Ripple and Clickable are applied for the inner Layout. Which is in this example the Row after applying the spacing. We are still exploring how this will work in the end
3 Views