Ejemplo n.º 1
0
 /**
  * Call when the effect absorbs an impact at the given velocity. Used when a fling reaches the
  * scroll boundary.
  *
  * <p>When using a {@link android.widget.Scroller} or {@link android.widget.OverScroller}, the
  * method <code>getCurrVelocity</code> will provide a reasonable approximation to use here.
  *
  * @param velocity Velocity at impact in pixels per second.
  * @return true if the host view should invalidate, false if it should not.
  */
 public boolean onAbsorb(int velocity) {
   return IMPL.onAbsorb(mEdgeEffect, velocity);
 }
Ejemplo n.º 2
0
 /**
  * Draw into the provided canvas. Assumes that the canvas has been rotated accordingly and the
  * size has been set. The effect will be drawn the full width of X=0 to X=width, beginning from
  * Y=0 and extending to some factor < 1.f of height.
  *
  * @param canvas Canvas to draw into
  * @return true if drawing should continue beyond this frame to continue the animation
  */
 public boolean draw(Canvas canvas) {
   return IMPL.draw(mEdgeEffect, canvas);
 }
Ejemplo n.º 3
0
 /**
  * A view should call this when content is pulled away from an edge by the user. This will update
  * the state of the current visual effect and its associated animation. The host view should
  * always {@link android.view.View#invalidate()} if this method returns true and draw the results
  * accordingly.
  *
  * @param deltaDistance Change in distance since the last call. Values may be 0 (no change) to 1.f
  *     (full length of the view) or negative values to express change back toward the edge reached
  *     to initiate the effect.
  * @return true if the host view should call invalidate, false if it should not.
  */
 public boolean onPull(float deltaDistance) {
   return IMPL.onPull(mEdgeEffect, deltaDistance);
 }
Ejemplo n.º 4
0
 /**
  * Call when the object is released after being pulled. This will begin the "decay" phase of the
  * effect. After calling this method the host view should {@link android.view.View#invalidate()}
  * if this method returns true and thereby draw the results accordingly.
  *
  * @return true if the host view should invalidate, false if it should not.
  */
 public boolean onRelease() {
   return IMPL.onRelease(mEdgeEffect);
 }
Ejemplo n.º 5
0
 /**
  * Reports if this EdgeEffectCompat's animation is finished. If this method returns false after a
  * call to {@link #draw(Canvas)} the host widget should schedule another drawing pass to continue
  * the animation.
  *
  * @return true if animation is finished, false if drawing should continue on the next frame.
  */
 public boolean isFinished() {
   return IMPL.isFinished(mEdgeEffect);
 }
Ejemplo n.º 6
0
 /**
  * Immediately finish the current animation. After this call {@link #isFinished()} will return
  * true.
  */
 public void finish() {
   IMPL.finish(mEdgeEffect);
 }
Ejemplo n.º 7
0
 /**
  * Construct a new EdgeEffect themed using the given context.
  *
  * <p>Note: On platform versions that do not support EdgeEffect, all operations on the newly
  * constructed object will be mocked/no-ops.
  *
  * @param context Context to use for theming the effect
  */
 public EdgeEffectCompat(Context context) {
   mEdgeEffect = IMPL.newEdgeEffect(context);
 }
Ejemplo n.º 8
0
 /**
  * Set the size of this edge effect in pixels.
  *
  * @param width Effect width in pixels
  * @param height Effect height in pixels
  */
 public void setSize(int width, int height) {
   IMPL.setSize(mEdgeEffect, width, height);
 }
Ejemplo n.º 9
0
 public void setSize(int paramInt1, int paramInt2) {
   IMPL.setSize(this.mEdgeEffect, paramInt1, paramInt2);
 }
Ejemplo n.º 10
0
 public boolean onPull(float paramFloat) {
   return IMPL.onPull(this.mEdgeEffect, paramFloat);
 }
Ejemplo n.º 11
0
 public boolean onAbsorb(int paramInt) {
   return IMPL.onAbsorb(this.mEdgeEffect, paramInt);
 }
Ejemplo n.º 12
0
 public boolean draw(Canvas paramCanvas) {
   return IMPL.draw(this.mEdgeEffect, paramCanvas);
 }
Ejemplo n.º 13
0
 public EdgeEffectCompat(Context paramContext) {
   this.mEdgeEffect = IMPL.newEdgeEffect(paramContext);
 }