sk.baka.ambient.views
Class TextProgressBar

java.lang.Object
  extended by android.view.View
      extended by android.widget.ProgressBar
          extended by sk.baka.ambient.views.TextProgressBar
All Implemented Interfaces:
Drawable.Callback, KeyEvent.Callback

public class TextProgressBar
extends ProgressBar

Adds support for showing a text in the progress bar.

Author:
Martin Vysny

Nested Class Summary
 
Nested classes/interfaces inherited from class android.view.View
View.BaseSavedState, View.MeasureSpec, View.OnClickListener, View.OnCreateContextMenuListener, View.OnFocusChangeListener, View.OnKeyListener, View.OnLongClickListener, View.OnTouchListener
 
Field Summary
 
Fields inherited from class android.view.View
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, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, INVISIBLE, KEEP_SCREEN_ON, NO_ID, 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, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET
 
Constructor Summary
TextProgressBar(Context context)
           
TextProgressBar(Context context, AttributeSet attrs)
           
TextProgressBar(Context context, AttributeSet attrs, int defStyle)
           
 
Method Summary
 String getText()
          Returns currently shown text.
protected  void onDraw(Canvas canvas)
           
 void setText(int id)
          Sets the text currently being shown.
 void setText(String text)
          Sets the text currently being shown.
 
Methods inherited from class android.widget.ProgressBar
getIndeterminateDrawable, getInterpolator, getMax, getProgress, getProgressDrawable, getSecondaryProgress, incrementProgressBy, incrementSecondaryProgressBy, invalidateDrawable, isIndeterminate, onMeasure, onSizeChanged, postInvalidate, setIndeterminate, setIndeterminateDrawable, setInterpolator, setInterpolator, setMax, setProgress, setProgressDrawable, setSecondaryProgress, setVisibility, verifyDrawable
 
Methods inherited from class android.view.View
addFocusables, addTouchables, bringToFront, buildDrawingCache, cancelLongPress, clearAnimation, clearFocus, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createContextMenu, destroyDrawingCache, dispatchDraw, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetPressed, dispatchSetSelected, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, draw, drawableStateChanged, finalize, findFocus, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceLayout, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getBottomFadingEdgeStrength, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getKeepScreenOn, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMeasuredHeight, getMeasuredWidth, getNextFocusDownId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getResources, getRight, getRightFadingEdgeStrength, getRootView, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getTag, getTop, getTopFadingEdgeStrength, getTouchables, getTouchDelegate, getVerticalFadingEdgeLength, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowToken, getWindowVisibility, hasFocus, hasFocusable, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, isClickable, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isInTouchMode, isLayoutRequested, isLongClickable, isPressed, isSaveEnabled, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onAttachedToWindow, onCreateContextMenu, onCreateDrawableState, onDetachedFromWindow, onFinishInflate, onFocusChanged, onKeyDown, onKeyMultiple, onKeyShortcut, onKeyUp, onLayout, onRestoreInstanceState, onSaveInstanceState, onScrollChanged, onSetAlpha, onTouchEvent, onTrackballEvent, onWindowFocusChanged, onWindowVisibilityChanged, performClick, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, refreshDrawableState, removeCallbacks, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, setAnimation, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setClickable, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFocusable, setFocusableInTouchMode, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setId, setKeepScreenOn, setLayoutParams, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnCreateContextMenuListener, setOnFocusChangeListener, setOnKeyListener, setOnLongClickListener, setOnTouchListener, setPadding, setPressed, setSaveEnabled, setScrollBarStyle, setSelected, setSoundEffectsEnabled, setTag, setTouchDelegate, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setWillNotCacheDrawing, setWillNotDraw, showContextMenu, startAnimation, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDraw
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextProgressBar

public TextProgressBar(Context context)
Parameters:
context -

TextProgressBar

public TextProgressBar(Context context,
                       AttributeSet attrs)
Parameters:
context -
attrs -

TextProgressBar

public TextProgressBar(Context context,
                       AttributeSet attrs,
                       int defStyle)
Parameters:
context -
attrs -
defStyle -
Method Detail

getText

public String getText()
Returns currently shown text.

Returns:
the text.

setText

public void setText(String text)
Sets the text currently being shown.

Parameters:
text - non-null text.

onDraw

protected void onDraw(Canvas canvas)
Overrides:
onDraw in class ProgressBar

setText

public void setText(int id)
Sets the text currently being shown.

Parameters:
id - the text resource ID.


Copyright © 2007-2008. All Rights Reserved.