From e93fdce845faa2d66912f77d743d851c3f376110 Mon Sep 17 00:00:00 2001 From: lynxnb Date: Sat, 9 Jul 2022 16:39:16 +0200 Subject: [PATCH] Add support for removal of items from `GenericAdapter` --- app/src/main/java/emu/skyline/adapter/GenericAdapter.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/emu/skyline/adapter/GenericAdapter.kt b/app/src/main/java/emu/skyline/adapter/GenericAdapter.kt index 8e4b47ee..251c90c8 100644 --- a/app/src/main/java/emu/skyline/adapter/GenericAdapter.kt +++ b/app/src/main/java/emu/skyline/adapter/GenericAdapter.kt @@ -68,6 +68,11 @@ class GenericAdapter : RecyclerView.Adapter>(), F filter.filter(currentSearchTerm) } + open fun removeItemAt(position : Int) { + allItems.removeAt(position) + filter.filter(currentSearchTerm) + } + fun setOnFilterPublishedListener(listener : OnFilterPublishedListener) { onFilterPublishedListener = listener }