Skip to content

Instantly share code, notes, and snippets.

@fluxtah
Created January 20, 2020 15:18
Show Gist options
  • Save fluxtah/d16d077c6848869861bdc30e6ff85f1a to your computer and use it in GitHub Desktop.
Save fluxtah/d16d077c6848869861bdc30e6ff85f1a to your computer and use it in GitHub Desktop.
class HelloJubakoActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_jubako_recycler)
recyclerView.withJubako(this).load {
for (i in 0..100) {
addView { textView("Hello Jubako!") }
addView { textView("こんにちはジュバコ") }
}
}
}
private fun textView(text: String): TextView {
return TextView(this).apply {
setText(text)
setTextSize(TypedValue.COMPLEX_UNIT_DIP, 48f)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment