仿抖音用户直播在线头像动画
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.VolleyCN:AnimImageView:Tag'
}
<com.volleycn.animimageview.AnimationImageView
android:id="@+id/AnimationImageView"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="bottom|right"
android:layout_margin="20dp"
app:aiv_anim_circle_src="@drawable/shape_bg_ded9fb_round"
app:aiv_circle_src="@drawable/shape_bg_bdb3f8_round"
app:aiv_image_src="@mipmap/icon10" />
AnimationImageView imageView = findViewById(R.id.AnimationImageView);
Glide.with(imageView.getContext())
.load(R.mipmap.icon10)
.optionalTransform(new RoundedCorners(SizeUtils.dp2px(4)))
.placeholder(R.drawable.avatar_default)
.into(imageView.getImageView());