public class

ProgressBar

extends View
java.lang.Object
   ↳ com.neomades.ui.View
     ↳ com.neomades.ui.ProgressBar

Class Overview

A progress bar used as an indicator to show the progress of a download, a loading, etc.

Summary

[Expand]
Inherited XML Attributes
From class com.neomades.ui.View
[Expand]
Inherited Constants
From interface com.neomades.ui.Alignment
From interface com.neomades.ui.StretchMode
Public Constructors
ProgressBar()
Initializes the progress bar.
Public Methods
void setMax(int max)
Sets the maximum value of this progress bar.
void setProgress(int progress)
Sets the progress value of this progress bar.
[Expand]
Inherited Methods
From class com.neomades.ui.View
From class java.lang.Object

Public Constructors

public ProgressBar ()

Initializes the progress bar. By default the max will be set to 100 and the progress will be set to 0.

Public Methods

public void setMax (int max)

Sets the maximum value of this progress bar.

This is useful for example in the case of a download. Using a HttpProgressListener the max value can be set to the total length given by the listener and the progress value to the current value given by the listener.

Parameters
max the max value (must be > 0)
Throws
IllegalArgumentException if max is less than or equal to 0

public void setProgress (int progress)

Sets the progress value of this progress bar. If progress is greater than the current max value, max value will be set as the current progress. If progress is negative, 0 will be set as the current progress.