Commit c69ee409 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Geoffrey Métais
Browse files

Fix save playlist

parent 833b2661
......@@ -100,7 +100,8 @@ class SavePlaylistDialog : VLCBottomSheetDialogFragment(), View.OnClickListener,
editText!!.setOnEditorActionListener(this)
listView.layoutManager = LinearLayoutManager(view.context)
listView.adapter = adapter
adapter.submitList(Arrays.asList<MediaLibraryItem>(*medialibrary.playlists))
adapter.submitList(listOf<MediaLibraryItem>(*medialibrary.playlists))
if (!Tools.isArrayEmpty(newTrack)) saveButton.setText(R.string.save)
updateEmptyView()
}
......@@ -151,6 +152,13 @@ class SavePlaylistDialog : VLCBottomSheetDialogFragment(), View.OnClickListener,
} else
ids.add(id)
}
if (!addTracks) {
for (i in 0 until playlist.tracks.size) {
playlist.remove(0)
}
}
playlist.append(ids)
})
dismiss()
......
......@@ -410,7 +410,7 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba
init {
itemView.setOnClickListener { onClick(dataset[layoutPosition]) }
itemView.setOnFocusChangeListener { _, hasFocus ->
itemView.onFocusChangeListener = View.OnFocusChangeListener { _, hasFocus ->
binding.optionTitle.setTextColor(if (hasFocus) ContextCompat.getColor(itemView.context, R.color.orange500transparent) else textColor)
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment