AndBase开发框架  1.6
 全部  命名空间 文件 函数 变量 枚举值 
| Public 成员函数 | Protected 成员函数 | Protected 属性 | 包函数 | Private 成员函数 | Private 属性 | 静态 Private 属性 | 所有成员列表
com.ab.view.slidingmenu.CustomViewAbove类 参考
类 com.ab.view.slidingmenu.CustomViewAbove 继承关系图:

interface  OnPageChangeListener
 
class  SimpleOnPageChangeListener
 

Public 成员函数

 CustomViewAbove (Context context)
 
 CustomViewAbove (Context context, AttributeSet attrs)
 
void setCurrentItem (int item)
 
void setCurrentItem (int item, boolean smoothScroll)
 
int getCurrentItem ()
 
void setOnPageChangeListener (OnPageChangeListener listener)
 
void setOnOpenedListener (OnOpenedListener l)
 
void setOnClosedListener (OnClosedListener l)
 
void addIgnoredView (View v)
 
void removeIgnoredView (View v)
 
void clearIgnoredViews ()
 
int getDestScrollX (int page)
 
int getContentLeft ()
 
boolean isMenuOpen ()
 
int getBehindWidth ()
 
int getChildWidth (int i)
 
boolean isSlidingEnabled ()
 
void setSlidingEnabled (boolean b)
 
void setContent (View v)
 
View getContent ()
 
void setCustomViewBehind (CustomViewBehind cvb)
 
void setAboveOffset (int i)
 
void computeScroll ()
 
void setTouchMode (int i)
 
int getTouchMode ()
 
boolean onInterceptTouchEvent (MotionEvent ev)
 
boolean onTouchEvent (MotionEvent ev)
 
void scrollTo (int x, int y)
 
boolean dispatchKeyEvent (KeyEvent event)
 
boolean executeKeyEvent (KeyEvent event)
 
boolean arrowScroll (int direction)
 

Protected 成员函数

void onMeasure (int widthMeasureSpec, int heightMeasureSpec)
 
void onSizeChanged (int w, int h, int oldw, int oldh)
 
void onLayout (boolean changed, int l, int t, int r, int b)
 
void onPageScrolled (int position, float offset, int offsetPixels)
 
float getPercentOpen ()
 
void dispatchDraw (Canvas canvas)
 
boolean canScroll (View v, boolean checkV, int dx, int x, int y)
 

Protected 属性

int mActivePointerId = INVALID_POINTER
 
VelocityTracker mVelocityTracker
 
int mMaximumVelocity
 
int mTouchMode = SlidingMenu.TOUCHMODE_MARGIN
 

包函数

void initCustomViewAbove ()
 
void setCurrentItemInternal (int item, boolean smoothScroll, boolean always)
 
void setCurrentItemInternal (int item, boolean smoothScroll, boolean always, int velocity)
 
OnPageChangeListener setInternalPageChangeListener (OnPageChangeListener listener)
 
float distanceInfluenceForSnapDuration (float f)
 
void smoothScrollTo (int x, int y)
 
void smoothScrollTo (int x, int y, int velocity)
 
boolean pageLeft ()
 
boolean pageRight ()
 

Private 成员函数

int getLeftBound ()
 
int getRightBound ()
 
boolean isInIgnoredView (MotionEvent ev)
 
void pageScrolled (int xpos)
 
void completeScroll ()
 
boolean thisTouchAllowed (MotionEvent ev)
 
boolean thisSlideAllowed (float dx)
 
int getPointerIndex (MotionEvent ev, int id)
 
void determineDrag (MotionEvent ev)
 
int determineTargetPage (float pageOffset, int velocity, int deltaX)
 
void onSecondaryPointerUp (MotionEvent ev)
 
void startDrag ()
 
void endDrag ()
 
void setScrollingCacheEnabled (boolean enabled)
 

Private 属性

View mContent
 
int mCurItem
 
Scroller mScroller
 
boolean mScrollingCacheEnabled
 
boolean mScrolling
 
boolean mIsBeingDragged
 
boolean mIsUnableToDrag
 
int mTouchSlop
 
float mInitialMotionX
 
float mLastMotionX
 
float mLastMotionY
 
int mMinimumVelocity
 
int mFlingDistance
 
CustomViewBehind mViewBehind
 
