在我ViewHolder RecyclerView項目我有一個函數:點擊在ViewHolder
private fun setupAmountLabel(amountLabelView: CategorizedAmountView, category: Category?,
amount: Double, percent: String, isParentView: Boolean) {
amountLabelView.setTitle(category?.getLocalizedName() ?: "")
amountLabelView.setSubTitle(percent)
amountLabelView.setAmountSignType(AmountType.NEGATIVE)
amountLabelView.setAmountAndCurrencyCode(amount, currencyCode)
amountLabelView.setIconCategory(category)
amountLabelView.setAmountColor(amount.toDataSetColor())
amountLabelView.setOnClickListener {
listItemClickListener?.onListItemClick(if (isParentView) 1 else 0, category?.guid ?: "")
}
}
,我想點擊我的listItemParent。早些時候,這個函數在適配器中,我通過創建setListClickListener方法來調用適配器。但是現在我不知道如何點擊這個項目。
可我知道你的適配器?它是基座適配器嗎? –
@DinithePieris不,它是我的自定義適配器。 – Inkognito
該方法在ViewHolder類中如何或爲什麼? – Bills