完整内容,请参考:http://www.zhdoc.net/android/reference/android/widget/EdgeEffect.html

EdgeEffect

public class EdgeEffect
extends Object

java.lang.Object
android.widget.EdgeEffect

This class performs the graphical effect used at the edges of scrollable widgets when the user scrolls beyond the content bounds in 2D space.
当用户滚动到二维空间中的内容边界时,该类将在可滚动控件边缘执行图形效果。

EdgeEffect is stateful. Custom widgets using EdgeEffect should create an instance for each edge that should show the effect, feed it input data using the methods onAbsorb(int), onPull(float), and onRelease(), and draw the effect using draw(Canvas) in the widget's overridden draw(Canvas) method. If isFinished() returns false after drawing, the edge effect's animation is not yet complete and the widget should schedule another drawing pass to continue the animation.
EdgeEffect是有状态的。使用EdgeEffect的自定义控件应该为每条边创建一个实例,该实例应该显示效果,使用onAbsorb(int)onPull(float)onRelease()来填充输入数据。并且在控件重载的draw(Canvas)方法中使用draw(Canvas)来绘制边缘。如果绘制后调用isFinished()返回false,则表明边缘效果的动画还没有完成,并且控件应该安排另一个绘制来继续这个动画。

When drawing, widgets should draw their main content and child views first, usually by invoking super.draw(canvas) from an overridden draw method. (This will invoke onDraw and dispatch drawing to child views as needed.) The edge effect may then be drawn on top of the view's content using the draw(Canvas) method.
绘制过程中,控件将首先绘制它们的主内容和子视图,通常通过从重载的draw方法中调用super.draw(canvas)。(这将调用onDraw,并根据需要派发绘制给子视图。)然后可以使用draw(Canvas)方法在视图的内容顶层绘制边缘效果。

摘要

Public构造方法

EdgeEffect(Context context)

Construct a new EdgeEffect with a theme appropriate for the provided context.
使用提供的上下文中合适的theme,来创建一个新的EdgeEffect对象。

Public方法

boolean draw(Canvas canvas)

Draw into the provided canvas.
绘制在提供的canvas中。

void finish()

Immediately finish the current animation.
立即完成当前动画。

int getColor()

Return the color of this edge effect in argb.
返回此边缘效果的颜色(argb格式)。

int getMaxHeight()

Return the maximum height that the edge effect will be drawn at given the original input size.
返回最大高度,在指定的原始input size上,边缘效果将被绘制出来。

boolean isFinished()

Reports if this EdgeEffect's animation is finished.
返回此EdgeEffects的动画是否已经完成。

void onAbsorb(int velocity)

Call when the effect absorbs an impact at the given velocity.
当这种效果会在指定的速度下接收一个fling动作时,调用此方法。

更多相关文章

  1. Android实现Bitmap高斯模糊效果
  2. Android定义宽高比控件
  3. android中的基本控件
  4. Android 日期控件属性
  5. Android 布局 & 一些控件
  6. android加载框效果《IT蓝豹》
  7. Android Market的 Loading效果
  8. Android UI设计——EditText控件

随机推荐

  1. android 与c#服务端DES加密不一致问题解
  2. Activity的布局
  3. 2013.03.19(2)———android ActivityGroup
  4. Android(安卓)- 视频提取图片方法
  5. Android程序的退出活动
  6. 【Android】获取图片和视频缩略图
  7. UC
  8. 【Android】解决修改状态栏颜色不生效的
  9. 转:android 更改avd路径
  10. [转]android shape的使用