diff --git a/app/src/main/java/emu/skyline/adapter/GenericAdapter.kt b/app/src/main/java/emu/skyline/adapter/GenericAdapter.kt index 8e4b47ee..900675a0 100644 --- a/app/src/main/java/emu/skyline/adapter/GenericAdapter.kt +++ b/app/src/main/java/emu/skyline/adapter/GenericAdapter.kt @@ -36,6 +36,7 @@ class GenericAdapter : RecyclerView.Adapter>(), F val currentItems : List> get() = asyncListDiffer.currentList var currentSearchTerm = "" + var selectedPosition : Int? = null private val viewTypesMapping = mutableMapOf() @@ -68,6 +69,11 @@ class GenericAdapter : RecyclerView.Adapter>(), F filter.filter(currentSearchTerm) } + fun removeItemAt(position : Int) { + allItems.removeAt(position) + filter.filter(currentSearchTerm) + } + fun setOnFilterPublishedListener(listener : OnFilterPublishedListener) { onFilterPublishedListener = listener }