Change The View Text Of Footer Itemview Of Recyclerview
Hi I have a condition where I have to add different viewType with text show more or loading... at the bottom of the recyclerview I have successfully added the footer view with sho
Solution 1:
Can you try disabling the footer view button once the user clicks on it?
funenableShowMore(enable: Boolean) {
if( enable ) {
itemView.btnShowMore.text = "show more"
} else {
itemView.btnShowMore.text = "loading..."
}
itemView.btnShowMore.isEnabled = enable
}
Update :
//In the adapter
mIsFooterEnabled = false//In the View holder funenableShowMore() {
if( mIsFooterEnabled ) {
itemView.btnShowMore.text = "show more"
} else {
itemView.btnShowMore.text = "loading..."
}
itemView.btnShowMore.isEnabled = mIsFooterEnabled
}
//In your activity / fragmentprivatefunenableShowMore(enable: Boolean) {
adapter.mIsFooterEnabled = enable
adapter.notifyDataSetChanged()
}
Post a Comment for "Change The View Text Of Footer Itemview Of Recyclerview"