Register now for Android Dev Summit 2019!

ProgressBarManager

class ProgressBarManager
kotlin.Any
   ↳ androidx.leanback.app.ProgressBarManager

Manager for showing/hiding progress bar widget. This class lets user specify an initial delay after which the progress bar will be shown. This is currently being used in BrowseFragment & VerticalGridFragment to show ProgressBar while the data is being loaded.

Summary

Public constructors

Manager for showing/hiding progress bar widget.

Public methods

Unit

Disables progress bar.

Unit

Enables progress bar.

Long

Returns the initial delay.

Unit

Hides the progress bar.

Unit
setInitialDelay(initialDelay: Long)

Sets the initial delay.

Unit
setProgressBarView(progressBarView: View!)

Sets a custom view to be shown in place of the default ProgressBar.

Unit
setRootView(rootView: ViewGroup!)

Sets the root view on which the progress bar will be attached.

Unit

Displays the progress bar.

Public constructors

<init>

ProgressBarManager()

Manager for showing/hiding progress bar widget. This class lets user specify an initial delay after which the progress bar will be shown. This is currently being used in BrowseFragment & VerticalGridFragment to show ProgressBar while the data is being loaded.

Public methods

disableProgressBar

fun disableProgressBar(): Unit

Disables progress bar.

enableProgressBar

fun enableProgressBar(): Unit

Enables progress bar.

getInitialDelay

fun getInitialDelay(): Long

Returns the initial delay.

hide

fun hide(): Unit

Hides the progress bar.

setInitialDelay

fun setInitialDelay(initialDelay: Long): Unit

Sets the initial delay. Progress bar will be shown after this delay has elapsed.

Parameters
initialDelay Long: millisecond representing the initial delay.

setProgressBarView

fun setProgressBarView(progressBarView: View!): Unit

Sets a custom view to be shown in place of the default ProgressBar. This view must have a parent. Once set, we maintain the visibility property of this view.

Parameters
progressBarView View!: custom view that will be shown to indicate progress.

setRootView

fun setRootView(rootView: ViewGroup!): Unit

Sets the root view on which the progress bar will be attached. This class assumes the root view to be FrameLayout in order to position the progress bar widget in the center of the screen.

Parameters
rootView ViewGroup!: view that will contain the progress bar.

show

fun show(): Unit

Displays the progress bar.