CircularImageView
来源:互联网 发布:vscode 代码提示 编辑:程序博客网 时间:2024/06/05 15:52
CircularImageView
Custom view for circular images in Android while maintaining the best draw performance
Usage
To make a circular ImageView, add this CircularImageView library to your project and add CircularImageView in your layout XML. You can also grab it via Gradle:
compile 'com.pkmmte.view:circularimageview:1.1'
or Maven:
<dependency> <groupId>com.pkmmte.view</groupId> <artifactId>circularimageview</artifactId> <version>1.1</version></dependency>
XML
<com.pkmmte.view.CircularImageView android:layout_width="250dp" android:layout_height="250dp" android:src="@drawable/image" app:border="true" app:border_color="#EEEEEE" app:border_width="4dp" app:shadow="true" />
You may use the following properties in your XML to customize your CircularImageView.
Properties:
app:border
(boolean) -> default falseapp:border_color
(color) -> default WHITEapp:border_width
(dimension) -> default 2dpapp:selector
(boolean) -> default falseapp:selector_color
(color) -> default TRANSPARENTapp:selector_stroke_color
(color) -> default BLUEapp:selector_stroke_width
(dimension) -> default 2dpapp:shadow
(boolean) -> default false
JAVA
CircularImageView circularImageView = (CircularImageView)findViewById(R.id.yourCircularImageView); circularImageView.setBorderColor(getResources().getColor(R.color.GrayLight)); circularImageView.setBorderWidth(10); circularImageView.setSelectorColor(getResources().getColor(R.color.BlueLightTransparent)); circularImageView.setSelectorStrokeColor(getResources().getColor(R.color.BlueDark)); circularImageView.setSelectorStrokeWidth(10); circularImageView.addShadow();
Developed By
Pkmmte Xeleon - www.pkmmte.com
License
The MIT License (MIT)Copyright (c) 2014 Pkmmte XeleonPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.
Based on a work at https://github.com/lopspower/CircularImageView.
0 0
- CircularImageView
- CircularImageView 一 自定义圆形图片组件。
- Android开源项目——自定义圆形图片组件CircularImageView
- 实现无边框可拖动调整大小的阴影窗口
- 集合Collection之List
- qq通信过程分析
- TF-IDF算法-Python实现(附源代码)
- CH负责内容的两个人——北漂18年(66)
- CircularImageView
- 《加密与解密》学习笔记(三) - 脱壳
- 编码练习——Java-5-接口、继承与多态
- HDU1756--判断点与多边形的相对位置
- {算法}论蒟蒻如何掌握ExGcd
- 数据结构上机测试2-1:单链表操作A
- 数据结构上机测试2-2:单链表操作B
- POJ Gold Balanced Lineup 3274 哈希
- LeetCode[377] Combination Sum IV