<commit_before>package com.androidessence.cashcaretaker.account

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.androidessence.cashcaretaker.account.AccountAdapter.AccountViewHolder
import com.androidessence.cashcaretaker.databinding.ListItemAccountBinding
import io.reactivex.subjects.PublishSubject

/**
 * Adapter for displaying Accounts in a RecyclerView.
 *
 * This exposes all click events from the [AccountViewHolder] through the various [PublishSubject]s.
 */
class AccountAdapter(
        private val accountClicked: (Account) -> Unit,
        private val accountLongClicked: (Account) -> Unit,
        private val withdrawalClicked: (Account) -> Unit,
        private val depositClicked: (Account) -> Unit
) : RecyclerView.Adapter<AccountViewHolder>() {
    var items: List<Account> = emptyList()
        set(value) {
            field = value
            notifyDataSetChanged()
        }

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AccountViewHolder {
        val inflater = LayoutInflater.from(parent.context)
        val binding = ListItemAccountBinding.inflate(inflater, parent, false)
        return AccountViewHolder(
                binding,
                accountClicked,
                accountLongClicked,
                withdrawalClicked,
                depositClicked
        )
    }

    override fun onBindViewHolder(holder: AccountViewHolder, position: Int) {
        holder.bindItem(items[position])
    }

    override fun getItemCount(): Int = items.size<commit_msg>Removed another reference to pubsubs.<commit_after>package com.androidessence.cashcaretaker.account

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.androidessence.cashcaretaker.account.AccountAdapter.AccountViewHolder
import com.androidessence.cashcaretaker.databinding.ListItemAccountBinding

/**
 * Adapter for displaying Accounts in a RecyclerView.
 */
class AccountAdapter(
        private val accountClicked: (Account) -> Unit,
        private val accountLongClicked: (Account) -> Unit,
        private val withdrawalClicked: (Account) -> Unit,
        private val depositClicked: (Account) -> Unit
) : RecyclerView.Adapter<AccountViewHolder>() {
    var items: List<Account> = emptyList()
        set(value) {
            field = value
            notifyDataSetChanged()
        }

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AccountViewHolder {
        val inflater = LayoutInflater.from(parent.context)
        val binding = ListItemAccountBinding.inflate(inflater, parent, false)
        return AccountViewHolder(
                binding,
                accountClicked,
                accountLongClicked,
                withdrawalClicked,
                depositClicked
        )
    }

    override fun onBindViewHolder(holder: AccountViewHolder, position: Int) {
        holder.bindItem(items[position])
    }

    override fun getItemCount(): Int = items.size
{'fraction_non_alphanumeric': 0.07884490590525632, 'fraction_numerical': 0.0, 'mean_word_length': 3.121657754010695, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5015998', 'n_tokens_mistral': 825, 'n_tokens_neox': 788, 'n_words': 185}