|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectandroid.view.View
com.viewpagerindicator.LinePageIndicator
public class LinePageIndicator
Draws a line for each page. The current page line is colored differently than the unselected page lines.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class android.view.View |
|---|
android.view.View.BaseSavedState, android.view.View.MeasureSpec, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnFocusChangeListener, android.view.View.OnKeyListener, android.view.View.OnLongClickListener, android.view.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, 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, 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 | |
|---|---|
LinePageIndicator(android.content.Context context)
|
|
LinePageIndicator(android.content.Context context,
android.util.AttributeSet attrs)
|
|
LinePageIndicator(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
|
|
| Method Summary | |
|---|---|
float |
getGapWidth()
|
float |
getLineWidth()
|
int |
getSelectedColor()
|
float |
getStrokeWidth()
|
int |
getUnselectedColor()
|
boolean |
isCentered()
|
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 |
setCentered(boolean centered)
|
void |
setCurrentItem(int item)
Set the current page of both the ViewPager and indicator. |
void |
setGapWidth(float gapWidth)
|
void |
setLineWidth(float lineWidth)
|
void |
setOnPageChangeListener(android.support.v4.view.ViewPager.OnPageChangeListener listener)
Set a page change listener which will receive forwarded events. |
void |
setSelectedColor(int selectedColor)
|
void |
setStrokeWidth(float lineHeight)
|
void |
setUnselectedColor(int unselectedColor)
|
void |
setViewPager(android.support.v4.view.ViewPager viewPager)
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 |
|---|
addFocusables, addFocusables, addTouchables, bringToFront, buildDrawingCache, buildDrawingCache, cancelLongPress, checkInputConnectionProxy, clearAnimation, clearFocus, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createContextMenu, destroyDrawingCache, dispatchDraw, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetPressed, dispatchSetSelected, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, draw, drawableStateChanged, finalize, findFocus, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceLayout, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getKeepScreenOn, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMeasuredHeight, getMeasuredWidth, getNextFocusDownId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getTag, getTag, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getVerticalFadingEdgeLength, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, hasFocus, hasFocusable, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, invalidateDrawable, isClickable, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isPaddingOffsetRequired, isPressed, isSaveEnabled, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onAttachedToWindow, onCheckIsTextEditor, onCreateContextMenu, onCreateDrawableState, onCreateInputConnection, onDetachedFromWindow, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onKeyDown, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onLayout, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTrackballEvent, onWindowFocusChanged, onWindowVisibilityChanged, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, refreshDrawableState, removeCallbacks, requestFocus, 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, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnCreateContextMenuListener, setOnFocusChangeListener, setOnKeyListener, setOnLongClickListener, setOnTouchListener, setPadding, setPressed, setSaveEnabled, setScrollBarStyle, setScrollContainer, setSelected, setSoundEffectsEnabled, setTag, setTag, setTouchDelegate, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVisibility, setWillNotCacheDrawing, setWillNotDraw, showContextMenu, startAnimation, unscheduleDrawable, unscheduleDrawable, verifyDrawable, willNotCacheDrawing, willNotDraw |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LinePageIndicator(android.content.Context context)
public LinePageIndicator(android.content.Context context,
android.util.AttributeSet attrs)
public LinePageIndicator(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
| Method Detail |
|---|
public void setCentered(boolean centered)
public boolean isCentered()
public void setUnselectedColor(int unselectedColor)
public int getUnselectedColor()
public void setSelectedColor(int selectedColor)
public int getSelectedColor()
public void setLineWidth(float lineWidth)
public float getLineWidth()
public void setStrokeWidth(float lineHeight)
public float getStrokeWidth()
public void setGapWidth(float gapWidth)
public float getGapWidth()
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 viewPager)
PageIndicator
setViewPager in interface PageIndicator
public void setViewPager(android.support.v4.view.ViewPager view,
int initialPosition)
PageIndicator
setViewPager in interface PageIndicatorpublic 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 notifyDataSetChanged()
PageIndicator
notifyDataSetChanged 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 | ||||||||