diff --git a/app/src/main/kotlin/jackall/overlaymulticounter/CounterAdapter.kt b/app/src/main/kotlin/jackall/overlaymulticounter/CounterAdapter.kt deleted file mode 100644 index 67558ea..0000000 --- a/app/src/main/kotlin/jackall/overlaymulticounter/CounterAdapter.kt +++ /dev/null @@ -1,39 +0,0 @@ -package jackall.overlaymulticounter - -import android.content.Context -import android.databinding.DataBindingUtil -import android.support.v7.widget.RecyclerView -import android.view.LayoutInflater -import android.view.ViewGroup -import jackall.overlaymulticounter.databinding.ListCounterItemBinding -import jackall.overlaymulticounter.viewmodel.CounterItemViewModel - -/** - * Created by matsumoto_k on 2017/11/08. - */ -class CounterAdapter(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_counter_item, parent, false) - return ViewHolder(binding) - } - - override fun onBindViewHolder(holder: ViewHolder?, position: Int) { - holder?.binding?.counterItemViewModel = items.get(position) - } - - override fun getItemCount(): Int { - return items.count() - } - - fun insert(item: CounterItemViewModel) { - items.add(item) - notifyItemInserted(itemCount) - } - - fun remove(position: Int) { - items.removeAt(position) - notifyItemRemoved(position) - } - - inner class ViewHolder(val binding: ListCounterItemBinding) : RecyclerView.ViewHolder(binding.root) -} \ No newline at end of file