Android7.0中文文档(API) -- EdgeEffect

完整内容,请参考: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方法

booleandraw(Canvas canvas)

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

voidfinish()

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

intgetColor()

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

intgetMaxHeight()

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

booleanisFinished()

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

voidonAbsorb(int velocity)

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值