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 use 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 it triggered.

Constructors

<init>

SimpleDownloadDialogFragment()

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

Inherited Properties

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

onCreateDialog

fun onCreateDialog(savedInstanceState: Bundle?): Dialog

Inherited Functions

setDownload

fun setDownload(download: Download): Unit

add the metadata of this download object to the arguments of this fragment.

Companion Object Properties

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

newInstance

fun newInstance(dialogTitleText: Int = mozac_feature_downloads_dialog_download, positiveButtonText: Int = mozac_feature_downloads_dialog_download, negativeButtonText: Int = mozac_feature_downloads_dialog_cancel, themeResId: Int = 0, cancelable: Boolean = false): SimpleDownloadDialogFragment

A builder method for creating a SimpleDownloadDialogFragment