Commit 82280a47 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Add network favorites context options

parent d44d3bb6
......@@ -393,7 +393,7 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
if (mw.type == MediaWrapper.TYPE_DIR) {
val isEmpty = viewModel.isFolderEmpty(mw)
if (!isEmpty) flags = flags or Constants.CTX_PLAY
if (this is NetworkBrowserFragment) {
if (this@BaseBrowserFragment is NetworkBrowserFragment) {
val favExists = withContext(VLCIO) { MediaDatabase.getInstance().networkFavExists(mw.uri) }
flags = if (favExists) flags or Constants.CTX_NETWORK_EDIT or Constants.CTX_NETWORK_REMOVE
else flags or Constants.CTX_NETWORK_ADD
......
......@@ -92,6 +92,9 @@ class ContextSheet : BottomSheetDialogFragment() {
if (flags and Constants.CTX_PLAY_NEXT != 0) add(Simple(Constants.CTX_PLAY_NEXT, getString(R.string.insert_next), R.drawable.ic_am_append_normal))
if (flags and Constants.CTX_ADD_TO_PLAYLIST != 0) add(Simple(Constants.CTX_ADD_TO_PLAYLIST, getString(R.string.add_to_playlist), R.drawable.ic_am_addtoplaylist_normal))
if (flags and Constants.CTX_SET_RINGTONE != 0 && AndroidDevices.isPhone) add(Simple(Constants.CTX_SET_RINGTONE, getString(R.string.set_song), R.drawable.ic_am_ringtone_normal))
if (flags and Constants.CTX_NETWORK_ADD != 0) add(Simple(Constants.CTX_NETWORK_ADD, getString(R.string.favorites_add), R.drawable.ic_menu_network))
if (flags and Constants.CTX_NETWORK_EDIT != 0) add(Simple(Constants.CTX_NETWORK_EDIT, getString(R.string.favorites_edit), R.drawable.ic_menu_network))
if (flags and Constants.CTX_NETWORK_REMOVE != 0) add(Simple(Constants.CTX_NETWORK_REMOVE, getString(R.string.favorites_remove), R.drawable.ic_menu_network))
}
inner class ContextAdapter : RecyclerView.Adapter<ContextAdapter.ViewHolder>() {
......
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