android的颜色渐变动画效果图,AvatarView 一个圆形图像视图,支持进度动画、带边框和渐变颜色的高亮状态...

AvatarView

A circular Image View with a lot of perks. Including progress animation and highlight state with borders and gradient color.

68747470733a2f2f7472617669732d63692e636f6d2f7669746f726875676f64732f417661746172566965772e7376673f6272616e63683d6d617374657268747470733a2f2f696d672e736869656c64732e696f2f62616467652f56657273696f6e2d312e302e302d627269676874677265656e2e73766768747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f653438343764376633363735346331613865666231616666383338666462393168747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d696e53646b56657273696f6e2d31342d627269676874677265656e2e73766768747470733a2f2f696d672e736869656c64732e696f2f62616467652f4b6f746c696e2d3130302532352d6f72616e67652e73766768747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4170616368652532304c6963656e7365253230322e302d626c75652e7376673f7374796c653d666c617468747470733a2f2f696d672e736869656c64732e696f2f62616467652f5361792532305468616e6b732d212d3145414544422e737667

Built with ❤︎ by Vitor Hugo Schwaab and contributors

Samples

ex1.png

ex2.png

sample1.gif

sample2.gif

Supports initials if no image is provided:

initials.png

Thanks to @anoop44

Demo

Watch the video or clone the repo and build the demo app

Importing to Gradle

Add this to your module's build.gradle file

repositories {

maven { url "https://dl.bintray.com/vitorhugods/AvatarView" }

}

dependencies {

implementation "xyz.schwaab:avvylib:1.0.0"

}

Usage

Just add this to your XML:

android:layout_width="128dp"

android:layout_height="128dp"

app:avvy_border_color="@color/grey400"

app:avvy_border_highlight_color="#ff5900"

app:avvy_border_highlight_color_end="#bf15bc"

app:avvy_border_thickness="2dp"

app:avvy_border_thickness_highlight="3dp"

app:avvy_distance_to_border="5dp"

app:avvy_highlighted="true"

app:avvy_loading_arches="5"

app:avvy_loading_arches_degree_area="90"/>

Add the name initials as fallback:

app:avvy_text="Avatar View" //will show up as AV

app:avvy_text_size="42sp"

app:avvy_text_color="#ccc"

You can personalize it in Kotlin:

avatarView.apply {

isAnimating = false

borderThickness = 18

highlightBorderColor = Color.GREEN

highlightBorderColorEnd = Color.CYAN

numberOfArches = 0

totalArchesDegreeArea = 80

text = "Avatar View"

}

Or, in Java:

avatarView.setAnimating(false);

avatarView.setBorderThickness(18);

avatarView.setHighlightBorderColor(Color.GREEN);

avatarView.setHighlightBorderColorEnd(Color.CYAN);

avatarView.setNumberOfArches(0);

avatarView.setTotalArchesDegreeArea(80);

Special Thanks

The roundness of the drawables based on Henning Dodenhof's Circle ImageView

Libraries used in the demo app:

License

Copyright 2020 Vitor Hugo D. Schwaab

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值