CircleImageView
===============
A fast circular ImageView perfect for profile images. This is based on [RoundedImageView from Vince Mi](https://github.com/vinc3m1/RoundedImageView) which itself is based on [techniques recommended by Romain Guy](http://www.curious-creature.org/2012/12/11/android-recipe-1-image-with-rounded-corners/).
![CircleImageView](https://raw.github.com/hdodenhof/CircleImageView/master/screenshot.png)
It uses a BitmapShader and **does not**:
* create a copy of the original bitmap
* use a clipPath (which is neither hardware accelerated nor anti-aliased)
* use setXfermode to clip the bitmap (which means drawing twice to the canvas)
As this is just a custom ImageView and not a custom Drawable or a combination of both, it can be used with all kinds of drawables, i.e. a PicassoDrawable from [Picasso](https://github.com/square/picasso) or other non-standard drawables (needs some testing though).
Gradle
------
```
dependencies {
...
compile 'de.hdodenhof:circleimageview:1.2.1'
}
```
Usage
-----
```xml
<de.hdodenhof.circleimageview.CircleImageView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/profile_image"
android:layout_width="96dp"
android:layout_height="96dp"
android:src="@drawable/profile"
app:border_width="2dp"
app:border_color="#FF000000"/>
```
Limitations
-----------
* The ScaleType is always CENTER_CROP and you'll get an exception if you try to change it. This is (currently) by design as it's perfectly fine for profile images.
* Enabling `adjustViewBounds` is not supported as this requires an unsupported ScaleType
* If you use Picasso for fetching images, you need to set the `noFade()` option to avoid messed up images. If you want to keep the fadeIn animation, you have to fetch the image into a `Target` and apply a custom animation when setting it as source for the `CircleImageView` in `onBitmapLoaded()`.
* Using a `TransitionDrawable` with `CircleImageView` doesn't work properly and leads to messed up images.
Changelog
---------
* **1.2.1**
* Fix ColorDrawables not being rendered properly on Lollipop
* **1.2.0**
* Add support for setImageURI(Uri uri)
* Fix view not being initialized when using CircleImageView(Context context)
* **1.1.1**
* Fix border being shown although border width is set to 0
* **1.1.0**
* Add support for ColorDrawables
* Add getters and setters for border color and border width
* **1.0.1**
* Prevent crash due to OutOfMemoryError
* **1.0.0**
* Initial release
License
-------
Copyright 2014 Henning Dodenhof
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.
没有合适的资源?快使用搜索试试~ 我知道了~
android圆角图片,支持自定义边框颜色
共142个文件
xml:43个
class:26个
java:13个
5星 · 超过95%的资源 需积分: 29 63 下载量 51 浏览量
2015-01-09
10:50:16
上传
评论 2
收藏 3.18MB RAR 举报
温馨提示
android圆角图片,支持自定义边框颜色,及边框的大小。需要的可以下载
资源推荐
资源详情
资源评论
收起资源包目录
android圆角图片,支持自定义边框颜色 (142个子文件)
circleimageview-debug.aar 6KB
circleimageview-release.aar 6KB
resources-debug.ap_ 562KB
resources-debug-test.ap_ 1KB
resources-debug-test.ap_ 787B
sample-debug.apk 570KB
sample-debug-unaligned.apk 570KB
gradlew.bat 2KB
fileSnapshots.bin 51KB
taskArtifacts.bin 47KB
fileHashes.bin 24KB
outputFileStates.bin 21KB
CircleImageView.class 8KB
CircleImageView.class 8KB
MainActivity.class 1KB
MainActivity$MainFragment.class 1KB
R.class 922B
BuildConfig.class 868B
BuildConfig.class 847B
BuildConfig.class 712B
R$styleable.class 647B
R$styleable.class 626B
R$styleable.class 620B
R$styleable.class 620B
R$attr.class 514B
R$attr.class 514B
R$layout.class 491B
R$drawable.class 486B
R$attr.class 483B
R$color.class 471B
R$attr.class 462B
R$dimen.class 450B
R$string.class 449B
R$style.class 446B
R$id.class 438B
R.class 435B
R.class 435B
R.class 435B
classes.dex 14KB
.gitignore 134B
build.gradle 277B
build.gradle 258B
build.gradle 246B
settings.gradle 37B
gradlew 5KB
sample.iml 7KB
circleimageview.iml 7KB
CircleImageView-master.iml 893B
gradle-wrapper.jar 49KB
classes.jar 5KB
classes.jar 5KB
classes.jar 5KB
classes-ea58a4fdf32ea8f8ec5809cc666d6fb092fd8db7.jar 4KB
CircleImageView.java 7KB
R.java 5KB
R.java 4KB
R.java 4KB
R.java 4KB
MainActivity.java 1015B
BuildConfig.java 644B
BuildConfig.java 629B
R.java 624B
R.java 624B
BuildConfig.java 623B
BuildConfig.java 608B
BuildConfig.java 587B
cache.properties.lock 17B
README.md 3KB
MANIFEST.MF 25B
MANIFEST.MF 25B
.name 22B
hugh.png 514KB
hugh.png 511KB
screenshot.png 245KB
ic_launcher.png 19KB
ic_launcher.png 18KB
ic_launcher.png 14KB
ic_launcher.png 14KB
ic_launcher.png 9KB
ic_launcher.png 9KB
ic_launcher.png 5KB
ic_launcher.png 5KB
gradle.properties 557B
gradle-wrapper.properties 230B
gradle.properties 74B
cache.properties 31B
dependency.store 5B
dependency.store 5B
dependency.store 5B
dependency.store 5B
dependency.store 5B
LICENSE.txt 11KB
proguard-rules.txt 670B
R.txt 543B
R.txt 220B
R.txt 220B
R.txt 220B
R.txt 220B
libraryList.txt 191B
workspace.xml 169KB
共 142 条
- 1
- 2
资源评论
- 阳光下的树影斑驳2015-08-14晕死,想要的是圆角图片,不是圆形图片……
- luke.lu2015-05-04资源挺不错的,可惜不是我想要的,同样感谢
- 京金牛2015-11-16资源不错,但不是我想要的
- 飞落拖鞋2016-03-25有参考价值
喝着可乐等爱啊
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功