mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-17 15:26:23 +00:00
Bug 1809305 - Allow user to copy an image to the clipboard (#948)
* Bug 1809305 - Allow user to copy an image to the clipboard * Bug 1809305 - Update import & remove unnecessary gradle androidTestImplementation dependency * Bug 1809305 - PR changes * Bug 1819746 - Add explicit dependency to support-ktx * Add buildconfig changes needed after adding support-ktx to componse-engine --------- Co-authored-by: t-p-white <t-p-white> Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
77f485baf1
commit
0a34b4b1da
@ -63,7 +63,8 @@ import mozilla.components.feature.contextmenu.ContextMenuCandidate
|
|||||||
import mozilla.components.feature.contextmenu.ContextMenuFeature
|
import mozilla.components.feature.contextmenu.ContextMenuFeature
|
||||||
import mozilla.components.feature.downloads.DownloadsFeature
|
import mozilla.components.feature.downloads.DownloadsFeature
|
||||||
import mozilla.components.feature.downloads.manager.FetchDownloadManager
|
import mozilla.components.feature.downloads.manager.FetchDownloadManager
|
||||||
import mozilla.components.feature.downloads.share.ShareDownloadFeature
|
import mozilla.components.feature.downloads.temporary.CopyDownloadFeature
|
||||||
|
import mozilla.components.feature.downloads.temporary.ShareDownloadFeature
|
||||||
import mozilla.components.feature.intent.ext.EXTRA_SESSION_ID
|
import mozilla.components.feature.intent.ext.EXTRA_SESSION_ID
|
||||||
import mozilla.components.feature.media.fullscreen.MediaSessionFullscreenFeature
|
import mozilla.components.feature.media.fullscreen.MediaSessionFullscreenFeature
|
||||||
import mozilla.components.feature.privatemode.feature.SecureWindowFeature
|
import mozilla.components.feature.privatemode.feature.SecureWindowFeature
|
||||||
@ -189,6 +190,7 @@ abstract class BaseBrowserFragment :
|
|||||||
private val contextMenuFeature = ViewBoundFeatureWrapper<ContextMenuFeature>()
|
private val contextMenuFeature = ViewBoundFeatureWrapper<ContextMenuFeature>()
|
||||||
private val downloadsFeature = ViewBoundFeatureWrapper<DownloadsFeature>()
|
private val downloadsFeature = ViewBoundFeatureWrapper<DownloadsFeature>()
|
||||||
private val shareDownloadsFeature = ViewBoundFeatureWrapper<ShareDownloadFeature>()
|
private val shareDownloadsFeature = ViewBoundFeatureWrapper<ShareDownloadFeature>()
|
||||||
|
private val copyDownloadsFeature = ViewBoundFeatureWrapper<CopyDownloadFeature>()
|
||||||
private val appLinksFeature = ViewBoundFeatureWrapper<AppLinksFeature>()
|
private val appLinksFeature = ViewBoundFeatureWrapper<AppLinksFeature>()
|
||||||
private val promptsFeature = ViewBoundFeatureWrapper<PromptFeature>()
|
private val promptsFeature = ViewBoundFeatureWrapper<PromptFeature>()
|
||||||
private val findInPageIntegration = ViewBoundFeatureWrapper<FindInPageIntegration>()
|
private val findInPageIntegration = ViewBoundFeatureWrapper<FindInPageIntegration>()
|
||||||
@ -487,6 +489,15 @@ abstract class BaseBrowserFragment :
|
|||||||
tabId = customTabSessionId,
|
tabId = customTabSessionId,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val copyDownloadFeature = CopyDownloadFeature(
|
||||||
|
context = context.applicationContext,
|
||||||
|
httpClient = context.components.core.client,
|
||||||
|
store = store,
|
||||||
|
tabId = customTabSessionId,
|
||||||
|
snackbarParent = binding.dynamicSnackbarContainer,
|
||||||
|
snackbarDelegate = FenixSnackbarDelegate(binding.dynamicSnackbarContainer),
|
||||||
|
)
|
||||||
|
|
||||||
val downloadFeature = DownloadsFeature(
|
val downloadFeature = DownloadsFeature(
|
||||||
context.applicationContext,
|
context.applicationContext,
|
||||||
store = store,
|
store = store,
|
||||||
@ -595,6 +606,12 @@ abstract class BaseBrowserFragment :
|
|||||||
view = view,
|
view = view,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
copyDownloadsFeature.set(
|
||||||
|
copyDownloadFeature,
|
||||||
|
owner = this,
|
||||||
|
view = view,
|
||||||
|
)
|
||||||
|
|
||||||
downloadsFeature.set(
|
downloadsFeature.set(
|
||||||
downloadFeature,
|
downloadFeature,
|
||||||
owner = this,
|
owner = this,
|
||||||
|
@ -8,7 +8,8 @@ import android.content.Context
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import mozilla.components.feature.contextmenu.ContextMenuCandidate
|
import mozilla.components.feature.contextmenu.ContextMenuCandidate
|
||||||
import mozilla.components.feature.contextmenu.ContextMenuUseCases
|
import mozilla.components.feature.contextmenu.ContextMenuUseCases
|
||||||
import mozilla.components.feature.contextmenu.DefaultSnackbarDelegate
|
import mozilla.components.support.utils.DefaultSnackbarDelegate
|
||||||
|
import mozilla.components.support.utils.SnackbarDelegate
|
||||||
|
|
||||||
class CustomTabContextMenuCandidate {
|
class CustomTabContextMenuCandidate {
|
||||||
companion object {
|
companion object {
|
||||||
@ -20,7 +21,7 @@ class CustomTabContextMenuCandidate {
|
|||||||
context: Context,
|
context: Context,
|
||||||
contextMenuUseCases: ContextMenuUseCases,
|
contextMenuUseCases: ContextMenuUseCases,
|
||||||
snackBarParentView: View,
|
snackBarParentView: View,
|
||||||
snackbarDelegate: ContextMenuCandidate.SnackbarDelegate = DefaultSnackbarDelegate(),
|
snackbarDelegate: SnackbarDelegate = DefaultSnackbarDelegate(),
|
||||||
): List<ContextMenuCandidate> = listOf(
|
): List<ContextMenuCandidate> = listOf(
|
||||||
ContextMenuCandidate.createCopyLinkCandidate(
|
ContextMenuCandidate.createCopyLinkCandidate(
|
||||||
context,
|
context,
|
||||||
|
@ -6,10 +6,10 @@ package org.mozilla.fenix.browser
|
|||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import mozilla.components.feature.contextmenu.ContextMenuCandidate
|
import mozilla.components.support.utils.SnackbarDelegate
|
||||||
import org.mozilla.fenix.components.FenixSnackbar
|
import org.mozilla.fenix.components.FenixSnackbar
|
||||||
|
|
||||||
class FenixSnackbarDelegate(private val view: View) : ContextMenuCandidate.SnackbarDelegate {
|
class FenixSnackbarDelegate(private val view: View) : SnackbarDelegate {
|
||||||
|
|
||||||
override fun show(
|
override fun show(
|
||||||
snackBarParentView: View,
|
snackBarParentView: View,
|
||||||
|
Loading…
Reference in New Issue
Block a user