public class IcsProgressBar
extends android.view.View
Visual indicator of progress in some operation. Displays a bar to the user representing how far the operation has progressed; the application can change the amount of progress (modifying the length of the bar) as it moves forward. There is also a secondary progress displayable on a progress bar which is useful for displaying intermediate progress, such as the buffer level during a streaming playback progress bar.
A progress bar can also be made indeterminate. In indeterminate mode, the progress bar shows a cyclic animation without an indication of progress. This mode is used by applications when the length of the task is unknown. The indeterminate progress bar can be either a spinning wheel or a horizontal bar.
The following code example shows how a progress bar can be used from a worker thread to update the user interface to notify the user of progress:
public class MyActivity extends Activity { private static final int PROGRESS = 0x1; private ProgressBar mProgress; private int mProgressStatus = 0; private Handler mHandler = new Handler(); protected void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.progressbar_activity); mProgress = (ProgressBar) findViewById(R.id.progress_bar); // Start lengthy operation in a background thread new Thread(new Runnable() { public void run() { while (mProgressStatus < 100) { mProgressStatus = doWork(); // Update the progress bar mHandler.post(new Runnable() { public void run() { mProgress.setProgress(mProgressStatus); } }); } } }).start(); } }
To add a progress bar to a layout file, you can use the <ProgressBar>
element.
By default, the progress bar is a spinning wheel (an indeterminate indicator). To change to a
horizontal progress bar, apply the Widget.ProgressBar.Horizontal
style, like so:
<ProgressBar style="@android:style/Widget.ProgressBar.Horizontal" ... />
If you will use the progress bar to show real progress, you must use the horizontal bar. You
can then increment the progress with incrementProgressBy()
or
setProgress()
. By default, the progress bar is full when it reaches 100. If
necessary, you can adjust the maximum value (the value for a full bar) using the android:max
attribute. Other attributes available are listed
below.
Another common style to apply to the progress bar is Widget.ProgressBar.Small
, which shows a smaller
version of the spinning wheel—useful when waiting for content to load.
For example, you can insert this kind of progress bar into your default layout for
a view that will be populated by some content fetched from the Internet—the spinning wheel
appears immediately and when your application receives the content, it replaces the progress bar
with the loaded content. For example:
<LinearLayout android:orientation="horizontal" ... > <ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" style="@android:style/Widget.ProgressBar.Small" android:layout_marginRight="5dp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/loading" /> </LinearLayout>
Other progress bar styles provided by the system include:
Widget.ProgressBar.Horizontal
Widget.ProgressBar.Small
Widget.ProgressBar.Large
Widget.ProgressBar.Inverse
Widget.ProgressBar.Small.Inverse
Widget.ProgressBar.Large.Inverse
The "inverse" styles provide an inverse color scheme for the spinner, which may be necessary if your application uses a light colored theme (a white background).
XML attributes
See ProgressBar Attributes
,
View Attributes
android.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnAttachStateChangeListener, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener
ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y
Constructor and Description |
---|
IcsProgressBar(android.content.Context context)
Create a new progress bar with range 0...100 and initial progress of 0.
|
IcsProgressBar(android.content.Context context,
android.util.AttributeSet attrs) |
IcsProgressBar(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle) |
IcsProgressBar(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle,
int styleRes) |
Modifier and Type | Method and Description |
---|---|
protected void |
drawableStateChanged() |
android.graphics.drawable.Drawable |
getIndeterminateDrawable()
Get the drawable used to draw the progress bar in
indeterminate mode.
|
android.view.animation.Interpolator |
getInterpolator()
Gets the acceleration curve type for the indeterminate animation.
|
int |
getMax()
Return the upper limit of this progress bar's range.
|
int |
getProgress()
Get the progress bar's current level of progress.
|
android.graphics.drawable.Drawable |
getProgressDrawable()
Get the drawable used to draw the progress bar in
progress mode.
|
int |
getSecondaryProgress()
Get the progress bar's current level of secondary progress.
|
void |
incrementProgressBy(int diff)
Increase the progress bar's progress by the specified amount.
|
void |
incrementSecondaryProgressBy(int diff)
Increase the progress bar's secondary progress by the specified amount.
|
void |
invalidateDrawable(android.graphics.drawable.Drawable dr) |
boolean |
isIndeterminate()
Indicate whether this progress bar is in indeterminate mode.
|
void |
jumpDrawablesToCurrentState() |
protected void |
onAttachedToWindow() |
protected void |
onDetachedFromWindow() |
protected void |
onDraw(android.graphics.Canvas canvas) |
void |
onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent event) |
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec) |
void |
onRestoreInstanceState(android.os.Parcelable state) |
android.os.Parcelable |
onSaveInstanceState() |
protected void |
onSizeChanged(int w,
int h,
int oldw,
int oldh) |
protected void |
onVisibilityChanged(android.view.View changedView,
int visibility) |
void |
postInvalidate() |
void |
setIndeterminate(boolean indeterminate)
Change the indeterminate mode for this progress bar.
|
void |
setIndeterminateDrawable(android.graphics.drawable.Drawable d)
Define the drawable used to draw the progress bar in
indeterminate mode.
|
void |
setInterpolator(android.content.Context context,
int resID)
Sets the acceleration curve for the indeterminate animation.
|
void |
setInterpolator(android.view.animation.Interpolator interpolator)
Sets the acceleration curve for the indeterminate animation.
|
void |
setMax(int max)
Set the range of the progress bar to 0...max.
|
void |
setProgress(int progress)
Set the current progress to the specified value.
|
void |
setProgressDrawable(android.graphics.drawable.Drawable d)
Define the drawable used to draw the progress bar in
progress mode.
|
void |
setSecondaryProgress(int secondaryProgress)
Set the current secondary progress to the specified value.
|
void |
setVisibility(int v) |
protected boolean |
verifyDrawable(android.graphics.drawable.Drawable who) |
addChildrenForAccessibility, addFocusables, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addTouchables, animate, announceForAccessibility, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, clearFocus, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchGenericFocusedEvent, dispatchGenericMotionEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, draw, findFocus, findViewById, findViewsWithText, findViewWithTag, fitSystemWindows, focusSearch, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOverlay, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, hasFocus, hasFocusable, hasOnClickListeners, hasOverlappingRendering, hasTransientState, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, isActivated, isAttachedToWindow, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isInEditMode, isInLayout, isInTouchMode, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onCancelPendingInputEvents, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateDrawableState, onCreateInputConnection, onDisplayHint, onDragEvent, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onLayout, onOverScrolled, onPopulateAccessibilityEvent, onRtlPropertiesChanged, onScreenStateChanged, onScrollChanged, onSetAlpha, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestFitSystemWindows, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityLiveRegion, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setClipBounds, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTop, setTouchDelegate, setTranslationX, setTranslationY, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, startActionMode, startAnimation, startDrag, toString, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDraw
public IcsProgressBar(android.content.Context context)
context
- the application environmentpublic IcsProgressBar(android.content.Context context, android.util.AttributeSet attrs)
public IcsProgressBar(android.content.Context context, android.util.AttributeSet attrs, int defStyle)
public IcsProgressBar(android.content.Context context, android.util.AttributeSet attrs, int defStyle, int styleRes)
public boolean isIndeterminate()
Indicate whether this progress bar is in indeterminate mode.
public void setIndeterminate(boolean indeterminate)
Change the indeterminate mode for this progress bar. In indeterminate mode, the progress is ignored and the progress bar shows an infinite animation instead.
If this progress bar's style only supports indeterminate mode (such as the circular progress bars), then this will be ignored.indeterminate
- true to enable the indeterminate modepublic android.graphics.drawable.Drawable getIndeterminateDrawable()
Get the drawable used to draw the progress bar in indeterminate mode.
Drawable
instancesetIndeterminateDrawable(android.graphics.drawable.Drawable)
,
setIndeterminate(boolean)
public void setIndeterminateDrawable(android.graphics.drawable.Drawable d)
Define the drawable used to draw the progress bar in indeterminate mode.
d
- the new drawablegetIndeterminateDrawable()
,
setIndeterminate(boolean)
public android.graphics.drawable.Drawable getProgressDrawable()
Get the drawable used to draw the progress bar in progress mode.
Drawable
instancesetProgressDrawable(android.graphics.drawable.Drawable)
,
setIndeterminate(boolean)
public void setProgressDrawable(android.graphics.drawable.Drawable d)
Define the drawable used to draw the progress bar in progress mode.
d
- the new drawablegetProgressDrawable()
,
setIndeterminate(boolean)
protected boolean verifyDrawable(android.graphics.drawable.Drawable who)
verifyDrawable
in class android.view.View
public void jumpDrawablesToCurrentState()
jumpDrawablesToCurrentState
in class android.view.View
public void postInvalidate()
postInvalidate
in class android.view.View
public void setProgress(int progress)
Set the current progress to the specified value. Does not do anything if the progress bar is in indeterminate mode.
progress
- the new progress, between 0 and getMax()
setIndeterminate(boolean)
,
isIndeterminate()
,
getProgress()
,
incrementProgressBy(int)
public void setSecondaryProgress(int secondaryProgress)
Set the current secondary progress to the specified value. Does not do anything if the progress bar is in indeterminate mode.
secondaryProgress
- the new secondary progress, between 0 and getMax()
setIndeterminate(boolean)
,
isIndeterminate()
,
getSecondaryProgress()
,
incrementSecondaryProgressBy(int)
public int getProgress()
Get the progress bar's current level of progress. Return 0 when the progress bar is in indeterminate mode.
getMax()
setIndeterminate(boolean)
,
isIndeterminate()
,
setProgress(int)
,
setMax(int)
,
getMax()
public int getSecondaryProgress()
Get the progress bar's current level of secondary progress. Return 0 when the progress bar is in indeterminate mode.
getMax()
setIndeterminate(boolean)
,
isIndeterminate()
,
setSecondaryProgress(int)
,
setMax(int)
,
getMax()
public int getMax()
Return the upper limit of this progress bar's range.
setMax(int)
,
getProgress()
,
getSecondaryProgress()
public void setMax(int max)
Set the range of the progress bar to 0...max.
max
- the upper range of this progress bargetMax()
,
setProgress(int)
,
setSecondaryProgress(int)
public final void incrementProgressBy(int diff)
Increase the progress bar's progress by the specified amount.
diff
- the amount by which the progress must be increasedsetProgress(int)
public final void incrementSecondaryProgressBy(int diff)
Increase the progress bar's secondary progress by the specified amount.
diff
- the amount by which the secondary progress must be increasedsetSecondaryProgress(int)
public void setInterpolator(android.content.Context context, int resID)
context
- The application environmentresID
- The resource identifier of the interpolator to loadpublic void setInterpolator(android.view.animation.Interpolator interpolator)
interpolator
- The interpolator which defines the acceleration curvepublic android.view.animation.Interpolator getInterpolator()
Interpolator
associated to this animationpublic void setVisibility(int v)
setVisibility
in class android.view.View
protected void onVisibilityChanged(android.view.View changedView, int visibility)
onVisibilityChanged
in class android.view.View
public void invalidateDrawable(android.graphics.drawable.Drawable dr)
invalidateDrawable
in interface android.graphics.drawable.Drawable.Callback
invalidateDrawable
in class android.view.View
protected void onSizeChanged(int w, int h, int oldw, int oldh)
onSizeChanged
in class android.view.View
protected void onDraw(android.graphics.Canvas canvas)
onDraw
in class android.view.View
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
onMeasure
in class android.view.View
protected void drawableStateChanged()
drawableStateChanged
in class android.view.View
public android.os.Parcelable onSaveInstanceState()
onSaveInstanceState
in class android.view.View
public void onRestoreInstanceState(android.os.Parcelable state)
onRestoreInstanceState
in class android.view.View
protected void onAttachedToWindow()
onAttachedToWindow
in class android.view.View
protected void onDetachedFromWindow()
onDetachedFromWindow
in class android.view.View
public void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)
onInitializeAccessibilityEvent
in class android.view.View
Copyright © 2011–2014. All rights reserved.