Code Monkey home page Code Monkey logo

roundimageview's Introduction

RoundImageView

  • support rounded corners,circle,oval(支持圆角图片、圆形图片、椭圆图片)
  • support border(支持描边,可定制描边颜色、描边宽度)
  • supports different radii on each corner(支持定制圆角图片各个圆角的半径)

ScreenShot

image

Gradle

dependencies {
    compile 'org.raphets:roundimageview:1.2.0'
}

Usage

Define in xml:

<org.raphets.roundimageview.RoundImageView
            android:layout_width="180dp"
            android:layout_height="180dp"
            android:src="@drawable/a"
            app:border_width="3dp"
            app:border_color="@android:color/holo_red_dark"
            app:leftBottom_corner_radius="0dp"
            app:leftTop_corner_radius="30dp"
            app:rightBottom_corner_radius="30dp"
            app:rightTop_corner_radius="0dp"
            app:type="round" />

Or in code:

        RoundImageView iv1= (RoundImageView) findViewById(R.id.iv1);

        iv1.setBorderWidth(3)
                .setBorderColor(Color.RED)
                .setType(RoundImageView.TYPE_ROUND)
                .setLeftTopCornerRadius(0)
                .setRightTopCornerRadius(10)
                .setRightBottomCornerRadius(30)
                .setLeftBottomCornerRadius(50);

        Picasso.with(this)
                .load("http://ww2.sinaimg.cn/large/610dc034jw1fa42ktmjh4j20u011hn8g.jpg")
                .into(iv1);

roundimageview's People

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.