Skip to content

Instantly share code, notes, and snippets.

@AlexZhukovich
Created February 6, 2020 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexZhukovich/140ffe249d6a7e4670d86653bdbc93f6 to your computer and use it in GitHub Desktop.
Save AlexZhukovich/140ffe249d6a7e4670d86653bdbc93f6 to your computer and use it in GitHub Desktop.
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
CoffeeDrinksList(coffeeDrinks)
}
}
@Composable
fun CoffeeDrinkList(
coffeeDrinks: List<CoffeeDrink>
) {
VerticalScroller {
Column {
for (coffee in coffeeDrinks) {
Ripple(bounded = true) {
Container {
Column {
CoffeeDrinkCard(
coffeeDrink = coffee
)
Opacity(0.08f) {
Divider(modifier = LayoutPadding(left = 88.dp), color = Color.Black)
}
}
}
}
}
}
}
}
@Preview
@Composable
fun previewCoffeeDrinkList(coffeeDrinks: ModelList<CoffeeDrinkModel>) {
CoffeeDrinkList(
coffeeDrinks = getCoffeeDrinks()
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment