diff --git a/app/src/main/java/jackall/devrealm/adapter/MainAdapter.kt b/app/src/main/java/jackall/devrealm/adapter/MainAdapter.kt index 56859a9..8ffbcb3 100644 --- a/app/src/main/java/jackall/devrealm/adapter/MainAdapter.kt +++ b/app/src/main/java/jackall/devrealm/adapter/MainAdapter.kt @@ -12,14 +12,14 @@ /** * Created by matsumoto_k on 2017/11/08. */ -class MainAdapter(val context: Context, val items: ArrayList) : RecyclerView.Adapter() { - override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): RecyclerView.ViewHolder { +class MainAdapter(val context: Context, val items: ArrayList) : RecyclerView.Adapter() { + override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder { val binding = DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.list_item, parent, false) return ViewHolder(binding) } - override fun onBindViewHolder(holder: RecyclerView.ViewHolder?, position: Int) { - + override fun onBindViewHolder(holder: ViewHolder?, position: Int) { + holder?.binding?.itemViewModel = items.get(position) } override fun getItemCount(): Int {