android-components / mozilla.components.feature.app.links / RedirectDialogFragment

RedirectDialogFragment

abstract class RedirectDialogFragment : DialogFragment (source)

This is a general representation of a dialog meant to be used in collaboration with AppLinksFeature to show a dialog before an external link is opened. If SimpleRedirectDialogFragment is not flexible enough for your use case you should inherit for this class. Be mindful to call onConfirmRedirect when you want to open the linked app.

Constructors

Name Summary
<init> RedirectDialogFragment()
This is a general representation of a dialog meant to be used in collaboration with AppLinksFeature to show a dialog before an external link is opened. If SimpleRedirectDialogFragment is not flexible enough for your use case you should inherit for this class. Be mindful to call onConfirmRedirect when you want to open the linked app.

Properties

Name Summary
onConfirmRedirect var onConfirmRedirect: () -> Unit
A callback to trigger a download, call it when you are ready to open the linked app. For instance, a valid use case can be in confirmation dialog, after the positive button is clicked, this callback must be called.

Functions

Name Summary
setAppLinkRedirect fun setAppLinkRedirect(redirect: AppLinkRedirect): Unit
add the metadata of this download object to the arguments of this fragment.

Companion Object Properties

Name Summary
FRAGMENT_TAG const val FRAGMENT_TAG: String
KEY_INTENT_URL const val KEY_INTENT_URL: String
Key for finding the app link.

Extension Functions

Name Summary
consumeFrom fun <S : State, A : Action> Fragment.consumeFrom(store: Store<S, A>, block: (S) -> Unit): Unit
Helper extension method for consuming State from a Store sequentially in order inside a Fragment. The block function will get invoked for every State update.
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.

Inheritors

Name Summary
SimpleRedirectDialogFragment class SimpleRedirectDialogFragment : RedirectDialogFragment
This is the default implementation of the RedirectDialogFragment.