国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

開源項(xiàng)目Meizhi學(xué)習(xí)筆記--VideoImageView

2019-11-09 18:12:09
字體:
供稿:網(wǎng)友

VideoImageView

黑發(fā)不知勤學(xué)早,看看又是白頭翁

VideoImageView用于顯示視頻的預(yù)覽圖,但是在Meizhi項(xiàng)目中并未觸發(fā)效果。我單獨(dú)把它弄成一個(gè)項(xiàng)目,以下是效果圖。

這里寫圖片描述 布局代碼

<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_video_image_view" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="rc.loveq.customdialog.VideoImageViewActivity"> <rc.loveq.customdialog.VideoImageView android:id="@+id/video_image" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#2d1e1b" android:scaleType="centerCrop"/> /></RelativeLayout>

VideoImageViewActivity

@Override PRotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_video_image_view); mVideoImage = (VideoImageView) findViewById(R.id.video_image); mVideoImage.setImageResource(R.mipmap.ic_launcher); }

VideoImageView

public class VideoImageView extends ImageView implements Animator.AnimatorListener { private boolean scale = false; public VideoImageView(Context context) { this(context, null); } public VideoImageView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public VideoImageView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); nextAnimation(); } private void nextAnimation() { AnimatorSet anim = new AnimatorSet(); if (scale) { anim.playTogether(ObjectAnimator.ofFloat(this, "scaleX", 1.5f, 1f), ObjectAnimator.ofFloat(this, "scaleY", 1.5f, 1f)); } else { anim.playTogether(ObjectAnimator.ofFloat(this, "scaleX", 1, 1.5f), ObjectAnimator.ofFloat(this, "scaleY", 1, 1.5f)); } anim.setDuration(10987); anim.addListener(this); anim.start(); scale = !scale; } @Override public void onAnimationCancel(Animator arg0) { } @Override public void onAnimationEnd(Animator animator) { nextAnimation(); } @Override public void onAnimationRepeat(Animator arg0) { } @Override public void onAnimationStart(Animator arg0) { }}

Android屬性動(dòng)畫完全解析(上),初識(shí)屬性動(dòng)畫的基本用法 Android屬性動(dòng)畫完全解析(中),ValueAnimator和ObjectAnimator的高級(jí)用法 Android屬性動(dòng)畫完全解析(下),Interpolator和ViewPropertyAnimator的用法


上一篇:js交互

下一篇:Cookie

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 天津市| 兴安县| 龙口市| 海阳市| 顺义区| 波密县| 吴忠市| 阜南县| 昭平县| 白银市| 兰考县| 新野县| 江永县| 繁昌县| 宁都县| 金乡县| 德兴市| 隆化县| 资溪县| 长治县| 拉萨市| 建湖县| 车险| 巴林左旗| 武山县| 定兴县| 和林格尔县| 延庆县| 陵水| 格尔木市| 托克逊县| 新龙县| 宜良县| 阿拉善左旗| 博罗县| 铅山县| 平顶山市| 杭锦后旗| 白朗县| 治多县| 抚顺市|