|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.view.View
com.viewpagerindicator.TitlePageIndicator
public class TitlePageIndicator
A TitlePageIndicator is a PageIndicator which displays the title of left view (if exist), the title of the current select view (centered) and the title of the right view (if exist). When the user scrolls the ViewPager then titles are also scrolled.
| Nested Class Summary | |
|---|---|
static class |
TitlePageIndicator.IndicatorStyle
|
static class |
TitlePageIndicator.LinePosition
|
static interface |
TitlePageIndicator.OnCenterItemClickListener
Interface for a callback when the center item has been clicked. |
| 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 | |
|---|---|
TitlePageIndicator(android.content.Context context)
|
|
TitlePageIndicator(android.content.Context context,
android.util.AttributeSet attrs)
|
|
TitlePageIndicator(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
|
|
| Method Summary | |
|---|---|
float |
getClipPadding()
|
int |
getFooterColor()
|
float |
getFooterIndicatorHeight()
|
float |
getFooterIndicatorPadding()
|
TitlePageIndicator.IndicatorStyle |
getFooterIndicatorStyle()
|
float |
getFooterLineHeight()
|
TitlePageIndicator.LinePosition |
getLinePosition()
|
int |
getSelectedColor()
|
int |
getTextColor()
|
float |
getTextSize()
|
float |
getTitlePadding()
|
float |
getTopPadding()
|
android.graphics.Typeface |
getTypeface()
|
boolean |
isSelectedBold()
|
void |
notifyDataSetChanged()
Notify the indicator that the fragment list has changed. |
protected void |
onDraw(android.graphics.Canvas canvas)
|
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
|
void |
onPageScrolled(int position,
float positionOffset,
int positionOffsetPixels)
|
void |
onPageScrollStateChanged(int state)
|
void |
onPageSelected(int position)
|
void |
onRestoreInstanceState(android.os.Parcelable state)
|
android.os.Parcelable |
onSaveInstanceState()
|
boolean |
onTouchEvent(android.view.MotionEvent ev)
|
void |
setClipPadding(float clipPadding)
|
void |
setCurrentItem(int item)
Set the current page of both the ViewPager and indicator. |
void |
setFooterColor(int footerColor)
|
void |
setFooterIndicatorHeight(float footerTriangleHeight)
|
void |
setFooterIndicatorPadding(float footerIndicatorPadding)
|
void |
setFooterIndicatorStyle(TitlePageIndicator.IndicatorStyle indicatorStyle)
|
void |
setFooterLineHeight(float footerLineHeight)
|
void |
setLinePosition(TitlePageIndicator.LinePosition linePosition)
|
void |
setOnCenterItemClickListener(TitlePageIndicator.OnCenterItemClickListener listener)
Set a callback listener for the center item click. |
void |
setOnPageChangeListener(android.support.v4.view.ViewPager.OnPageChangeListener listener)
Set a page change listener which will receive forwarded events. |
void |
setSelectedBold(boolean selectedBold)
|
void |
setSelectedColor(int selectedColor)
|
void |
setTextColor(int textColor)
|
void |
setTextSize(float textSize)
|
void |
setTitlePadding(float titlePadding)
|
void |
setTopPadding(float topPadding)
|
void |
setTypeface(android.graphics.Typeface typeface)
|
void |
setViewPager(android.support.v4.view.ViewPager view)
Bind the indicator to a ViewPager. |
void |
setViewPager(android.support.v4.view.ViewPager view,
int initialPosition)
Bind the indicator to a ViewPager. |
| 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, drawableStateChanged, 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, invalidateDrawable, 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, jumpDrawablesToCurrentState, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onAttachedToWindow, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateDrawableState, onCreateInputConnection, onDetachedFromWindow, onDisplayHint, onDragEvent, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onLayout, onOverScrolled, onPopulateAccessibilityEvent, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTrackballEvent, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, 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, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, startActionMode, startAnimation, startDrag, unscheduleDrawable, unscheduleDrawable, verifyDrawable, willNotCacheDrawing, willNotDraw |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TitlePageIndicator(android.content.Context context)
public TitlePageIndicator(android.content.Context context,
android.util.AttributeSet attrs)
public TitlePageIndicator(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
| Method Detail |
|---|
public int getFooterColor()
public void setFooterColor(int footerColor)
public float getFooterLineHeight()
public void setFooterLineHeight(float footerLineHeight)
public float getFooterIndicatorHeight()
public void setFooterIndicatorHeight(float footerTriangleHeight)
public float getFooterIndicatorPadding()
public void setFooterIndicatorPadding(float footerIndicatorPadding)
public TitlePageIndicator.IndicatorStyle getFooterIndicatorStyle()
public void setFooterIndicatorStyle(TitlePageIndicator.IndicatorStyle indicatorStyle)
public TitlePageIndicator.LinePosition getLinePosition()
public void setLinePosition(TitlePageIndicator.LinePosition linePosition)
public int getSelectedColor()
public void setSelectedColor(int selectedColor)
public boolean isSelectedBold()
public void setSelectedBold(boolean selectedBold)
public int getTextColor()
public void setTextColor(int textColor)
public float getTextSize()
public void setTextSize(float textSize)
public float getTitlePadding()
public void setTitlePadding(float titlePadding)
public float getTopPadding()
public void setTopPadding(float topPadding)
public float getClipPadding()
public void setClipPadding(float clipPadding)
public void setTypeface(android.graphics.Typeface typeface)
public android.graphics.Typeface getTypeface()
protected void onDraw(android.graphics.Canvas canvas)
onDraw in class android.view.Viewpublic boolean onTouchEvent(android.view.MotionEvent ev)
onTouchEvent in class android.view.Viewpublic void setViewPager(android.support.v4.view.ViewPager view)
PageIndicator
setViewPager in interface PageIndicator
public void setViewPager(android.support.v4.view.ViewPager view,
int initialPosition)
PageIndicator
setViewPager in interface PageIndicatorpublic void notifyDataSetChanged()
PageIndicator
notifyDataSetChanged in interface PageIndicatorpublic void setOnCenterItemClickListener(TitlePageIndicator.OnCenterItemClickListener listener)
listener - Callback instance.public void setCurrentItem(int item)
PageIndicatorSet the current page of both the ViewPager and indicator.
This must be used if you need to set the page before the views are drawn on screen (e.g., default start page).
setCurrentItem in interface PageIndicatorpublic void onPageScrollStateChanged(int state)
onPageScrollStateChanged in interface android.support.v4.view.ViewPager.OnPageChangeListener
public void onPageScrolled(int position,
float positionOffset,
int positionOffsetPixels)
onPageScrolled in interface android.support.v4.view.ViewPager.OnPageChangeListenerpublic void onPageSelected(int position)
onPageSelected in interface android.support.v4.view.ViewPager.OnPageChangeListenerpublic void setOnPageChangeListener(android.support.v4.view.ViewPager.OnPageChangeListener listener)
PageIndicator
setOnPageChangeListener in interface PageIndicator
protected void onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
onMeasure in class android.view.Viewpublic void onRestoreInstanceState(android.os.Parcelable state)
onRestoreInstanceState in class android.view.Viewpublic android.os.Parcelable onSaveInstanceState()
onSaveInstanceState in class android.view.View
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||