uk.co.jasonfry.android.tools.ui
Class PageControl

java.lang.Object
  extended by android.view.View
      extended by android.view.ViewGroup
          extended by android.widget.LinearLayout
              extended by uk.co.jasonfry.android.tools.ui.PageControl
All Implemented Interfaces:
Drawable.Callback, AccessibilityEventSource, KeyEvent.Callback, ViewManager, ViewParent

public class PageControl
extends LinearLayout


Nested Class Summary
static interface PageControl.OnPageControlClickListener
           
 
Nested classes/interfaces inherited from class android.widget.LinearLayout
LinearLayout.LayoutParams
 
Nested classes/interfaces inherited from class android.view.ViewGroup
ViewGroup.MarginLayoutParams, ViewGroup.OnHierarchyChangeListener
 
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.widget.LinearLayout
HORIZONTAL, VERTICAL
 
Fields inherited from class android.view.ViewGroup
FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
 
Fields inherited from class android.view.View
DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, GONE, HAPTIC_FEEDBACK_ENABLED, INVISIBLE, KEEP_SCREEN_ON, NO_ID, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SOUND_EFFECTS_ENABLED, VISIBLE
 
Constructor Summary
PageControl(Context context)
           
PageControl(Context context, AttributeSet attrs)
           
 
Method Summary
 Drawable getActiveDrawable()
          Return the current drawable object for an active page indicator
 int getCurrentPage()
          Return the current page the PageControl is on
 Drawable getInactiveDrawable()
          Return the current drawable object for an inactive page indicator
 int getIndicatorSize()
          Return the size of the page indicator drawables
 PageControl.OnPageControlClickListener getOnPageControlClickListener()
          Return the OnPageControlClickListener that has been set on this PageControl
 int getPageCount()
          Return the number of pages this PageControl has
 void setActiveDrawable(Drawable d)
          Set the drawable object for an active page indicator
 void setCurrentPage(int currentPage)
          Set the current page the PageControl should be on
 void setInactiveDrawable(Drawable d)
          Set the drawable object for an inactive page indicator
 void setIndicatorSize(int indicatorSize)
          Set the size of the page indicator drawables
 void setOnPageControlClickListener(PageControl.OnPageControlClickListener onPageControlClickListener)
          Set the OnPageControlClickListener object for this PageControl
 void setPageCount(int pageCount)
          Set the number of pages this PageControl should have
 
Methods inherited from class android.widget.LinearLayout
generateLayoutParams, getBaseline, getBaselineAlignedChildIndex, getOrientation, getWeightSum, isBaselineAligned, setBaselineAligned, setBaselineAlignedChildIndex, setGravity, setHorizontalGravity, setOrientation, setVerticalGravity, setWeightSum
 
Methods inherited from class android.view.ViewGroup
addFocusables, addFocusables, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, bringChildToFront, childDrawableStateChanged, clearChildFocus, clearDisappearingChildren, clearFocus, dispatchConfigurationChanged, dispatchDisplayHint, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchSetSelected, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, findFocus, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildMeasureSpec, getChildVisibleRect, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getPersistentDrawingCache, hasFocus, hasFocusable, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onInterceptTouchEvent, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestTransparentRegion, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setOnHierarchyChangeListener, setPadding, setPersistentDrawingCache, showContextMenuForChild, startLayoutAnimation, updateViewLayout
 
Methods inherited from class android.view.View
bringToFront, buildDrawingCache, buildDrawingCache, cancelLongPress, checkInputConnectionProxy, clearAnimation, computeScroll, createContextMenu, destroyDrawingCache, draw, findViewById, findViewWithTag, focusSearch, forceLayout, getAnimation, getApplicationWindowToken, getBackground, getBottom, getContentDescription, getContext, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getId, getKeepScreenOn, getKeyDispatcherState, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMeasuredHeight, getMeasuredWidth, getNextFocusDownId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getResources, getRight, getRootView, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getTag, getTag, getTop, getTouchables, getTouchDelegate, getVerticalFadingEdgeLength, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, isClickable, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isOpaque, isPressed, isSaveEnabled, isScrollbarFadingEnabled, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, layout, measure, offsetLeftAndRight, offsetTopAndBottom, onCheckIsTextEditor, onCreateInputConnection, onFinishTemporaryDetach, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onWindowFocusChanged, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, refreshDrawableState, removeCallbacks, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAnimation, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setClickable, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setId, setKeepScreenOn, setLayoutParams, setLongClickable, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnCreateContextMenuListener, setOnFocusChangeListener, setOnKeyListener, setOnLongClickListener, setOnTouchListener, setPressed, setSaveEnabled, setScrollbarFadingEnabled, setScrollBarStyle, setScrollContainer, setSelected, setSoundEffectsEnabled, setTag, setTag, setTouchDelegate, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVisibility, setWillNotCacheDrawing, setWillNotDraw, showContextMenu, startAnimation, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDraw
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface android.view.ViewParent
createContextMenu, getParent, isLayoutRequested, requestLayout
 

Constructor Detail

PageControl

public PageControl(Context context)

PageControl

public PageControl(Context context,
                   AttributeSet attrs)
Method Detail

setActiveDrawable

public void setActiveDrawable(Drawable d)
Set the drawable object for an active page indicator

Parameters:
d - The drawable object for an active page indicator

getActiveDrawable

public Drawable getActiveDrawable()
Return the current drawable object for an active page indicator

Returns:
Returns the current drawable object for an active page indicator

setInactiveDrawable

public void setInactiveDrawable(Drawable d)
Set the drawable object for an inactive page indicator

Parameters:
d - The drawable object for an inactive page indicator

getInactiveDrawable

public Drawable getInactiveDrawable()
Return the current drawable object for an inactive page indicator

Returns:
Returns the current drawable object for an inactive page indicator

setPageCount

public void setPageCount(int pageCount)
Set the number of pages this PageControl should have

Parameters:
pageCount - The number of pages this PageControl should have

getPageCount

public int getPageCount()
Return the number of pages this PageControl has

Returns:
Returns the number of pages this PageControl has

setCurrentPage

public void setCurrentPage(int currentPage)
Set the current page the PageControl should be on

Parameters:
currentPage - The current page the PageControl should be on

getCurrentPage

public int getCurrentPage()
Return the current page the PageControl is on

Returns:
Returns the current page the PageControl is on

setIndicatorSize

public void setIndicatorSize(int indicatorSize)
Set the size of the page indicator drawables

Parameters:
indicatorSize - The size of the page indicator drawables

getIndicatorSize

public int getIndicatorSize()
Return the size of the page indicator drawables

Returns:
Returns the size of the page indicator drawables

setOnPageControlClickListener

public void setOnPageControlClickListener(PageControl.OnPageControlClickListener onPageControlClickListener)
Set the OnPageControlClickListener object for this PageControl

Parameters:
onPageControlClickListener - The OnPageControlClickListener you wish to set

getOnPageControlClickListener

public PageControl.OnPageControlClickListener getOnPageControlClickListener()
Return the OnPageControlClickListener that has been set on this PageControl

Returns:
Returns the OnPageControlClickListener that has been set on this PageControl