android-components / mozilla.components.feature.downloads / SimpleDownloadDialogFragment

SimpleDownloadDialogFragment

class SimpleDownloadDialogFragment : DownloadDialogFragment (source)

A confirmation dialog to be called before a download is triggered. Meant to be used in collaboration with DownloadsFeature

SimpleDownloadDialogFragment is the default dialog used by DownloadsFeature if you don’t provide a value. It is composed by a title, a negative and a positive bottoms. When the positive button is clicked the download is triggered.

Constructors

Name Summary
<init> SimpleDownloadDialogFragment()
A confirmation dialog to be called before a download is triggered. Meant to be used in collaboration with DownloadsFeature

Inherited Properties

Name Summary
onCancelDownload var onCancelDownload: () -> Unit
onStartDownload var onStartDownload: () -> Unit
A callback to trigger a download, call it when you are ready to start a download. 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
setDownload fun setDownload(download: DownloadState): Unit
Add the metadata of this download object to the arguments of this fragment.

Companion Object Properties

Name Summary
KEY_DOWNLOAD_TEXT const val KEY_DOWNLOAD_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_downloads_dialog_title2, downloadButtonText: Int = R.string.mozac_feature_downloads_dialog_download, themeResId: Int = 0, promptsStyling: PromptsStyling? = null): SimpleDownloadDialogFragment
A builder method for creating a SimpleDownloadDialogFragment

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.