Skip to content

Instantly share code, notes, and snippets.

@abdurahmanadilovic
Created January 28, 2018 12:30
Show Gist options
  • Save abdurahmanadilovic/53cc609074f78dc207dd2866ada5e5ae to your computer and use it in GitHub Desktop.
Save abdurahmanadilovic/53cc609074f78dc207dd2866ada5e5ae to your computer and use it in GitHub Desktop.
Kotlin map example 2
val rootView = LinearLayout(testContext)
listOfLinks.map {
val tmpTextView = TextView(testContext)
tmpTextView.text = it
tmpTextView
}.forEach {
rootView.addView(it)
}
assertEquals(listOfLinks[0], (rootView.getChildAt(0) as TextView).text.toString())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment