Last active
May 19, 2019 15:28
-
-
Save hirauchg/6295f2ba9f5c5fb33e9b5513143bcfb5 to your computer and use it in GitHub Desktop.
RecyclerViewでリスト表示を実装する - リスト表示画面の実装 - 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SampleActivity : BaseActivity(), SampleAdapter.SampleAdapterListener { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
val ui = SampleActivityUI() | |
ui.setContentView(this) | |
// テストデータ | |
val sampleModelList = arrayListOf<SampleModel>() | |
for (i in 0..20) { | |
val sampleModel = SampleModel(i, "SampleModel" + i) | |
sampleModelList.add(sampleModel) | |
} | |
val adapter = SampleAdapter(this) | |
adapter.setSampleModelList(sampleModelList) | |
ui.mRecyclerView.adapter = adapter | |
} | |
override fun onClickCard(position: Int) { | |
toast("onClickCard : " + position) | |
} | |
override fun onClickDelete(position: Int) { | |
toast("onClickDelete : " + position) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment