Skip to content

Instantly share code, notes, and snippets.

@Dima564
Last active November 20, 2016 20:14
Show Gist options
  • Save Dima564/b294432156c44da7daf44c512c6af87a to your computer and use it in GitHub Desktop.
Save Dima564/b294432156c44da7daf44c512c6af87a to your computer and use it in GitHub Desktop.
items = StoreInfo().apply { storeItems = fetchItems() }.let { manager.process(it) }
container.apply {
removeAllViews()
items.forEach { addView(ShopItemView(context).withData(it)) }
}
fun ShopItemView.withData(item: StoreItem): ShopItemView {
title = item.title
image = item.image
Brand.findById(item.id)?.let { brandName = it.name }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment