[Android] Fix snackbar position on playlist swipe to dismiss
Nicolas Pomepuy
git at videolan.org
Fri Nov 13 07:31:03 CET 2020
vlc-android | branch: 3.3.x | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Nov 5 07:57:55 2020 +0100| [9ff25f0962203af992e1ca0319997746961fa73a] | committer: Nicolas Pomepuy
Fix snackbar position on playlist swipe to dismiss
(cherry picked from commit 8fb4343389f994f7047fcb70bd8526d952ace88f)
> https://code.videolan.org/videolan/vlc-android/commit/9ff25f0962203af992e1ca0319997746961fa73a
---
.../vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt
index 63cc4ddbe..2f6ce4926 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.kt
@@ -262,7 +262,7 @@ open class PlaylistActivity : AudioPlayerContainerActivity(), IEventsHandler<Med
override fun onRemove(position: Int, item: MediaLibraryItem) {
val tracks = ArrayList(listOf(*item.tracks))
- removeFromPlaylist(tracks, ArrayList(Arrays.asList(position)))
+ removeFromPlaylist(tracks, ArrayList(listOf(position)))
}
override fun onMove(oldPosition: Int, newPosition: Int) {
@@ -272,7 +272,7 @@ open class PlaylistActivity : AudioPlayerContainerActivity(), IEventsHandler<Med
}
override fun onMainActionClick(v: View, position: Int, item: MediaLibraryItem) {
- MediaUtils.openList(this, Arrays.asList(*item.tracks), 0)
+ MediaUtils.openList(this, listOf(*item.tracks), 0)
}
override fun onStartDrag(viewHolder: RecyclerView.ViewHolder) {
@@ -287,7 +287,7 @@ open class PlaylistActivity : AudioPlayerContainerActivity(), IEventsHandler<Med
binding.fab.show()
}
- fun startActionMode() {
+ private fun startActionMode() {
actionMode = startSupportActionMode(this)
}
@@ -444,7 +444,7 @@ open class PlaylistActivity : AudioPlayerContainerActivity(), IEventsHandler<Med
withContext(Dispatchers.IO) {
for (index in indexes) playlist.remove(index)
}
- UiTools.snackerWithCancel(binding.root, getString(R.string.removed_from_playlist_anonymous), null, Runnable {
+ UiTools.snackerWithCancel(findViewById(android.R.id.content), getString(R.string.removed_from_playlist_anonymous), null, {
for ((key, value) in itemsRemoved) {
playlist.add(value, key)
}
More information about the Android
mailing list