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

SimpleRedirectDialogFragment

class SimpleRedirectDialogFragment : RedirectDialogFragment (source)

This is the default implementation of the RedirectDialogFragment.

It provides an AlertDialog giving the user the choice to allow or deny the opening of a third party app.

Intents passed are guaranteed to be openable by a non-browser app.

Constructors

Name Summary
<init> SimpleRedirectDialogFragment()
This is the default implementation of the RedirectDialogFragment.

Inherited Properties

Name Summary
onCancelRedirect var onCancelRedirect: () -> Unit?
A callback to trigger when user dismisses the dialog. For instance, a valid use case can be in confirmation dialog, after the negative button is clicked, this callback must be called.
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
onCreateDialog fun onCreateDialog(savedInstanceState: <ERROR CLASS>?): <ERROR CLASS>

Inherited Functions

Name Summary
setAppLinkRedirectUrl fun setAppLinkRedirectUrl(url: String): Unit
add the metadata of this download object to the arguments of this fragment.

Companion Object Properties

Name Summary
KEY_CANCELABLE const val KEY_CANCELABLE: String
KEY_NEGATIVE_TEXT const val KEY_NEGATIVE_TEXT: String
KEY_POSITIVE_TEXT const val KEY_POSITIVE_TEXT: String
KEY_THEME_ID const val KEY_THEME_ID: String
KEY_TITLE_TEXT const val KEY_TITLE_TEXT: String

Companion Object Functions

Name Summary
newInstance fun newInstance(dialogTitleText: Int = R.string.mozac_feature_applinks_confirm_dialog_title, positiveButtonText: Int = R.string.mozac_feature_applinks_confirm_dialog_confirm, negativeButtonText: Int = R.string.mozac_feature_applinks_confirm_dialog_deny, themeResId: Int = 0, cancelable: Boolean = false): RedirectDialogFragment
A builder method for creating a SimpleRedirectDialogFragment

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.