Advertisement
Guest User

Untitled

a guest
Sep 13th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. private val mItems = ArrayList<Int>()
  2. (1..item_count).mapTo(mItems) { it }
  3.  
  4. /*
  5. mItems will be: "1, 2, 3, 4, 5, ..., item_count"
  6. */
  7.  
  8. class ModelClass(var id: Int = 0, var status: String = "smth")
  9.  
  10. //?
  11. private val mItems = ArrayList<ModelClass>()
  12. (1..item_count).mapTo(mItems) { mItems[position].id = it } // Something like this
  13. //?
  14.  
  15. (1..item_count).mapTo(mItems) { ModelClass(it) }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement