For #8652 - Allow sharing multiple bookmarks

fennec/beta
David Walsh 4 years ago committed by Emily Kager
parent 862be3e95f
commit 681d6cf8a1

@ -166,8 +166,6 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
} else { } else {
inflater.inflate(R.menu.bookmarks_select_multi, menu) inflater.inflate(R.menu.bookmarks_select_multi, menu)
} }
menu.findItem(R.id.share_bookmark_multi_select)?.isVisible = mode.selectedItems.size == 1
} }
} }
} }
@ -196,10 +194,12 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
true true
} }
R.id.share_bookmark_multi_select -> { R.id.share_bookmark_multi_select -> {
val bookmark = bookmarkStore.state.mode.selectedItems.first() val shareTabs = bookmarkStore.state.mode.selectedItems.map {
ShareData(url = it.url, title = it.title)
}
navigate( navigate(
BookmarkFragmentDirections.actionBookmarkFragmentToShareFragment( BookmarkFragmentDirections.actionBookmarkFragmentToShareFragment(
data = arrayOf(ShareData(url = bookmark.url, title = bookmark.title)) data = shareTabs.toTypedArray()
) )
) )
true true

Loading…
Cancel
Save