| 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.

参数

  context | the context

com.ab.view.slidingmenu.CustomViewAbove.CustomViewAbove | ( | Context | context,
|  | AttributeSet | attrs
| ) |  |
| inline

Instantiates a new custom view above.

参数

  context | the context
  attrs | the attrs

## 成员函数说明

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

Adds the ignored view.

参数

  v | the v

boolean com.ab.view.slidingmenu.CustomViewAbove.arrowScroll | ( | int | direction | ) |
| inline

Arrow scroll.

参数

  direction | the direction

返回
  true, if successful

boolean com.ab.view.slidingmenu.CustomViewAbove.canScroll | ( | View | v,
|  | boolean | checkV,
|  | int | dx,
|  | int | x,
|  | int | y
| ) |  |
| inline protected

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

参数

  v | View to test for horizontal scrollability
  checkV | Whether the view v passed should itself be checked for scrollability (true), or just its children (false).
  dx | Delta scrolled in pixels
  x | X coordinate of the active touch point
  y | Y 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 | ( |  | ) |
| inline private

Complete scroll.

void com.ab.view.slidingmenu.CustomViewAbove.computeScroll | ( |  | ) |
| inline

void com.ab.view.slidingmenu.CustomViewAbove.determineDrag | ( | MotionEvent | ev | ) |
| inline private

Determine drag.

参数

  ev | the ev

int com.ab.view.slidingmenu.CustomViewAbove.determineTargetPage | ( | float | pageOffset,
|  | int | velocity,
|  | int | deltaX
| ) |  |
| inline private

Determine target page.

参数

  pageOffset | the page offset
  velocity | the velocity
  deltaX | the delta x

返回
  the int

void com.ab.view.slidingmenu.CustomViewAbove.dispatchDraw | ( | Canvas | canvas | ) |
| inline protected

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

float com.ab.view.slidingmenu.CustomViewAbove.distanceInfluenceForSnapDuration | ( | float | f | ) |
| inline package

Distance influence for snap duration.

参数

  f | the f

返回
  the float

void com.ab.view.slidingmenu.CustomViewAbove.endDrag | ( |  | ) |
| inline private

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.

参数

  event | The 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.

参数

  i | the 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.

参数

  page | the page

返回
  the dest scroll x

int com.ab.view.slidingmenu.CustomViewAbove.getLeftBound | ( |  | ) |
| inline private

Gets the left bound.

返回
  the left bound

float com.ab.view.slidingmenu.CustomViewAbove.getPercentOpen | ( |  | ) |
| inline protected

Gets the percent open.

返回
  the percent open

int com.ab.view.slidingmenu.CustomViewAbove.getPointerIndex | ( | MotionEvent | ev,
|  | int | id
| ) |  |
| inline private

Gets the pointer index.

参数

  ev | the ev
  id | the id

返回
  the pointer index

int com.ab.view.slidingmenu.CustomViewAbove.getRightBound | ( |  | ) |
| inline private

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 | ( |  | ) |
| inline package

Inits the custom view above.

boolean com.ab.view.slidingmenu.CustomViewAbove.isInIgnoredView | ( | MotionEvent | ev | ) |
| inline private

Checks if is in ignored view.

参数

  ev | the 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
| ) |  |
| inline protected

void com.ab.view.slidingmenu.CustomViewAbove.onMeasure | ( | int | widthMeasureSpec,
|  | int | heightMeasureSpec
| ) |  |
| inline protected

void com.ab.view.slidingmenu.CustomViewAbove.onPageScrolled | ( | int | position,
|  | float | offset,
|  | int | offsetPixels
| ) |  |
| inline protected

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.

参数

  position | Position index of the first page currently being displayed. Page position+1 will be visible if positionOffset is nonzero.
  offset | Value from [0, 1) indicating the offset from the page at position.
  offsetPixels | Value in pixels indicating the offset from position.

void com.ab.view.slidingmenu.CustomViewAbove.onSecondaryPointerUp | ( | MotionEvent | ev | ) |
| inline private

On secondary pointer up.

参数

  ev | the ev

void com.ab.view.slidingmenu.CustomViewAbove.onSizeChanged | ( | int | w,
|  | int | h,
|  | int | oldw,
|  | int | oldh
| ) |  |
| inline protected

boolean com.ab.view.slidingmenu.CustomViewAbove.onTouchEvent | ( | MotionEvent | ev | ) |
| inline

boolean com.ab.view.slidingmenu.CustomViewAbove.pageLeft | ( |  | ) |
| inline package

Page left.

返回
  true, if successful

boolean com.ab.view.slidingmenu.CustomViewAbove.pageRight | ( |  | ) |
| inline package

Page right.

返回
  true, if successful

void com.ab.view.slidingmenu.CustomViewAbove.pageScrolled | ( | int | xpos | ) |
| inline private

Page scrolled.

参数

  xpos | the xpos

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

Removes the ignored view.

参数

  v | the 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.

参数

  i | the new above offset

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

Sets the content.

参数

  v | the 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.

参数

  item | Item index to select

void com.ab.view.slidingmenu.CustomViewAbove.setCurrentItem | ( | int | item,
|  | boolean | smoothScroll
| ) |  |
| inline

Set the currently selected page.

参数

  item | Item index to select
  smoothScroll | True to smoothly scroll to the new item, false to transition immediately

void com.ab.view.slidingmenu.CustomViewAbove.setCurrentItemInternal | ( | int | item,
|  | boolean | smoothScroll,
|  | boolean | always
| ) |  |
| inline package

Sets the current item internal.

参数

  item | the item
  smoothScroll | the smooth scroll
  always | the always

void com.ab.view.slidingmenu.CustomViewAbove.setCurrentItemInternal | ( | int | item,
|  | boolean | smoothScroll,
|  | boolean | always,
|  | int | velocity
| ) |  |
| inline package

Sets the current item internal.

参数

  item | the item
  smoothScroll | the smooth scroll
  always | the always
  velocity | the velocity

void com.ab.view.slidingmenu.CustomViewAbove.setCustomViewBehind | ( | CustomViewBehind | cvb | ) |
| inline

Sets the custom view behind.

参数

  cvb | the new custom view behind

OnPageChangeListener com.ab.view.slidingmenu.CustomViewAbove.setInternalPageChangeListener | ( | OnPageChangeListener | listener | ) |
| inline package

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

参数

  listener | Listener 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.

参数

  l | the new on closed listener

void com.ab.view.slidingmenu.CustomViewAbove.setOnOpenedListener | ( | OnOpenedListener | l | ) |
| inline

Sets the on opened listener.

参数

  l | the 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.

参数

  listener | Listener to set

void com.ab.view.slidingmenu.CustomViewAbove.setScrollingCacheEnabled | ( | boolean | enabled | ) |
| inline private

Sets the scrolling cache enabled.

参数

  enabled | the new scrolling cache enabled

void com.ab.view.slidingmenu.CustomViewAbove.setSlidingEnabled | ( | boolean | b | ) |
| inline

Sets the sliding enabled.

参数

  b | the new sliding enabled

void com.ab.view.slidingmenu.CustomViewAbove.setTouchMode | ( | int | i | ) |
| inline

Sets the touch mode.

参数

  i | the new touch mode

void com.ab.view.slidingmenu.CustomViewAbove.smoothScrollTo | ( | int | x,
|  | int | y
| ) |  |
| inline package

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

参数

  x | the number of pixels to scroll by on the X axis
  y | the number of pixels to scroll by on the Y axis

void com.ab.view.slidingmenu.CustomViewAbove.smoothScrollTo | ( | int | x,
|  | int | y,
|  | int | velocity
| ) |  |
| inline package

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

参数

  x | the number of pixels to scroll by on the X axis
  y | the number of pixels to scroll by on the Y axis
  velocity | the velocity associated with a fling, if applicable. (0 otherwise)

void com.ab.view.slidingmenu.CustomViewAbove.startDrag | ( |  | ) |
| inline private

Start drag.

boolean com.ab.view.slidingmenu.CustomViewAbove.thisSlideAllowed | ( | float | dx | ) |
| inline private

This slide allowed.

参数

  dx | the dx

返回
  true, if successful

boolean com.ab.view.slidingmenu.CustomViewAbove.thisTouchAllowed | ( | MotionEvent | ev | ) |
| inline private

This touch allowed.

参数

  ev | the ev

返回
  true, if successful

## 类成员变量说明

final boolean com.ab.view.slidingmenu.CustomViewAbove.DEBUG = false
| static private

The Constant DEBUG.

final int com.ab.view.slidingmenu.CustomViewAbove.INVALID_POINTER = -1
| static private

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
| static private

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
| static private

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
| static private

初始值:
= 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"
| static private

The Constant TAG.

final boolean com.ab.view.slidingmenu.CustomViewAbove.USE_CACHE = false
| static private

The Constant USE_CACHE.

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

- src/com/ab/view/slidingmenu/CustomViewAbove.java