[Android] LiveDataset: Remove item by its position

Geoffrey Métais git at videolan.org
Tue Jul 31 14:04:47 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jul 27 15:59:26 2018 +0200| [704d8bdf9838b5047ff461176dcb51be6eca3f76] | committer: Geoffrey Métais

LiveDataset: Remove item by its position

> https://code.videolan.org/videolan/vlc-android/commit/704d8bdf9838b5047ff461176dcb51be6eca3f76
---

 vlc-android/src/org/videolan/vlc/util/LiveDataset.kt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/util/LiveDataset.kt b/vlc-android/src/org/videolan/vlc/util/LiveDataset.kt
index 960e38af9..d63c14b4d 100644
--- a/vlc-android/src/org/videolan/vlc/util/LiveDataset.kt
+++ b/vlc-android/src/org/videolan/vlc/util/LiveDataset.kt
@@ -26,4 +26,8 @@ class LiveDataset<T> : MutableLiveData<MutableList<T>>() {
     fun remove(item: T) {
         value = value.apply { remove(item) }
     }
+
+    fun remove(position: Int) {
+        value = value.apply { removeAt(position) }
+    }
 }
\ No newline at end of file



More information about the Android mailing list