Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private val mItems = ArrayList<Int>()
- (1..item_count).mapTo(mItems) { it }
- /*
- mItems will be: "1, 2, 3, 4, 5, ..., item_count"
- */
- class ModelClass(var id: Int = 0, var status: String = "smth")
- //?
- private val mItems = ArrayList<ModelClass>()
- (1..item_count).mapTo(mItems) { mItems[position].id = it } // Something like this
- //?
- (1..item_count).mapTo(mItems) { ModelClass(it) }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement