com.actionbarsherlock.internal.widget
Class IcsProgressBar

java.lang.Object
  extended by android.view.View
      extended by com.actionbarsherlock.internal.widget.IcsProgressBar
All Implemented Interfaces:
android.graphics.drawable.Drawable.Callback, android.view.accessibility.AccessibilityEventSource, android.view.KeyEvent.Callback

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 &lt;ProgressBar&gt; 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:

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


Nested Class Summary
 
Nested classes/interfaces inherited from class android.view.View
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
 
Field Summary
 
Fields inherited from class android.view.View
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_YES, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, 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_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_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_INHERIT, TEXT_ALIGNMENT_RESOLVED_DEFAULT, TRANSLATION_X, TRANSLATION_Y, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y
 
Constructor Summary
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)
           
 
Method Summary
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)
           
 
Methods inherited from class android.view.View
addChildrenForAccessibility, addFocusables, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addTouchables, animate, announceForAccessibility, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, 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, getAccessibilityNodeProvider, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLayerType, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOverScrollMode, getPaddingBottom, getPaddingLeft, getPaddingRight, 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, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, hasFocus, hasFocusable, hasOnClickListeners, hasOverlappingRendering, hasTransientState, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, isActivated, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isOpaque, isPaddingOffsetRequired, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, 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, 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, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLayerType, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOverScrollMode, setPadding, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setSystemUiVisibility, setTag, setTag, setTop, setTouchDelegate, setTranslationX, setTranslationY, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, startActionMode, startAnimation, startDrag, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDraw
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IcsProgressBar

public IcsProgressBar(android.content.Context context)
Create a new progress bar with range 0...100 and initial progress of 0.

Parameters:
context - the application environment

IcsProgressBar

public IcsProgressBar(android.content.Context context,
                      android.util.AttributeSet attrs)

IcsProgressBar

public IcsProgressBar(android.content.Context context,
                      android.util.AttributeSet attrs,
                      int defStyle)

IcsProgressBar

public IcsProgressBar(android.content.Context context,
                      android.util.AttributeSet attrs,
                      int defStyle,
                      int styleRes)
Method Detail

isIndeterminate

public boolean isIndeterminate()

Indicate whether this progress bar is in indeterminate mode.

Returns:
true if the progress bar is in indeterminate mode

setIndeterminate

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.

Parameters:
indeterminate - true to enable the indeterminate mode

getIndeterminateDrawable

public android.graphics.drawable.Drawable getIndeterminateDrawable()

Get the drawable used to draw the progress bar in indeterminate mode.

Returns:
a Drawable instance
See Also:
setIndeterminateDrawable(android.graphics.drawable.Drawable), setIndeterminate(boolean)

setIndeterminateDrawable

public void setIndeterminateDrawable(android.graphics.drawable.Drawable d)

Define the drawable used to draw the progress bar in indeterminate mode.

Parameters:
d - the new drawable
See Also:
getIndeterminateDrawable(), setIndeterminate(boolean)

getProgressDrawable

public android.graphics.drawable.Drawable getProgressDrawable()

Get the drawable used to draw the progress bar in progress mode.

Returns:
a Drawable instance
See Also:
setProgressDrawable(android.graphics.drawable.Drawable), setIndeterminate(boolean)

setProgressDrawable

public void setProgressDrawable(android.graphics.drawable.Drawable d)

Define the drawable used to draw the progress bar in progress mode.

Parameters:
d - the new drawable
See Also:
getProgressDrawable(), setIndeterminate(boolean)

verifyDrawable

protected boolean verifyDrawable(android.graphics.drawable.Drawable who)
Overrides:
verifyDrawable in class android.view.View

jumpDrawablesToCurrentState

public void jumpDrawablesToCurrentState()
Overrides:
jumpDrawablesToCurrentState in class android.view.View

postInvalidate

public void postInvalidate()
Overrides:
postInvalidate in class android.view.View

setProgress

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.

Parameters:
progress - the new progress, between 0 and getMax()
See Also:
setIndeterminate(boolean), isIndeterminate(), getProgress(), incrementProgressBy(int)

setSecondaryProgress

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.

Parameters:
secondaryProgress - the new secondary progress, between 0 and getMax()
See Also:
setIndeterminate(boolean), isIndeterminate(), getSecondaryProgress(), incrementSecondaryProgressBy(int)

getProgress

public int getProgress()

Get the progress bar's current level of progress. Return 0 when the progress bar is in indeterminate mode.

Returns:
the current progress, between 0 and getMax()
See Also:
setIndeterminate(boolean), isIndeterminate(), setProgress(int), setMax(int), getMax()

getSecondaryProgress

public int getSecondaryProgress()

Get the progress bar's current level of secondary progress. Return 0 when the progress bar is in indeterminate mode.

Returns:
the current secondary progress, between 0 and getMax()
See Also:
setIndeterminate(boolean), isIndeterminate(), setSecondaryProgress(int), setMax(int), getMax()

getMax

public int getMax()

Return the upper limit of this progress bar's range.

Returns:
a positive integer
See Also:
setMax(int), getProgress(), getSecondaryProgress()

setMax

public void setMax(int max)

Set the range of the progress bar to 0...max.

Parameters:
max - the upper range of this progress bar
See Also:
getMax(), setProgress(int), setSecondaryProgress(int)

incrementProgressBy

public final void incrementProgressBy(int diff)

Increase the progress bar's progress by the specified amount.

Parameters:
diff - the amount by which the progress must be increased
See Also:
setProgress(int)

incrementSecondaryProgressBy

public final void incrementSecondaryProgressBy(int diff)

Increase the progress bar's secondary progress by the specified amount.

Parameters:
diff - the amount by which the secondary progress must be increased
See Also:
setSecondaryProgress(int)

setInterpolator

public void setInterpolator(android.content.Context context,
                            int resID)
Sets the acceleration curve for the indeterminate animation. The interpolator is loaded as a resource from the specified context.

Parameters:
context - The application environment
resID - The resource identifier of the interpolator to load

setInterpolator

public void setInterpolator(android.view.animation.Interpolator interpolator)
Sets the acceleration curve for the indeterminate animation. Defaults to a linear interpolation.

Parameters:
interpolator - The interpolator which defines the acceleration curve

getInterpolator

public android.view.animation.Interpolator getInterpolator()
Gets the acceleration curve type for the indeterminate animation.

Returns:
the Interpolator associated to this animation

setVisibility

public void setVisibility(int v)
Overrides:
setVisibility in class android.view.View

onVisibilityChanged

protected void onVisibilityChanged(android.view.View changedView,
                                   int visibility)
Overrides:
onVisibilityChanged in class android.view.View

invalidateDrawable

public void invalidateDrawable(android.graphics.drawable.Drawable dr)
Specified by:
invalidateDrawable in interface android.graphics.drawable.Drawable.Callback
Overrides:
invalidateDrawable in class android.view.View

onSizeChanged

protected void onSizeChanged(int w,
                             int h,
                             int oldw,
                             int oldh)
Overrides:
onSizeChanged in class android.view.View

onDraw

protected void onDraw(android.graphics.Canvas canvas)
Overrides:
onDraw in class android.view.View

onMeasure

protected void onMeasure(int widthMeasureSpec,
                         int heightMeasureSpec)
Overrides:
onMeasure in class android.view.View

drawableStateChanged

protected void drawableStateChanged()
Overrides:
drawableStateChanged in class android.view.View

onSaveInstanceState

public android.os.Parcelable onSaveInstanceState()
Overrides:
onSaveInstanceState in class android.view.View

onRestoreInstanceState

public void onRestoreInstanceState(android.os.Parcelable state)
Overrides:
onRestoreInstanceState in class android.view.View

onAttachedToWindow

protected void onAttachedToWindow()
Overrides:
onAttachedToWindow in class android.view.View

onDetachedFromWindow

protected void onDetachedFromWindow()
Overrides:
onDetachedFromWindow in class android.view.View

onInitializeAccessibilityEvent

public void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent event)
Overrides:
onInitializeAccessibilityEvent in class android.view.View


Copyright © 2012-2013. All Rights Reserved.