Skip to content

Instantly share code, notes, and snippets.

@myeonginwoo
Created November 4, 2018 17:21
Show Gist options
  • Save myeonginwoo/ffc41b107cfe7bd30fb3871c85a83f88 to your computer and use it in GitHub Desktop.
Save myeonginwoo/ffc41b107cfe7bd30fb3871c85a83f88 to your computer and use it in GitHub Desktop.
// before
enum class Item(val titleId: Int, val colorId: Int) {
ITEM_A(R.string.a, R.color.red),
ITEM_B(R.string.b, R.color.green),
ITEM_C(R.string.c, R.color.blue)
}
// after
data class Item(val title: String, val color: String)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment