|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.view.View
android.view.ViewGroup
android.widget.FrameLayout
android.widget.HorizontalScrollView
uk.co.jasonfry.android.tools.ui.SwipeView
public class SwipeView
Nested Class Summary | |
---|---|
static interface |
SwipeView.OnPageChangedListener
Implement this listener to listen for page change events |
Nested classes/interfaces inherited from class android.widget.FrameLayout |
---|
FrameLayout.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.view.ViewGroup |
---|
FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE |
Constructor Summary | |
---|---|
SwipeView(Context context)
|
|
SwipeView(Context context,
AttributeSet attrs)
|
|
SwipeView(Context context,
AttributeSet attrs,
int defStyle)
|
Method Summary | |
---|---|
void |
addView(View child)
|
void |
addView(View child,
int index)
|
void |
addView(View child,
int index,
ViewGroup.LayoutParams params)
|
void |
addView(View child,
ViewGroup.LayoutParams params)
|
int |
calculatePageSize(ViewGroup.MarginLayoutParams childLayoutParams)
Set the width of each page by using the layout parameters of a child. |
LinearLayout |
getChildContainer()
Get the View object that contains all the children of this SwipeView. |
int |
getCurrentPage()
Get the current page the SwipeView is on |
SwipeView.OnPageChangedListener |
getOnPageChangedListener()
Get the current OnPageChangeListsner |
PageControl |
getPageControl()
Return the current PageControl object |
int |
getPageCount()
Return the number of pages in this SwipeView |
int |
getPageWidth()
Return the current width of each page |
int |
getSwipeThreshold()
Get the swiping threshold distance to make the screens change |
boolean |
onInterceptTouchEvent(MotionEvent ev)
|
boolean |
onTrackballEvent(MotionEvent event)
|
void |
scrollToPage(int page)
Go directly to the specified page |
void |
setOnPageChangedListener(SwipeView.OnPageChangedListener onPageChangedListener)
Set the current OnPageChangedListsner |
void |
setOnTouchListener(View.OnTouchListener onTouchListener)
|
void |
setPageControl(PageControl pageControl)
Assign a PageControl object to this SwipeView. |
int |
setPageWidth(int pageWidth)
Set the width of each page. |
void |
setSwipeThreshold(int swipeThreshold)
Set the swiping threshold distance to make the screens change |
void |
smoothScrollToPage(int page)
Animate a scroll to the specified page |
Methods inherited from class android.widget.HorizontalScrollView |
---|
arrowScroll, computeScroll, dispatchKeyEvent, executeKeyEvent, fling, fullScroll, getMaxScrollAmount, isFillViewport, isSmoothScrollingEnabled, onTouchEvent, pageScroll, requestChildFocus, requestChildRectangleOnScreen, requestLayout, scrollTo, setFillViewport, setSmoothScrollingEnabled, smoothScrollBy, smoothScrollTo |
Methods inherited from class android.widget.FrameLayout |
---|
draw, gatherTransparentRegion, generateLayoutParams, getConsiderGoneChildrenWhenMeasuring, getForeground, setForeground, setForegroundGravity, setMeasureAllChildren |
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 |
Constructor Detail |
---|
public SwipeView(Context context)
public SwipeView(Context context, AttributeSet attrs)
public SwipeView(Context context, AttributeSet attrs, int defStyle)
Method Detail |
---|
public boolean onTrackballEvent(MotionEvent event)
onTrackballEvent
in class View
public void addView(View child)
addView
in class HorizontalScrollView
public void addView(View child, int index)
addView
in class HorizontalScrollView
public void addView(View child, ViewGroup.LayoutParams params)
addView
in interface ViewManager
addView
in class HorizontalScrollView
public void addView(View child, int index, ViewGroup.LayoutParams params)
addView
in class HorizontalScrollView
public void setOnTouchListener(View.OnTouchListener onTouchListener)
setOnTouchListener
in class View
public LinearLayout getChildContainer()
public int getSwipeThreshold()
public void setSwipeThreshold(int swipeThreshold)
swipeThreshold
- The minimum distance the finger should move to allow the screens to changepublic int getCurrentPage()
public int getPageCount()
public void scrollToPage(int page)
page
- The page to scroll topublic void smoothScrollToPage(int page)
page
- The page to animate topublic int setPageWidth(int pageWidth)
pageWidth
- The width you wish to assign for each page
public int calculatePageSize(ViewGroup.MarginLayoutParams childLayoutParams)
childLayoutParams
- A child view that you have added / will add to the SwipeView
public int getPageWidth()
public void setPageControl(PageControl pageControl)
pageControl
- The PageControl object to assignpublic PageControl getPageControl()
public void setOnPageChangedListener(SwipeView.OnPageChangedListener onPageChangedListener)
onPageChangedListener
- The OnPageChangedListener objectpublic SwipeView.OnPageChangedListener getOnPageChangedListener()
public boolean onInterceptTouchEvent(MotionEvent ev)
onInterceptTouchEvent
in class HorizontalScrollView
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |