mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-19 09:25:34 +00:00
[fenix] For https://github.com/mozilla-mobile/fenix/issues/2377 - Added ability to share multiple history items
This commit is contained in:
parent
69d24e7e8a
commit
f0ebdd9d11
@ -42,7 +42,6 @@ import org.mozilla.fenix.ext.share
|
|||||||
import org.mozilla.fenix.mvi.ActionBusFactory
|
import org.mozilla.fenix.mvi.ActionBusFactory
|
||||||
import org.mozilla.fenix.mvi.getAutoDisposeObservable
|
import org.mozilla.fenix.mvi.getAutoDisposeObservable
|
||||||
import org.mozilla.fenix.mvi.getManagedEmitter
|
import org.mozilla.fenix.mvi.getManagedEmitter
|
||||||
import org.mozilla.fenix.utils.ItsNotBrokenSnack
|
|
||||||
import java.net.MalformedURLException
|
import java.net.MalformedURLException
|
||||||
import java.net.URL
|
import java.net.URL
|
||||||
import kotlin.coroutines.CoroutineContext
|
import kotlin.coroutines.CoroutineContext
|
||||||
@ -184,7 +183,12 @@ class HistoryFragment : Fragment(), CoroutineScope, BackHandler {
|
|||||||
val selectedHistory = (historyComponent.uiView as HistoryUIView).getSelected()
|
val selectedHistory = (historyComponent.uiView as HistoryUIView).getSelected()
|
||||||
when {
|
when {
|
||||||
selectedHistory.size == 1 -> context?.share(selectedHistory.first().url)
|
selectedHistory.size == 1 -> context?.share(selectedHistory.first().url)
|
||||||
selectedHistory.size > 1 -> ItsNotBrokenSnack(context!!).showSnackbar(issueNumber = "2377")
|
selectedHistory.size > 1 -> {
|
||||||
|
val shareText = selectedHistory.joinToString("\n") {
|
||||||
|
it.url
|
||||||
|
}
|
||||||
|
requireContext().share(shareText)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user