Created
February 6, 2019 07:32
-
-
Save CesarValiente/ebac89be756deb7cb6d4951d3c2b7514 to your computer and use it in GitHub Desktop.
This file contains 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
fun Color.toColorResource(): Int = | |
//We don't use Presentation models, we enrich the Store models using EF | |
when (this) { | |
RED -> R.color.red | |
YELLOW -> R.color.yellow | |
GREEN -> R.color.green | |
BLUE -> R.color.blue | |
WHITE -> R.color.white | |
} | |
fun Item.getStableId(): Long = localId.hashCode().toLong() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment