Coder Social home page Coder Social logo

shapedimageview's Introduction

ShapedImageView

  • 支持圆形 圆角矩形
  • 支持显示边框
  • 支持TransitionDrawable

Screenhots

Usage

dependencies

compile 'cn.gavinliu.android.lib:ShapedImageView:0.5'

attr

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <declare-styleable name="ShapedImageView">
        <attr name="shape_mode" format="enum">
            <enum name="round_rect" value="1" />
            <enum name="circle" value="2" />
        </attr>
        <attr name="round_radius" format="dimension" />

        <attr name="stroke_width" format="dimension" />
        <attr name="stroke_color" format="color|reference" />
    </declare-styleable>

</resources>

Circle

<cn.gavinliu.android.lib.shapedimageview.ShapedImageView
    android:id="@+id/image1"
    android:layout_width="200dp"
    android:layout_height="200dp"
    android:layout_centerInParent="true"
    app:shape_mode="circle"
    app:stroke_color="#009688"
    app:stroke_width="3dp" />

Round Rect

<cn.gavinliu.android.lib.shapedimageview.ShapedImageView
    android:id="@+id/image2"
    android:layout_width="200dp"
    android:layout_height="200dp"
    android:layout_centerInParent="true"
    app:round_radius="20dp"
    app:shape_mode="round_rect"
    app:stroke_color="#009688"
    app:stroke_width="3dp" />

TODO

  • Support Any Shape (SVG to PathShape)

License

MIT

shapedimageview's People

Contributors

gavinliu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.