IT. Expert System.

Android Reference

ClipDrawable


android.graphics.drawable

Class ClipDrawable

  • All Implemented Interfaces:
    Drawable.Callback


    public class ClipDrawable
    extends Drawable
    implements Drawable.Callback
    A Drawable that clips another Drawable based on this Drawable's current level value. You can control how much the child Drawable gets clipped in width and height based on the level, as well as a gravity to control where it is placed in its overall container. Most often used to implement things like progress bars, by increasing the drawable's level with setLevel().

    Note: The drawable is clipped completely and not visible when the level is 0 and fully revealed when the level is 10,000.

    It can be defined in an XML file with the <clip> element. For more information, see the guide to Drawable Resources.

    • Constructor Detail

      • ClipDrawable

        public ClipDrawable(Drawable drawable,
                    int gravity,
                    int orientation)
        Parameters:
        orientation - Bitwise-or of HORIZONTAL and/or VERTICAL
    • Method Detail

      • invalidateDrawable

        public void invalidateDrawable(Drawable who)
        Description copied from interface: Drawable.Callback
        Called when the drawable needs to be redrawn. A view at this point should invalidate itself (or at least the part of itself where the drawable appears).
        Specified by:
        invalidateDrawable in interface Drawable.Callback
        Parameters:
        who - The drawable that is requesting the update.
      • getChangingConfigurations

        public int getChangingConfigurations()
        Description copied from class: Drawable
        Return a mask of the configuration parameters for which this drawable may change, requiring that it be re-created. The default implementation returns whatever was provided through Drawable.setChangingConfigurations(int) or 0 by default. Subclasses may extend this to or in the changing configurations of any other drawables they hold.
        Overrides:
        getChangingConfigurations in class Drawable
        Returns:
        Returns a mask of the changing configuration parameters, as defined by Configuration.
        See Also:
        Configuration
      • getPadding

        public boolean getPadding(Rect padding)
        Description copied from class: Drawable
        Return in padding the insets suggested by this Drawable for placing content inside the drawable's bounds. Positive values move toward the center of the Drawable (set Rect.inset). Returns true if this drawable actually has a padding, else false. When false is returned, the padding is always set to 0.
        Overrides:
        getPadding in class Drawable
      • setVisible

        public boolean setVisible(boolean visible,
                         boolean restart)
        Description copied from class: Drawable
        Set whether this Drawable is visible. This generally does not impact the Drawable's behavior, but is a hint that can be used by some Drawables, for example, to decide whether run animations.
        Overrides:
        setVisible in class Drawable
        Parameters:
        visible - Set to true if visible, false if not.
        restart - You can supply true here to force the drawable to behave as if it has just become visible, even if it had last been set visible. Used for example to force animations to restart.
        Returns:
        boolean Returns true if the new visibility is different than its previous state.
      • setAlpha

        public void setAlpha(int alpha)
        Description copied from class: Drawable
        Specify an alpha value for the drawable. 0 means fully transparent, and 255 means fully opaque.
        Specified by:
        setAlpha in class Drawable
      • setColorFilter

        public void setColorFilter(ColorFilter cf)
        Description copied from class: Drawable
        Specify an optional colorFilter for the drawable. Pass null to remove any filters.
        Specified by:
        setColorFilter in class Drawable
      • isStateful

        public boolean isStateful()
        Description copied from class: Drawable
        Indicates whether this view will change its appearance based on state. Clients can use this to determine whether it is necessary to calculate their state and call setState.
        Overrides:
        isStateful in class Drawable
        Returns:
        True if this view changes its appearance based on state, false otherwise.
        See Also:
        Drawable.setState(int[])
      • onStateChange

        protected boolean onStateChange(int[] state)
        Description copied from class: Drawable
        Override this in your subclass to change appearance if you recognize the specified state.
        Overrides:
        onStateChange in class Drawable
        Returns:
        Returns true if the state change has caused the appearance of the Drawable to change (that is, it needs to be drawn), else false if it looks the same and there is no need to redraw it since its last state.
      • onLevelChange

        protected boolean onLevelChange(int level)
        Description copied from class: Drawable
        Override this in your subclass to change appearance if you vary based on level.
        Overrides:
        onLevelChange in class Drawable
        Returns:
        Returns true if the level change has caused the appearance of the Drawable to change (that is, it needs to be drawn), else false if it looks the same and there is no need to redraw it since its last level.
      • onBoundsChange

        protected void onBoundsChange(Rect bounds)
        Description copied from class: Drawable
        Override this in your subclass to change appearance if you recognize the specified state.
        Overrides:
        onBoundsChange in class Drawable
      • draw

        public void draw(Canvas canvas)
        Description copied from class: Drawable
        Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter).
        Specified by:
        draw in class Drawable
        Parameters:
        canvas - The canvas to draw into
      • getIntrinsicWidth

        public int getIntrinsicWidth()
        Description copied from class: Drawable
        Return the intrinsic width of the underlying drawable object. Returns -1 if it has no intrinsic width, such as with a solid color.
        Overrides:
        getIntrinsicWidth in class Drawable
      • getIntrinsicHeight

        public int getIntrinsicHeight()
        Description copied from class: Drawable
        Return the intrinsic height of the underlying drawable object. Returns -1 if it has no intrinsic height, such as with a solid color.
        Overrides:
        getIntrinsicHeight in class Drawable


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: 1336 / . Delta: 0.04080 с