Skip to content

Instantly share code, notes, and snippets.

@hirauchg
Last active May 19, 2019 15:25
Show Gist options
  • Save hirauchg/37ff778049e92df7a9f838a73103d3f0 to your computer and use it in GitHub Desktop.
Save hirauchg/37ff778049e92df7a9f838a73103d3f0 to your computer and use it in GitHub Desktop.
RecyclerViewでリスト表示を実装する - リスト表示画面の実装 - 2
class SampleActivityUI : AnkoComponent<SampleActivity> {
lateinit var mRecyclerView: RecyclerView
override fun createView(ui: AnkoContext<SampleActivity>) = with(ui) {
verticalLayout {
mRecyclerView = recyclerView {
layoutManager = LinearLayoutManager(ctx, LinearLayoutManager.VERTICAL, false)
}.lparams(width = matchParent) {
topMargin = dip(5)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment