Skip to content

Commit

Permalink
added clearItems(notifyDataSetChanged:Boolean)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunalapk committed Feb 13, 2021
1 parent eac31fc commit 31b0f21
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ class CustomAdapter<T>(private val activity:AppCompatActivity?,private val isPag
this.isLoading = isLoading
}

fun clearItem(){
fun clearItems(notifyDataSetChanged:Boolean){
customModelList.clear()
if(notifyDataSetChanged)
notifyDataSetChanged()
}

fun clearItems(){
customModelList.clear()
notifyDataSetChanged()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,12 @@ class SmartRecyclerView<T> : SwipeRefreshLayout {
enableDisableShimmer(false)
}

fun clearItem(){
customAdapter.clearItem()
fun clearItems(){
customAdapter.clearItems()
}

fun clearItems(notifyDataSetChanged:Boolean){
customAdapter.clearItems(notifyDataSetChanged)
}

fun addItem(item: T){
Expand Down

0 comments on commit 31b0f21

Please sign in to comment.