https://github.com/anoop44/avtarview
Easy to use highly customizable View for showing Avtars for names and contacts
https://github.com/anoop44/avtarview
android custom-view kotlin-android library
Last synced: about 1 year ago
JSON representation
Easy to use highly customizable View for showing Avtars for names and contacts
- Host: GitHub
- URL: https://github.com/anoop44/avtarview
- Owner: anoop44
- Created: 2018-05-12T18:24:46.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-19T15:48:27.000Z (about 8 years ago)
- Last Synced: 2025-04-04T00:51:12.858Z (about 1 year ago)
- Topics: android, custom-view, kotlin-android, library
- Language: Kotlin
- Homepage:
- Size: 498 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AvtarView
[](https://jitpack.io/#anoop44/AvtarView) []()
Easy to use highly customizable View for showing Avtars for names and contacts
AvtarView is built on top of ImageView, so incase if you want to show images for some items in a list and Avtar for others, no need to have two views. With the AvtarView you can show images as well as Avtar.

## Adding in your project
Add to your root build.gradle:
```Groovy
allprojects {
repositories {
// ...
maven { url "https://jitpack.io" }
}
}
```
Add the dependency:
```Groovy
dependencies {
compile 'com.github.anoop44:AvtarView:1.0.3'
}
```
## Usage
### AvtarView
```xml
```
`AvtarView` can be modified at runtime also, setter methods are available for all the attributes
```java
avtarView.setText(text);
avtarView.setTextColor(Color.WHITE);
avtarView.setStrokeWidth(2);
avtarView.setStrokeColor(Color.WHITE);
avtarView.setUseSingleLetter(false);
```
### Image
If you want to show image instead of avtars, use it as an `ImageView`. `android:src` in XML and `avtarView.setImageResource` works as normal. When you set an image resource or drawable, properties otherthan `strokeWidth` and `strokeColor` will be ignored
## Contribution
I know there is lot of room for improvement in terms of feature and the code. so feel free to suggest your ideas about it in the issues,
or, if you found a bug and you have some free time to fix it, writing a few lines of code in __Kotlin__,
feel free to send me PRs.
## License
MIT License
Copyright (c) 2016 Alexey Derbyshev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, 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 IN THE
SOFTWARE.