From 7e7edc8b7a349a5e7624bb094ab97a38cb92f094 Mon Sep 17 00:00:00 2001 From: Sawyer Blatz Date: Mon, 20 May 2019 10:57:52 -0700 Subject: [PATCH] For #2377: Adds share to tabs and tab collections --- .../main/java/org/mozilla/fenix/home/HomeFragment.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt b/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt index a15b3ed89d..01c914e282 100644 --- a/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt @@ -316,7 +316,10 @@ class HomeFragment : Fragment(), CoroutineScope { Navigation.findNavController(view!!).navigate(directions) } is TabAction.ShareTabs -> { - ItsNotBrokenSnack(context!!).showSnackbar(issueNumber = "1843") + val shareText = requireComponents.core.sessionManager.sessions.joinToString("\n") { + it.url + } + requireContext().share(shareText) } } } @@ -357,7 +360,10 @@ class HomeFragment : Fragment(), CoroutineScope { ItsNotBrokenSnack(context!!).showSnackbar(issueNumber = "2205") } is CollectionAction.ShareTabs -> { - ItsNotBrokenSnack(context!!).showSnackbar(issueNumber = "1585") + val shareText = action.collection.tabs.joinToString("\n") { + it.url + } + requireContext().share(shareText) } is CollectionAction.RemoveTab -> { launch(Dispatchers.IO) {