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.
Consumers must implement the DownloadDialogListener interface on their Activity/Fragment to ensure that they will get notified on positiveButtonClick and negativeButtonClick events after activity/fragment is recreated.
If you are using this class from a android.support.v4.app.Fragment you must use a childFragmentManager or you will get a ClassCastException.
interface DownloadDialogListener |
SimpleDownloadDialogFragment()
A confirmation dialog to be called before a download is triggered. Meant to be used in collaboration with DownloadsFeature |
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. |
fun onAttach(context: Context): Unit |
|
fun onCreateDialog(savedInstanceState: Bundle?): Dialog |
fun setDownload(download: Download): Unit
add the metadata of this download object to the arguments of this fragment. |
const val KEY_CANCELABLE: String |
|
const val KEY_NEGATIVE_TEXT: String |
|
const val KEY_POSITIVE_TEXT: String |
|
const val KEY_THEME_ID: String |
|
const val KEY_TITLE_TEXT: String |
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 |