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 {
...
implementation 'de.hdodenhof:circleimageview:2.2.0'
}
```
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:civ_border_width="2dp"
app:civ_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 an image loading library like Picasso or Glide, you need to disable their fade animations to avoid messed up images. For Picasso use the `noFade()` option, for Glide use `dontAnimate()`. If you want to keep the fadeIn animation, you have to fetch the image into a `Target` and apply a custom animation yourself when receiving the `Bitmap`.
* Using a `TransitionDrawable` with `CircleImageView` doesn't work properly and leads to messed up images.
FAQ
---
**How can I use a `VectorDrawable` with `CircleImageView`?**
Short answer: you shouldn't. Using a `VectorDrawable` with `CircleImageView` is very inefficient. You should modify your vectors to be in a circular shape and use them with a regular ImageView instead.
**Why doesn't `CircleImageView` extend `AppCompatImageView`?**
Extending `AppCompatImageView` would require adding a runtime dependency for the support library without any real benefit.
**How can I add a selector (e.g. ripple effect) bound to a circle?**
There's currently no direct support for a circle bound selector but you can follow [these steps](https://github.com/hdodenhof/CircleImageView/issues/153#issuecomment-249692049) to implement it yourself.
**How can I add a gap between image and border?**
Adding a gap is also not support directly but [there's a workaround](https://github.com/hdodenhof/CircleImageView/issues/133#issuecomment-225437930).
Changelog
---------
* **next**
* Limit touch event handling to circle area
* **2.2.0**
* Add support for elevation
* Add circle background color attribute to replace fill color
* **2.1.0**
* Add support for padding
* Add option to disable circular transformation
* Fix hairline gap being drawn between image and border under some conditions
* Fix NPE when using tint attribute (which is not supported)
* Deprecate fill color as it seems to cause quite some confusion
* **2.0.0**
* BREAKING: Custom xml attributes are now prefixed with "civ_"
* Graceful handling of incompatible drawables
* Add support for a fill color shown behind images with transparent areas
* Fix dimension calculation issues with small images
* Fix bitmap not being cleared when set to null
* **1.3.0**
* Add setBorderColorResource(int resId)
* Add resource type annotations
* Add border_overlay attribute to allow drawing border on top of the base image
* **1.2.2**
* Add ColorFilter support
* **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 - 2018 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.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于安卓平台的运动app项目源码+全部数据(高分项目).zip本资源中的源码都是经过本地编译过可运行的,评审分达到95分以上。资源项目的难度比较适中,内容都是经过助教老师审定过的能够满足学习、使用需求,如果有需要的话可以放心下载使用。 基于安卓平台的运动app项目源码+全部数据(高分项目).zip本资源中的源码都是经过本地编译过可运行的,评审分达到95分以上。资源项目的难度比较适中,内容都是经过助教老师审定过的能够满足学习、使用需求,如果有需要的话可以放心下载使用。 基于安卓平台的运动app项目源码+全部数据(高分项目).zip本资源中的源码都是经过本地编译过可运行的,评审分达到95分以上。资源项目的难度比较适中,内容都是经过助教老师审定过的能够满足学习、使用需求,如果有需要的话可以放心下载使用。 基于安卓平台的运动app项目源码+全部数据(高分项目).zip本资源中的源码都是经过本地编译过可运行的,评审分达到95分以上。资源项目的难度比较适中,内容都是经过助教老师审定过的能够满足学习、使用需求,如果有需要的话可以放心下载使用。 基于安卓平台的运动app项目源码+全部数据(高分
资源推荐
资源详情
资源评论
收起资源包目录
基于安卓平台的运动app项目源码+全部数据(高分项目).zip (718个子文件)
._BmobSDKDemo_v3.6.6 226B
._acl 226B
._androidTest 226B
._app 226B
._arm64-v8a 226B
._armeabi 226B
._armeabi-v7a 226B
._autoupdate 226B
._bean 226B
._bmob 226B
._bmob 226B
._bmob 226B
._cn 226B
._cn 226B
._cn 226B
._crud 226B
._drawable 226B
._drawable 226B
._drawable-hdpi 226B
._drawable-hdpi 226B
._file 226B
._gradle 226B
._gradlew 226B
._java 226B
._java 226B
._java 226B
._layout 226B
._layout 226B
._libs 226B
._libs 226B
._location 226B
._main 226B
._menu 226B
._mipmap-hdpi 226B
._mipmap-mdpi 226B
._mipmap-xhdpi 226B
._mipmap-xxhdpi 226B
._mipmap-xxxhdpi 226B
._mips 226B
._mips64 226B
._NewDataSDKDemo 226B
._permission 226B
._relation 226B
._res 226B
._res 226B
._sdkdemo 226B
._sdkdemo 226B
._sdkdemo 226B
._sms 226B
._src 226B
._test 226B
._user 226B
._values 226B
._values 226B
._values-v21 226B
._values-w820dp 226B
._wrapper 226B
._x86 226B
._x86_64 226B
._xml 226B
gradlew.bat 2KB
gradlew.bat 2KB
gradlew.bat 2KB
._gradlew.bat 226B
._.DS_Store 226B
._.DS_Store 226B
._.DS_Store 226B
._.DS_Store 226B
._.DS_Store 226B
._.DS_Store 226B
._.DS_Store 226B
._.DS_Store 226B
._.DS_Store 226B
._.DS_Store 226B
._.DS_Store 226B
.gitattributes 66B
._.gitignore 226B
._.gitignore 226B
.gitignore 137B
.gitignore 134B
.gitignore 97B
.gitignore 7B
.gitignore 7B
build.gradle 2KB
build.gradle 1KB
build.gradle 1KB
build.gradle 873B
build.gradle 360B
build.gradle 281B
build.gradle 252B
._settings.gradle 226B
._build.gradle 226B
settings.gradle 37B
settings.gradle 16B
settings.gradle 15B
gradlew 5KB
gradlew 5KB
gradlew 5KB
rxjava-1.1.6.jar 1MB
BmobSDK_3.6.6_20180914.jar 506KB
共 718 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
盈梓的博客
- 粉丝: 7040
- 资源: 1616
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 适用于tensorflow-2.11.0 CUDA版本11.2的cuDNN8.1版本
- 5Y study学习平台2016计算机基础-综合测试(8)_哔哩哔哩_bilibili_2580252704.mp4
- (大赛作品)STM32实现的F072RB NUCLEO智能家居控制.zip
- STM32实现的数字示波器源码+数字信号处理教程、配套实例.zip
- 【cookie续续】【cookie续续】【cookie续续】
- 低功耗STM32实现的F411开发板(原理图+PCB源文件+官方例程+驱动等).zip
- 基于stm32实现的 nucleo-L476的智能灯(操作说明+源码).zip
- 基于STM32实现的 NUCLEO板设计彩色LED照明灯(纯cubeMX开发).zip
- 基于STM32实现的 的联合调试侦听设备解决方案(原理图、PCB源文件、调试工具、视频).zip
- 基于STM32实现的 人群定位、调速智能风扇设计(程序、设计报告、视频演示).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功