boolean mEnabled = true
 
OnPageChangeListener mOnPageChangeListener
 
OnPageChangeListener mInternalPageChangeListener
 
OnClosedListener mClosedListener
 
OnOpenedListener mOpenedListener
 
List< View > mIgnoredViews = new ArrayList<View>()
 
boolean mQuickReturn = false
 
float mScrollX = 0.0f
 

静态 Private 属性

static final String TAG = "CustomViewAbove"
 
static final boolean DEBUG = false
 
static final boolean USE_CACHE = false
 
static final int MAX_SETTLE_DURATION = 600
 
static final int MIN_DISTANCE_FOR_FLING = 25
 
static final Interpolator sInterpolator
 
static final int INVALID_POINTER = -1
 

详细描述

The Class CustomViewAbove.

构造及析构函数说明

com.ab.view.slidingmenu.CustomViewAbove.CustomViewAbove ( Context  context)
inline

Instantiates a new custom view above.

参数
contextthe context
com.ab.view.slidingmenu.CustomViewAbove.CustomViewAbove ( Context  context,
AttributeSet  attrs 
)
inline

Instantiates a new custom view above.

参数
contextthe context
attrsthe attrs

成员函数说明

void com.ab.view.slidingmenu.CustomViewAbove.addIgnoredView ( View  v)
inline

Adds the ignored view.

参数
vthe v
boolean com.ab.view.slidingmenu.CustomViewAbove.arrowScroll ( int  direction)
inline

Arrow scroll.

参数
directionthe direction
返回
true, if successful
boolean com.ab.view.slidingmenu.CustomViewAbove.canScroll ( View  v,
boolean  checkV,
int  dx,
int  x,
int  y 
)
inlineprotected

Tests scrollability within child views of v given a delta of dx.

参数
vView to test for horizontal scrollability
checkVWhether the view v passed should itself be checked for scrollability (true), or just its children (false).
dxDelta scrolled in pixels
xX coordinate of the active touch point
yY coordinate of the active touch point
返回
true if child views of v can be scrolled by delta of dx.
void com.ab.view.slidingmenu.CustomViewAbove.clearIgnoredViews ( )
inline

Clear ignored views.

void com.ab.view.slidingmenu.CustomViewAbove.completeScroll ( )
inlineprivate

Complete scroll.

void com.ab.view.slidingmenu.CustomViewAbove.computeScroll ( )
inline
void com.ab.view.slidingmenu.CustomViewAbove.determineDrag ( MotionEvent  ev)
inlineprivate

Determine drag.

参数
evthe ev
int com.ab.view.slidingmenu.CustomViewAbove.determineTargetPage ( float  pageOffset,
int  velocity,
int  deltaX 
)
inlineprivate

Determine target page.

参数
pageOffsetthe page offset
velocitythe velocity
deltaXthe delta x
返回
the int
void com.ab.view.slidingmenu.CustomViewAbove.dispatchDraw ( Canvas  canvas)
inlineprotected
boolean com.ab.view.slidingmenu.CustomViewAbove.dispatchKeyEvent ( KeyEvent  event)
inline
float com.ab.view.slidingmenu.CustomViewAbove.distanceInfluenceForSnapDuration ( float  f)
inlinepackage

Distance influence for snap duration.

参数
fthe f
返回
the float
void com.ab.view.slidingmenu.CustomViewAbove.endDrag ( )
inlineprivate

End drag.

boolean com.ab.view.slidingmenu.CustomViewAbove.executeKeyEvent ( KeyEvent  event)
inline

You can call this function yourself to have the scroll view perform scrolling from a key event, just as if the event had been dispatched to it by the view hierarchy.

参数
eventThe key event to execute.
返回
Return true if the event was handled, else false.
int com.ab.view.slidingmenu.CustomViewAbove.getBehindWidth ( )
inline

Gets the behind width.

返回
the behind width
int com.ab.view.slidingmenu.CustomViewAbove.getChildWidth ( int  i)
inline

Gets the child width.

参数
ithe i
返回
the child width
View com.ab.view.slidingmenu.CustomViewAbove.getContent ( )
inline

Gets the content.

返回
the content
int com.ab.view.slidingmenu.CustomViewAbove.getContentLeft ( )
inline

Gets the content left.

返回
the content left
int com.ab.view.slidingmenu.CustomViewAbove.getCurrentItem ( )
inline

Gets the current item.

返回
the current item
int com.ab.view.slidingmenu.CustomViewAbove.getDestScrollX ( int  page)
inline

Gets the dest scroll x.

参数
pagethe page
返回
the dest scroll x
int com.ab.view.slidingmenu.CustomViewAbove.getLeftBound ( )
inlineprivate

Gets the left bound.

返回
the left bound
float com.ab.view.slidingmenu.CustomViewAbove.getPercentOpen ( )
inlineprotected

Gets the percent open.

返回
the percent open
int com.ab.view.slidingmenu.CustomViewAbove.getPointerIndex ( MotionEvent  ev,
int  id 
)
inlineprivate

Gets the pointer index.

参数
evthe ev
idthe id
返回
the pointer index
int com.ab.view.slidingmenu.CustomViewAbove.getRightBound ( )
inlineprivate

Gets the right bound.

返回
the right bound
int com.ab.view.slidingmenu.CustomViewAbove.getTouchMode ( )
inline

Gets the touch mode.

返回
the touch mode
void com.ab.view.slidingmenu.CustomViewAbove.initCustomViewAbove ( )
inlinepackage

Inits the custom view above.

boolean com.ab.view.slidingmenu.CustomViewAbove.isInIgnoredView ( MotionEvent  ev)
inlineprivate

Checks if is in ignored view.

参数
evthe ev
返回
true, if is in ignored view
boolean com.ab.view.slidingmenu.CustomViewAbove.isMenuOpen ( )
inline

Checks if is menu open.

返回
true, if is menu open
boolean com.ab.view.slidingmenu.CustomViewAbove.isSlidingEnabled ( )
inline

Checks if is sliding enabled.

返回
true, if is sliding enabled
boolean com.ab.view.slidingmenu.CustomViewAbove.onInterceptTouchEvent ( MotionEvent  ev)
inline
void com.ab.view.slidingmenu.CustomViewAbove.onLayout ( boolean  changed,
int  l,
int  t,
int  r,
int  b 
)
inlineprotected
void com.ab.view.slidingmenu.CustomViewAbove.onMeasure ( int  widthMeasureSpec,
int  heightMeasureSpec 
)
inlineprotected
void com.ab.view.slidingmenu.CustomViewAbove.onPageScrolled ( int  position,
float  offset,
int  offsetPixels 
)
inlineprotected

This method will be invoked when the current page is scrolled, either as part of a programmatically initiated smooth scroll or a user initiated touch scroll. If you override this method you must call through to the superclass implementation (e.g. super.onPageScrolled(position, offset, offsetPixels)) before onPageScrolled returns.

参数
positionPosition index of the first page currently being displayed. Page position+1 will be visible if positionOffset is nonzero.
offsetValue from [0, 1) indicating the offset from the page at position.
offsetPixelsValue in pixels indicating the offset from position.
void com.ab.view.slidingmenu.CustomViewAbove.onSecondaryPointerUp ( MotionEvent  ev)
inlineprivate

On secondary pointer up.

参数
evthe ev
void com.ab.view.slidingmenu.CustomViewAbove.onSizeChanged ( int  w,
int  h,
int  oldw,
int  oldh 
)
inlineprotected
boolean com.ab.view.slidingmenu.CustomViewAbove.onTouchEvent ( MotionEvent  ev)
inline
boolean com.ab.view.slidingmenu.CustomViewAbove.pageLeft ( )
inlinepackage

Page left.

返回
true, if successful
boolean com.ab.view.slidingmenu.CustomViewAbove.pageRight ( )
inlinepackage

Page right.

返回
true, if successful
void com.ab.view.slidingmenu.CustomViewAbove.pageScrolled ( int  xpos)
inlineprivate

Page scrolled.

参数
xposthe xpos
void com.ab.view.slidingmenu.CustomViewAbove.removeIgnoredView ( View  v)
inline

Removes the ignored view.

参数
vthe v
void com.ab.view.slidingmenu.CustomViewAbove.scrollTo ( int  x,
int  y 
)
inline
void com.ab.view.slidingmenu.CustomViewAbove.setAboveOffset ( int  i)
inline

Sets the above offset.

参数
ithe new above offset
void com.ab.view.slidingmenu.CustomViewAbove.setContent ( View  v)
inline

