Giter Site home page Giter Site logo

roundimageview's Introduction

RoundImageView

API

圆角图片控件,支持圆形边框和椭圆边框

ScreenShot

Usage

Gradle:
compile 'com.wx.ovalimageview:roundimageview:1.1.0'
Maven:
<dependency>
  <groupId>com.wx.ovalimageview</groupId>
  <artifactId>roundimageview</artifactId>
  <version>1.1.0</version>
  <type>pom</type>
</dependency>
导入Eclipse(只能使用Java代码设置参数):

下载jar包

Demo

Use the RoundImageView as a View, Java and XML are both supported.

Java:
    public class MainActivity extends Activity {
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main)

            RoundImageView imageView = (RoundImageView) findViewById(R.id.round_imageview);
            imageView.setImageResource(R.mipmap.android, Color.RED, 10, true);

        }
    }
XML:
    <com.wx.roundimageview.RoundImageView
        xmlns:app="http://schemas.android.com/apk/res/com.wx.roundimageview.demo"
        android:id="@+id/round_imageview1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:src="@mipmap/ic_launcher"
        app:border_color="#ff0000"
        app:border_width="2dp"
        app:circle="true"
        />
Attributes:
attr 属性 description 描述
border_color 边框颜色
border_width 边框宽度
circle 是否圆形展示
Methods:
method 方法 description 描述
void setBorderColor(String borderColor) 设置边框颜色,形如'#aarrggbb'
void setBorderColor(int borderColor) 设置边框颜色,形如{@link android.graphics.Color}
int getBorderColor() 获取边框颜色
void setBorderWidth(int borderWidth) 设置边框宽度
int getBorderWidth() 获取边框宽度
void setCircle(boolean isCircle) 设置圆形处理方式,默认按椭圆处理
boolean isCircle() 是否设置圆形处理
void setImageResource(int resId, int borderColor, int borderWidth, boolean isCircle) 设置图片资源,包括边框颜色、边框宽度、是否圆形处理
void setImageDrawable(Drawable drawable, int borderColor, int borderWidth, boolean isCircle) 设置图片Drawable,包括边框颜色、边框宽度、是否圆形处理
void setImageBitmap(Bitmap bm, int borderColor, int borderWidth, boolean isCircle) 设置图片bitmap,包括边框颜色、边框宽度、是否圆形处理

About

License

Copyright (C) 2016 [email protected]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

roundimageview's People

Contributors

venshine avatar

Watchers

 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.