2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00
* For https://github.com/mozilla-mobile/fenix/issues/8412: Passes error handling function to 'CustomTabWindowFeature'

Change required for showing error message when the app can't handle a specific
scheme. Implemented in AC:
https://github.com/mozilla-mobile/android-components/pull/6122

* Upgrade AC version

Co-authored-by: Sawyer Blatz <sdblatz@gmail.com>
This commit is contained in:
ValentinTimisica 2020-03-31 20:17:29 +03:00 committed by GitHub
parent 3d7f7cbe5d
commit 7d57c791f0
3 changed files with 13 additions and 3 deletions

View File

@ -33,6 +33,7 @@ import org.mozilla.fenix.R
import org.mozilla.fenix.browser.BaseBrowserFragment import org.mozilla.fenix.browser.BaseBrowserFragment
import org.mozilla.fenix.browser.CustomTabContextMenuCandidate import org.mozilla.fenix.browser.CustomTabContextMenuCandidate
import org.mozilla.fenix.browser.FenixSnackbarDelegate import org.mozilla.fenix.browser.FenixSnackbarDelegate
import org.mozilla.fenix.components.FenixSnackbar
import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.nav import org.mozilla.fenix.ext.nav
import org.mozilla.fenix.ext.requireComponents import org.mozilla.fenix.ext.requireComponents
@ -50,7 +51,7 @@ class ExternalAppBrowserFragment : BaseBrowserFragment(), UserInteractionHandler
private val windowFeature = ViewBoundFeatureWrapper<CustomTabWindowFeature>() private val windowFeature = ViewBoundFeatureWrapper<CustomTabWindowFeature>()
private val hideToolbarFeature = ViewBoundFeatureWrapper<WebAppHideToolbarFeature>() private val hideToolbarFeature = ViewBoundFeatureWrapper<WebAppHideToolbarFeature>()
@Suppress("LongMethod") @Suppress("LongMethod", "ComplexMethod")
override fun initializeUI(view: View): Session? { override fun initializeUI(view: View): Session? {
return super.initializeUI(view)?.also { return super.initializeUI(view)?.also {
val activity = requireActivity() val activity = requireActivity()
@ -82,7 +83,13 @@ class ExternalAppBrowserFragment : BaseBrowserFragment(), UserInteractionHandler
activity, activity,
components.core.store, components.core.store,
customTabSessionId customTabSessionId
), ) { exception ->
components.analytics.crashReporter.submitCaughtException(exception)
FenixSnackbar.make(view.swipeRefresh, FenixSnackbar.LENGTH_LONG).apply {
setText(resources.getString(R.string.unknown_scheme_error_message))
setAppropriateBackground(true)
}.show()
},
owner = this, owner = this,
view = view view = view
) )

View File

@ -113,6 +113,9 @@
<string name="browser_menu_open_app_link">Open in app</string> <string name="browser_menu_open_app_link">Open in app</string>
<!-- Browser menu button to configure reader mode appearance e.g. the used font type and size --> <!-- Browser menu button to configure reader mode appearance e.g. the used font type and size -->
<string name="browser_menu_read_appearance">Appearance</string> <string name="browser_menu_read_appearance">Appearance</string>
<!-- Error message to show when the user tries to access a scheme not
handled by the app (Ex: blob, tel etc) -->
<string name="unknown_scheme_error_message">Unable to connect. Unrecognizable URL scheme.</string>
<!-- Locale Settings Fragment --> <!-- Locale Settings Fragment -->
<!-- Content description for tick mark on selected language --> <!-- Content description for tick mark on selected language -->

View File

@ -3,5 +3,5 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
object AndroidComponents { object AndroidComponents {
const val VERSION = "38.0.20200329190103" const val VERSION = "38.0.20200331130030"
} }