Sets the content.

参数
vthe new content
void com.ab.view.slidingmenu.CustomViewAbove.setCurrentItem ( int  item)
inline

Set the currently selected page. If the CustomViewPager has already been through its first layout there will be a smooth animated transition between the current item and the specified item.

参数
itemItem index to select
void com.ab.view.slidingmenu.CustomViewAbove.setCurrentItem ( int  item,
boolean  smoothScroll 
)
inline

Set the currently selected page.

参数
itemItem index to select
smoothScrollTrue to smoothly scroll to the new item, false to transition immediately
void com.ab.view.slidingmenu.CustomViewAbove.setCurrentItemInternal ( int  item,
boolean  smoothScroll,
boolean  always 
)
inlinepackage

Sets the current item internal.

参数
itemthe item
smoothScrollthe smooth scroll
alwaysthe always
void com.ab.view.slidingmenu.CustomViewAbove.setCurrentItemInternal ( int  item,
boolean  smoothScroll,
boolean  always,
int  velocity 
)
inlinepackage

Sets the current item internal.

参数
itemthe item
smoothScrollthe smooth scroll
alwaysthe always
velocitythe velocity
void com.ab.view.slidingmenu.CustomViewAbove.setCustomViewBehind ( CustomViewBehind  cvb)
inline

Sets the custom view behind.

参数
cvbthe new custom view behind
OnPageChangeListener com.ab.view.slidingmenu.CustomViewAbove.setInternalPageChangeListener ( OnPageChangeListener  listener)
inlinepackage

Set a separate OnPageChangeListener for internal use by the support library.

参数
listenerListener to set
返回
The old listener that was set, if any.
void com.ab.view.slidingmenu.CustomViewAbove.setOnClosedListener ( OnClosedListener  l)
inline

Sets the on closed listener.

参数
lthe new on closed listener
void com.ab.view.slidingmenu.CustomViewAbove.setOnOpenedListener ( OnOpenedListener  l)
inline

Sets the on opened listener.

参数
lthe new on opened listener
void com.ab.view.slidingmenu.CustomViewAbove.setOnPageChangeListener ( OnPageChangeListener  listener)
inline

Set a listener that will be invoked whenever the page changes or is incrementally scrolled. See OnPageChangeListener.

参数
listenerListener to set
void com.ab.view.slidingmenu.CustomViewAbove.setScrollingCacheEnabled ( boolean  enabled)
inlineprivate

Sets the scrolling cache enabled.

参数
enabledthe new scrolling cache enabled
void com.ab.view.slidingmenu.CustomViewAbove.setSlidingEnabled ( boolean  b)
inline

Sets the sliding enabled.

参数
bthe new sliding enabled
void com.ab.view.slidingmenu.CustomViewAbove.setTouchMode ( int  i)
inline

Sets the touch mode.

参数
ithe new touch mode
void com.ab.view.slidingmenu.CustomViewAbove.smoothScrollTo ( int  x,
int  y 
)
inlinepackage

Like View#scrollBy, but scroll smoothly instead of immediately.

参数
xthe number of pixels to scroll by on the X axis
ythe number of pixels to scroll by on the Y axis
void com.ab.view.slidingmenu.CustomViewAbove.smoothScrollTo ( int  x,
int  y,
int  velocity 
)
inlinepackage

Like View#scrollBy, but scroll smoothly instead of immediately.

参数
xthe number of pixels to scroll by on the X axis
ythe number of pixels to scroll by on the Y axis
velocitythe velocity associated with a fling, if applicable. (0 otherwise)
void com.ab.view.slidingmenu.CustomViewAbove.startDrag ( )
inlineprivate

Start drag.

boolean com.ab.view.slidingmenu.CustomViewAbove.thisSlideAllowed ( float  dx)
inlineprivate

This slide allowed.

参数
dxthe dx
返回
true, if successful
boolean com.ab.view.slidingmenu.CustomViewAbove.thisTouchAllowed ( MotionEvent  ev)
inlineprivate

This touch allowed.

参数
evthe ev
返回
true, if successful

类成员变量说明

final boolean com.ab.view.slidingmenu.CustomViewAbove.DEBUG = false
staticprivate

The Constant DEBUG.

