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

class  FlingRotateRunnable
 

Public 成员函数

 CarouselImageView (Context context)
 
 CarouselImageView (Context context, AttributeSet attrs)
 
 CarouselImageView (Context context, AttributeSet attrs, int defStyle)
 
boolean onTouchEvent (MotionEvent event)
 
boolean showContextMenu ()
 
boolean onKeyDown (int keyCode, KeyEvent event)
 
boolean onKeyUp (int keyCode, KeyEvent event)
 
ViewGroup.LayoutParams generateLayoutParams (AttributeSet attrs)
 
void dispatchSetSelected (boolean selected)
 
boolean showContextMenuForChild (View originalView)
 
boolean dispatchKeyEvent (KeyEvent event)
 
boolean onDown (MotionEvent e)
 
boolean onFling (MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
 
void onLongPress (MotionEvent e)
 
boolean onScroll (MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)
 
boolean onSingleTapUp (MotionEvent e)
 
void onShowPress (MotionEvent e)
 
void setCallbackDuringFling (boolean shouldCallback)
 
void setCallbackOnUnselectedItemClick (boolean shouldCallback)
 
void setAnimationDuration (int animationDurationMillis)
 
void setGravity (int gravity)
 

Protected 成员函数

int computeHorizontalScrollExtent ()
 
int computeHorizontalScrollOffset ()
 
int computeHorizontalScrollRange ()
 
ContextMenuInfo getContextMenuInfo ()
 
void onFocusChanged (boolean gainFocus, int direction, Rect previouslyFocusedRect)
 
boolean checkLayoutParams (ViewGroup.LayoutParams p)
 
ViewGroup.LayoutParams generateLayoutParams (ViewGroup.LayoutParams p)
 
void dispatchSetPressed (boolean pressed)
 
int getChildDrawingOrder (int childCount, int i)
 
boolean getChildStaticTransformation (View child, Transformation transformation)
 
void onLayout (boolean changed, int l, int t, int r, int b)
 

包函数

void layout (int delta, boolean animate)
 
void selectionChanged ()
 
void setSelectedPositionInt (int position)
 
float getLimitedMotionScrollAmount (boolean motionToLeft, float deltaX)
 
int getLimitedMotionScrollAmount (boolean motionToLeft, int deltaX)
 
void onCancel ()
 
void onUp ()
 
void scrollToChild (int i)
 
void trackMotionScroll (float deltaAngle)
 

Private 成员函数

void Calculate3DPosition (CarouselItemImage child, int diameter, float angleOffset)
 
int calculateTop (View child, boolean duringLayout)
 
boolean dispatchLongPress (View view, int position, long id)
 
void dispatchPress (View child)
 
void dispatchUnpress ()
 
int getCenterOfGallery ()
 
void makeAndAddView (int position, float angleOffset)
 
void onFinishedMovement ()
 
void scrollIntoSlots ()
 
void setUpChild (CarouselItemImage child, int index, float angleOffset)
 
void updateSelectedItemMetadata ()
 

静态 Private 成员函数

static int getCenterOfView (View view)
 

Private 属性

AdapterContextMenuInfo mContextMenuInfo
 
int mAnimationDuration = 900
 
Camera mCamera = new Camera()
 
Runnable mDisableSuppressSelectionChangedRunnable
 
int mDownTouchPosition
 
View mDownTouchView
 
FlingRotateRunnable mFlingRunnable = new FlingRotateRunnable()
 
GestureDetector mGestureDetector
 
int mGravity
 
boolean mIsFirstScroll
 
int mMaxQuantity = MAX_QUANTITY
 
int mMinQuantity = MIN_QUANTITY
 
boolean mReceivedInvokeKeyDown
 
View mSelectedChild
 
boolean mShouldCallbackDuringFling = true
 
boolean mShouldCallbackOnUnselectedItemClick = true
 
boolean mShouldStopFling
 
boolean mSuppressSelectionChanged
 
float mTheta = (float)(15.0f*(Math.PI/180.0))
 
boolean mUseReflection
 

静态 Private 属性

static final String TAG = CarouselImageView.class.getSimpleName()
 
static final boolean localLOGV = false
 
static final int MIN_QUANTITY = 3
 
static final int MAX_QUANTITY = 12
 
static final float MAX_THETA = 15.0f
 
static final int SCROLL_TO_FLING_UNCERTAINTY_TIMEOUT = 250
 

额外继承的成员函数

详细描述

© 2012 amsoft.cn 名称:CarouselImageView.java 描述:图片适配

作者
还如一梦中
版本
v1.0
日期
:2013-11-28 上午11:15:11

构造及析构函数说明

com.ab.view.carousel.CarouselImageView.CarouselImageView ( Context  context)
inline

Instantiates a new carousel image view.

参数
contextthe context
com.ab.view.carousel.CarouselImageView.CarouselImageView ( Context  context,
AttributeSet  attrs 
)
inline

Instantiates a new carousel image view.

参数
contextthe context
attrsthe attrs
com.ab.view.carousel.CarouselImageView.CarouselImageView ( Context  context,
AttributeSet  attrs,
int  defStyle 
)
inline

Instantiates a new carousel image view.

参数
contextthe context
attrsthe attrs
defStylethe def style

成员函数说明

void com.ab.view.carousel.CarouselImageView.Calculate3DPosition ( CarouselItemImage  child,
int  diameter,
float  angleOffset 
)
inlineprivate

Calculate3 d position.

参数
childthe child
diameterthe diameter
angleOffsetthe angle offset
int com.ab.view.carousel.CarouselImageView.calculateTop ( View  child,
boolean  duringLayout 
)
inlineprivate

Figure out vertical placement based on mGravity.

参数
childChild to place
duringLayoutthe during layout
返回
Where the top of the child should be
boolean com.ab.view.carousel.CarouselImageView.checkLayoutParams ( ViewGroup.LayoutParams  p)
inlineprotected

描述:TODO.

版本
v1.0
参数
pthe p
返回
true, if successful
参见
android.view.ViewGroup::checkLayoutParams(android.view.ViewGroup.LayoutParams)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
int com.ab.view.carousel.CarouselImageView.computeHorizontalScrollExtent ( )
inlineprotected

Compute the horizontal extent of the horizontal scrollbar's thumb within the horizontal range. This value is used to compute the length of the thumb within the scrollbar's track.

返回
the int
int com.ab.view.carousel.CarouselImageView.computeHorizontalScrollOffset ( )
inlineprotected

Compute the horizontal offset of the horizontal scrollbar's thumb within the horizontal range. This value is used to compute the position of the thumb within the scrollbar's track.

返回
the int
int com.ab.view.carousel.CarouselImageView.computeHorizontalScrollRange ( )
inlineprotected

Compute the horizontal range that the horizontal scrollbar represents.

返回
the int
boolean com.ab.view.carousel.CarouselImageView.dispatchKeyEvent ( KeyEvent  event)
inline

描述:TODO.

版本
v1.0
参数
eventthe event
返回
true, if successful
参见
android.view.ViewGroup::dispatchKeyEvent(android.view.KeyEvent)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
boolean com.ab.view.carousel.CarouselImageView.dispatchLongPress ( View  view,
int  position,
long  id 
)
inlineprivate

Dispatch long press.

参数
viewthe view
positionthe position
idthe id
返回
true, if successful
void com.ab.view.carousel.CarouselImageView.dispatchPress ( View  child)
inlineprivate

Dispatch press.

参数
childthe child
void com.ab.view.carousel.CarouselImageView.dispatchSetPressed ( boolean  pressed)
inlineprotected

描述:TODO.

版本
v1.0
参数
pressedthe pressed
参见
android.view.ViewGroup::dispatchSetPressed(boolean)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
void com.ab.view.carousel.CarouselImageView.dispatchSetSelected ( boolean  selected)
inline

描述:TODO.

版本
v1.0
参数
selectedthe selected
参见
android.view.ViewGroup::dispatchSetSelected(boolean)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
void com.ab.view.carousel.CarouselImageView.dispatchUnpress ( )
inlineprivate

Dispatch unpress.

ViewGroup.LayoutParams com.ab.view.carousel.CarouselImageView.generateLayoutParams ( ViewGroup.LayoutParams  p)
inlineprotected

描述:TODO.

版本
v1.0
参数
pthe p
返回
the view group. layout params
参见
android.view.ViewGroup::generateLayoutParams(android.view.ViewGroup.LayoutParams)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
ViewGroup.LayoutParams com.ab.view.carousel.CarouselImageView.generateLayoutParams ( AttributeSet  attrs)
inline

描述:TODO.

版本
v1.0
参数
attrsthe attrs
返回
the view group. layout params
参见
android.view.ViewGroup::generateLayoutParams(android.util.AttributeSet)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
int com.ab.view.carousel.CarouselImageView.getCenterOfGallery ( )
inlineprivate

Gets the center of gallery.

返回
The center of this Gallery.
static int com.ab.view.carousel.CarouselImageView.getCenterOfView ( View  view)
inlinestaticprivate

Gets the center of view.

参数
viewthe view
返回
The center of the given view.
int com.ab.view.carousel.CarouselImageView.getChildDrawingOrder ( int  childCount,
int  i 
)
inlineprotected

Index of the child to draw for this iteration.

参数
childCountthe child count
ithe i
返回
the child drawing order
boolean com.ab.view.carousel.CarouselImageView.getChildStaticTransformation ( View  child,
Transformation  transformation 
)
inlineprotected

Transform an item depending on it's coordinates.

参数
childthe child
transformationthe transformation
返回
the child static transformation
ContextMenuInfo com.ab.view.carousel.CarouselImageView.getContextMenuInfo ( )
inlineprotected

Extra information about the item for which the context menu should be shown.

返回
the context menu info
float com.ab.view.carousel.CarouselImageView.getLimitedMotionScrollAmount ( boolean  motionToLeft,
float  deltaX 
)
inlinepackage

Gets the limited motion scroll amount.

参数
motionToLeftthe motion to left
deltaXthe delta x
返回
the limited motion scroll amount
int com.ab.view.carousel.CarouselImageView.getLimitedMotionScrollAmount ( boolean  motionToLeft,
int  deltaX 
)
inlinepackage

Gets the limited motion scroll amount.

参数
motionToLeftthe motion to left
deltaXthe delta x
返回
the limited motion scroll amount
void com.ab.view.carousel.CarouselImageView.layout ( int  delta,
boolean  animate 
)
inlinepackage

Setting up images.

参数
deltathe delta
animatethe animate
void com.ab.view.carousel.CarouselImageView.makeAndAddView ( int  position,
float  angleOffset 
)
inlineprivate

Make and add view.

参数
positionthe position
angleOffsetthe angle offset
void com.ab.view.carousel.CarouselImageView.onCancel ( )
inlinepackage

On cancel.

boolean com.ab.view.carousel.CarouselImageView.onDown ( MotionEvent  e)
inline

描述:TODO.

版本
v1.0
参数
ethe e
返回
true, if successful
参见
android.view.GestureDetector.OnGestureListener::onDown(android.view.MotionEvent)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
void com.ab.view.carousel.CarouselImageView.onFinishedMovement ( )
inlineprivate

Called when rotation is finished.

boolean com.ab.view.carousel.CarouselImageView.onFling ( MotionEvent  e1,
MotionEvent  e2,
float  velocityX,
float  velocityY 
)
inline

描述:TODO.

版本
v1.0
参数
e1the e1
e2the e2
velocityXthe velocity x
velocityYthe velocity y
返回
true, if successful
参见
android.view.GestureDetector.OnGestureListener::onFling(android.view.MotionEvent, android.view.MotionEvent, float, float)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
void com.ab.view.carousel.CarouselImageView.onFocusChanged ( boolean  gainFocus,
int  direction,
Rect  previouslyFocusedRect 
)
inlineprotected

描述:TODO.

版本
v1.0
参数
gainFocusthe gain focus
directionthe direction
previouslyFocusedRectthe previously focused rect
参见
android.view.View::onFocusChanged(boolean, int, android.graphics.Rect)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
boolean com.ab.view.carousel.CarouselImageView.onKeyDown ( int  keyCode,
KeyEvent  event 
)
inline

Handles left, right, and clicking.

参数
keyCodethe key code
eventthe event
返回
true, if successful
参见
android.view.View::onKeyDown
boolean com.ab.view.carousel.CarouselImageView.onKeyUp ( int  keyCode,
KeyEvent  event 
)
inline

描述:TODO.

版本
v1.0
参数
keyCodethe key code
eventthe event
返回
true, if successful
参见
android.view.View::onKeyUp(int, android.view.KeyEvent)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
void com.ab.view.carousel.CarouselImageView.onLayout ( boolean  changed,
int  l,
int  t,
int  r,
int  b 
)
inlineprotected

Setting up images after layout changed.

参数
changedthe changed
lthe l
tthe t
rthe r
bthe b
void com.ab.view.carousel.CarouselImageView.onLongPress ( MotionEvent  e)
inline

描述:TODO.

版本
v1.0
参数
ethe e
参见
android.view.GestureDetector.OnGestureListener::onLongPress(android.view.MotionEvent)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
boolean com.ab.view.carousel.CarouselImageView.onScroll ( MotionEvent  e1,
MotionEvent  e2,
float  distanceX,
float  distanceY 
)
inline

描述:TODO.

版本
v1.0
参数
e1the e1
e2the e2
distanceXthe distance x
distanceYthe distance y
返回
true, if successful
参见
android.view.GestureDetector.OnGestureListener::onScroll(android.view.MotionEvent, android.view.MotionEvent, float, float)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
void com.ab.view.carousel.CarouselImageView.onShowPress ( MotionEvent  e)
inline

描述:TODO.

版本
v1.0
参数
ethe e
参见
android.view.GestureDetector.OnGestureListener::onShowPress(android.view.MotionEvent)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
boolean com.ab.view.carousel.CarouselImageView.onSingleTapUp ( MotionEvent  e)
inline

描述:TODO.

版本
v1.0
参数
ethe e
返回
true, if successful
参见
android.view.GestureDetector.OnGestureListener::onSingleTapUp(android.view.MotionEvent)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
boolean com.ab.view.carousel.CarouselImageView.onTouchEvent ( MotionEvent  event)
inline

Implemented to handle touch screen motion events.

参数
eventthe event
返回
true, if successful
void com.ab.view.carousel.CarouselImageView.onUp ( )
inlinepackage

On up.

void com.ab.view.carousel.CarouselImageView.scrollIntoSlots ( )
inlineprivate

Brings an item with nearest to 0 degrees angle to this angle and sets it selected.

void com.ab.view.carousel.CarouselImageView.scrollToChild ( int  i)
inlinepackage

Scroll to child.

参数
ithe i
void com.ab.view.carousel.CarouselImageView.selectionChanged ( )
inlinepackage

描述:TODO.

版本
v1.0
参见
com.ab.view.carousel.CarouselAdapter::selectionChanged()
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
void com.ab.view.carousel.CarouselImageView.setAnimationDuration ( int  animationDurationMillis)
inline

Sets how long the transition animation should run when a child view changes position. Only relevant if animation is turned on.

参数
animationDurationMillisThe duration of the transition, in milliseconds.

ref android.R.styleable::Gallery_animationDuration

void com.ab.view.carousel.CarouselImageView.setCallbackDuringFling ( boolean  shouldCallback)
inline

Whether or not to callback on any getOnItemSelectedListener() while the items are being flinged. If false, only the final selected item will cause the callback. If true, all items between the first and the final will cause callbacks.

参数
shouldCallbackWhether or not to callback on the listener while the items are being flinged.
void com.ab.view.carousel.CarouselImageView.setCallbackOnUnselectedItemClick ( boolean  shouldCallback)
inline

Whether or not to callback when an item that is not selected is clicked. If false, the item will become selected (and re-centered). If true, the

参数
shouldCallbackWhether or not to callback on the listener when a item that is not selected is clicked. getOnItemClickListener() will get the callback.
void com.ab.view.carousel.CarouselImageView.setGravity ( int  gravity)
inline

Sets the gravity.

参数
gravitythe new gravity
void com.ab.view.carousel.CarouselImageView.setSelectedPositionInt ( int  position)
inlinepackage

描述:TODO.

版本
v1.0
参数
positionthe new selected position int
参见
com.ab.view.carousel.CarouselAdapter::setSelectedPositionInt(int)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
void com.ab.view.carousel.CarouselImageView.setUpChild ( CarouselItemImage  child,
int  index,
float  angleOffset 
)
inlineprivate

Helper for makeAndAddView to set the position of a view and fill out its layout paramters.

参数
childThe view to position
indexthe index
angleOffsetthe angle offset
boolean com.ab.view.carousel.CarouselImageView.showContextMenu ( )
inline

Bring up the context menu for this view.

返回
true, if successful
boolean com.ab.view.carousel.CarouselImageView.showContextMenuForChild ( View  originalView)
inline

描述:TODO.

版本
v1.0
参数
originalViewthe original view
返回
true, if successful
参见
android.view.ViewGroup::showContextMenuForChild(android.view.View)
作者
: amsoft.cn
日期
:2013-11-28 上午11:14:34
void com.ab.view.carousel.CarouselImageView.trackMotionScroll ( float  deltaAngle)
inlinepackage

Tracks a motion scroll. In reality, this is used to do just about any movement to items (touch scroll, arrow-key scroll, set an item as selected).

参数
deltaAngleChange in X from the previous event.
void com.ab.view.carousel.CarouselImageView.updateSelectedItemMetadata ( )
inlineprivate

Update selected item metadata.

类成员变量说明

final boolean com.ab.view.carousel.CarouselImageView.localLOGV = false
staticprivate

If logging should be inside class.

int com.ab.view.carousel.CarouselImageView.mAnimationDuration = 900
private

How long the transition animation should run when a child view changes position, measured in milliseconds.

final int com.ab.view.carousel.CarouselImageView.MAX_QUANTITY = 12
staticprivate

Default max quantity of images.

final float com.ab.view.carousel.CarouselImageView.MAX_THETA = 15.0f
staticprivate

Max theta.

Camera com.ab.view.carousel.CarouselImageView.mCamera = new Camera()
private

Camera to make 3D rotation.

AdapterContextMenuInfo com.ab.view.carousel.CarouselImageView.mContextMenuInfo
private

The info for adapter context menu.

Runnable com.ab.view.carousel.CarouselImageView.mDisableSuppressSelectionChangedRunnable
private
初始值:
= new Runnable() {
public void run() {
}
}

Sets mSuppressSelectionChanged = false. This is used to set it to false in the future. It will also trigger a selection changed.

int com.ab.view.carousel.CarouselImageView.mDownTouchPosition
private

The position of the item that received the user's down touch.

View com.ab.view.carousel.CarouselImageView.mDownTouchView
private

The view of the item that received the user's down touch.

FlingRotateRunnable com.ab.view.carousel.CarouselImageView.mFlingRunnable = new FlingRotateRunnable()
private

Executes the delta rotations from a fling or scroll movement.

GestureDetector com.ab.view.carousel.CarouselImageView.mGestureDetector
private

Helper for detecting touch gestures.

int com.ab.view.carousel.CarouselImageView.mGravity
private

Gravity for the widget.

final int com.ab.view.carousel.CarouselImageView.MIN_QUANTITY = 3
staticprivate

Default min quantity of images.

boolean com.ab.view.carousel.CarouselImageView.mIsFirstScroll
private

If true, this onScroll is the first for this user's drag (remember, a drag sends many onScrolls).

int com.ab.view.carousel.CarouselImageView.mMaxQuantity = MAX_QUANTITY
private

Set max qantity of images.

int com.ab.view.carousel.CarouselImageView.mMinQuantity = MIN_QUANTITY
private

Set min quantity of images.

boolean com.ab.view.carousel.CarouselImageView.mReceivedInvokeKeyDown
private

If true, we have received the "invoke" (center or enter buttons) key down. This is checked before we action on the "invoke" key up, and is subsequently cleared.

View com.ab.view.carousel.CarouselImageView.mSelectedChild
private

The currently selected item's child.

boolean com.ab.view.carousel.CarouselImageView.mShouldCallbackDuringFling = true
private

Whether to continuously callback on the item selected listener during a fling.

boolean com.ab.view.carousel.CarouselImageView.mShouldCallbackOnUnselectedItemClick = true
private

Whether to callback when an item that is not selected is clicked.

boolean com.ab.view.carousel.CarouselImageView.mShouldStopFling
private

When fling runnable runs, it resets this to false. Any method along the path until the end of its run() can set this to true to abort any remaining fling. For example, if we've reached either the leftmost or rightmost item, we will set this to true.

boolean com.ab.view.carousel.CarouselImageView.mSuppressSelectionChanged
private

If true, do not callback to item selected listener.

float com.ab.view.carousel.CarouselImageView.mTheta = (float)(15.0f*(Math.PI/180.0))
private

The axe angle.

boolean com.ab.view.carousel.CarouselImageView.mUseReflection
private

If items should be reflected.

final int com.ab.view.carousel.CarouselImageView.SCROLL_TO_FLING_UNCERTAINTY_TIMEOUT = 250
staticprivate

Duration in milliseconds from the start of a scroll during which we're unsure whether the user is scrolling or flinging.

final String com.ab.view.carousel.CarouselImageView.TAG = CarouselImageView.class.getSimpleName()
staticprivate

Tag for a class logging.


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