feat: added clearhistory button (#416)

This commit is contained in:
ibo 2024-06-14 13:07:38 +02:00 committed by GitHub
parent 124c8f5ed7
commit 899af3ee1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 55 additions and 1 deletions

View file

@ -49,6 +49,12 @@ class SearchHistoryAdapter(private val type: String, private val searchClicked:
PrefManager.setVal(historyType, searchHistory)
}
fun clearHistory() {
searchHistory?.clear()
PrefManager.setVal(historyType, searchHistory)
submitList(searchHistory?.toList())
}
override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int