final int com.ab.view.slidingmenu.CustomViewAbove.INVALID_POINTER = -1
staticprivate

Sentinel value for no current active pointer. Used by mActivePointerId.

int com.ab.view.slidingmenu.CustomViewAbove.mActivePointerId = INVALID_POINTER
protected

ID of the active pointer. This is used to retain consistency during drags/flings if multiple pointers are used.

final int com.ab.view.slidingmenu.CustomViewAbove.MAX_SETTLE_DURATION = 600
staticprivate

The Constant MAX_SETTLE_DURATION.

OnClosedListener com.ab.view.slidingmenu.CustomViewAbove.mClosedListener
private

The m closed listener.

View com.ab.view.slidingmenu.CustomViewAbove.mContent
private

The m content.

int com.ab.view.slidingmenu.CustomViewAbove.mCurItem
private

The m cur item.

boolean com.ab.view.slidingmenu.CustomViewAbove.mEnabled = true
private

The m enabled.

int com.ab.view.slidingmenu.CustomViewAbove.mFlingDistance
private

The m fling distance.

List<View> com.ab.view.slidingmenu.CustomViewAbove.mIgnoredViews = new ArrayList<View>()
private

The m ignored views.

final int com.ab.view.slidingmenu.CustomViewAbove.MIN_DISTANCE_FOR_FLING = 25
staticprivate

The Constant MIN_DISTANCE_FOR_FLING.

float com.ab.view.slidingmenu.CustomViewAbove.mInitialMotionX
private

The m initial motion x.

OnPageChangeListener com.ab.view.slidingmenu.CustomViewAbove.mInternalPageChangeListener
private

The m internal page change listener.

boolean com.ab.view.slidingmenu.CustomViewAbove.mIsBeingDragged
private

The m is being dragged.

boolean com.ab.view.slidingmenu.CustomViewAbove.mIsUnableToDrag
private

The m is unable to drag.

float com.ab.view.slidingmenu.CustomViewAbove.mLastMotionX
private

Position of the last motion event.

float com.ab.view.slidingmenu.CustomViewAbove.mLastMotionY
private

The m last motion y.

int com.ab.view.slidingmenu.CustomViewAbove.mMaximumVelocity
protected

The m maximum velocity.

int com.ab.view.slidingmenu.CustomViewAbove.mMinimumVelocity
private

The m minimum velocity.

OnPageChangeListener com.ab.view.slidingmenu.CustomViewAbove.mOnPageChangeListener
private

The m on page change listener.

OnOpenedListener com.ab.view.slidingmenu.CustomViewAbove.mOpenedListener
private

The m opened listener.

boolean com.ab.view.slidingmenu.CustomViewAbove.mQuickReturn = false
private

The m quick return.

Scroller com.ab.view.slidingmenu.CustomViewAbove.mScroller
private

The m scroller.

boolean com.ab.view.slidingmenu.CustomViewAbove.mScrolling
private

The m scrolling.

boolean com.ab.view.slidingmenu.CustomViewAbove.mScrollingCacheEnabled
private

The m scrolling cache enabled.

float com.ab.view.slidingmenu.CustomViewAbove.mScrollX = 0.0f
private

The m scroll x.

int com.ab.view.slidingmenu.CustomViewAbove.mTouchMode = SlidingMenu.TOUCHMODE_MARGIN
protected

The m touch mode.

int com.ab.view.slidingmenu.CustomViewAbove.mTouchSlop
private

The m touch slop.

VelocityTracker com.ab.view.slidingmenu.CustomViewAbove.mVelocityTracker
protected

Determines speed during touch scrolling.

CustomViewBehind com.ab.view.slidingmenu.CustomViewAbove.mViewBehind
private

The m view behind.

final Interpolator com.ab.view.slidingmenu.CustomViewAbove.sInterpolator
staticprivate
初始值:
= new Interpolator() {
public float getInterpolation(float t) {
t -= 1.0f;
return t * t * t * t * t + 1.0f;
}
}

The Constant sInterpolator.

final String com.ab.view.slidingmenu.CustomViewAbove.TAG = "CustomViewAbove"
staticprivate

The Constant TAG.

final boolean com.ab.view.slidingmenu.CustomViewAbove.USE_CACHE = false
staticprivate

The Constant USE_CACHE.


该类的文档由以下文件生成: