Android Shape Image View

    Rating: ★★★★☆
    View: 202
    Download: 94
    Từ khóa:

    For use with recycling view such as ListView or GridView please use shader based implementations.

    How to use

    Gradle dependency:
    
    compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
    Shader Based ImageView's
    

    Shader Based ImageView's

    BubbleImageView

    Android Bubble ImageView

    Attributes:

    • siTriangleHeight the height of the bubble pointer in dp
    • siArrowPosition where to point the arrow, currently left|right
    • siSquare set width and height to the minimum of the given values true|false

    RoundedImageView

    Android Rounded Rectangle ImageView

    Attributes:

    • siBorderColor border color
    • siBorderWidth border width in dp
    • siBorderAlpha alpha value of the border between 0.0-1.0
    • siRadius corner radius in dp
    • siSquare set width and height to the minimum of the given values true|false

    CircularImageView

    Android Circular ImageView

    Attributes:

    • siBorderColor border color
    • siBorderWidth border width in dp
    • siBorderAlpha alpha value of the border between 0.0-1.0

    ShapeImageView

    This view has the capability to process a provided SVG file (for a limited set of SVG elements), build a Path object and draw it on the shader. The library includes SVG files defining a set of basic shapes and ShapeImageView subclasses using those files. You can use whatever SVG you want to have a wonderful and creatively shaped images in your application. The included SVG files are underlibrary/src/main/res/raw

    Attributes:

    • siBorderColor border color
    • siBorderWidth border width in dp
    • siBorderAlpha alpha value of the border between 0.0-1.0
    • siStrokeCap border stroke cap type butt|round|square
    • siStrokeJoin border stroke join type bevel|miter|round
    • siSquare set width and height to the minimum of the given values true|false
    • siShape a reference to an SVG. This is used by ShapeImageView, not the subclasses of it.

    SVG elements that are supported are: rectangle, circle, ellipse, polygon, path, group. Transformations on those elements are also supported.

    The system converts an SVG file into a Path. For each element including the parent element  a new Path is created, and all the children Path's are added to their parent path.

    Bitmap Mask Based ImageViews

    This view uses extra bitmaps for bitmap masks. Therefore it would be good to use them for very custom shapes, possibly not in a recycling view.

    • With mask bitmap:

    Android Star Shape ImageView

    • With shape XML:

    Android Star Shape ImageView

    rounded rectangle shape definition in XML:

    
        
        
    

    Attributes:

    • siShape the bitmap mask shape, either a shape drawable or a bitmap
    • siSquare set width and height to the minimum of the given values true|false

    This method reads a shape file (either bitmap or an android shape xml), creates a bitmap object using this shape, and finally combines the bitmap of the real image to be shown and the mast bitmap using xfermode.

    loading Đang tải...

    template được ưa chuộng