DownloadProgressFragment

A fragment for retaining a DownloadJob and showing its progress. Create the fragment via its constructor and set its job. This is a retained fragment and can't be used as nested fragment.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override val dialog: Dialog?
Link copied to clipboard

The DownloadJob being tracked and displayed by this fragment. Reading returns the retained job, or null if none was set. Assigning a job makes the fragment retain it across configuration changes (if added to the activity) and show its progress via a dialog.

Functions

Link copied to clipboard
open override fun getDialog(): Dialog?

Returns the Dialog managed by this fragment.

Link copied to clipboard
open override fun onCancel(dialog: DialogInterface)

Called when the dialog is cancelled by the user. Cancels the progress collection, cancels the download job, and notifies any registered cancel listener.

Link copied to clipboard
open override fun onCreate(savedInstanceState: Bundle?)

Called when the fragment is first created. Sets the fragment to be retained across configuration changes.

Link copied to clipboard
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog

Creates and returns the download progress dialog.

Link copied to clipboard
open override fun onDestroyView()

Called when the view hierarchy associated with the fragment is being removed. Handles the retained instance bug by clearing the dismiss message.

Link copied to clipboard

Sets a DialogInterface.OnCancelListener that will be informed when the progress dialog was cancelled by the user. Calling this method will replace any previously set listener. You may provide null to clear the listener.