IT. Expert System.

Android Reference

EdgeEffectCompat


android.support.v4.widget

Class EdgeEffectCompat



  • public class EdgeEffectCompat
    extends Object
    Helper for accessing EdgeEffect introduced after API level 4 in a backwards compatible fashion. This class is used to access EdgeEffect on platform versions that support it. When running on older platforms it will result in no-ops. It should be used by views that wish to use the standard Android visual effects at the edges of scrolling containers.
    • Constructor Summary

      Constructors
      Constructor and Description
      EdgeEffectCompat(Context context)
      Construct a new EdgeEffect themed using the given context.
    • Method Summary

      Methods
      Modifier and Type Method and Description
      boolean draw(Canvas canvas)
      Draw into the provided canvas.
      void finish()
      Immediately finish the current animation.
      boolean isFinished()
      Reports if this EdgeEffectCompat's animation is finished.
      boolean onAbsorb(int velocity)
      Call when the effect absorbs an impact at the given velocity.
      boolean onPull(float deltaDistance)
      A view should call this when content is pulled away from an edge by the user.
      boolean onRelease()
      Call when the object is released after being pulled.
      void setSize(int width, int height)
      Set the size of this edge effect in pixels.
    • Constructor Detail

      • EdgeEffectCompat

        public EdgeEffectCompat(Context context)
        Construct a new EdgeEffect themed using the given context.

        Note: On platform versions that do not support EdgeEffect, all operations on the newly constructed object will be mocked/no-ops.

        Parameters:
        context - Context to use for theming the effect
    • Method Detail

      • setSize

        public void setSize(int width,
                   int height)
        Set the size of this edge effect in pixels.
        Parameters:
        width - Effect width in pixels
        height - Effect height in pixels
      • isFinished

        public boolean isFinished()
        Reports if this EdgeEffectCompat's animation is finished. If this method returns false after a call to draw(Canvas) the host widget should schedule another drawing pass to continue the animation.
        Returns:
        true if animation is finished, false if drawing should continue on the next frame.
      • finish

        public void finish()
        Immediately finish the current animation. After this call isFinished() will return true.
      • onPull

        public boolean onPull(float deltaDistance)
        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 View.invalidate() if this method returns true and draw the results accordingly.
        Parameters:
        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.
        Returns:
        true if the host view should call invalidate, false if it should not.
      • onRelease

        public boolean onRelease()
        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 View.invalidate() if this method returns true and thereby draw the results accordingly.
        Returns:
        true if the host view should invalidate, false if it should not.
      • onAbsorb

        public boolean onAbsorb(int velocity)
        Call when the effect absorbs an impact at the given velocity. Used when a fling reaches the scroll boundary.

        When using a Scroller or OverScroller, the method getCurrVelocity will provide a reasonable approximation to use here.

        Parameters:
        velocity - Velocity at impact in pixels per second.
        Returns:
        true if the host view should invalidate, false if it should not.
      • draw

        public boolean draw(Canvas canvas)
        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.
        Parameters:
        canvas - Canvas to draw into
        Returns:
        true if drawing should continue beyond this frame to continue the animation


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 721 / 96289524. Delta: 0.02699 с