Created
March 3, 2018 12:13
-
-
Save pawegio/9c3ca36deb9bc7364bc53896e1e7a708 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun generateItems(): List<Item> { | |
val now = LocalDateTime.now() | |
return List(1_000) { Item(now, it + 1) } | |
} | |
private fun bindItem(holder: ViewHolderBinder<Item>, item: Item) = with(holder.itemView) { | |
val date = item.now.plusDays(item.offset.toLong()).toLocalDate().atStartOfDay() | |
val remainingTime = getRemainingTime(item.now, date) | |
dateView.text = date.format(DateTimeFormatter.ISO_LOCAL_DATE) | |
remainingTimeView.text = resources.getString(R.string.remaining, remainingTime) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment