資源簡介
仿微信搶紅包dialog和動畫 代碼簡潔 使用起來特別方便

代碼片段和文件信息
package?comm.example.app;
import?android.widget.ImageView;
public?class?frameAnimation?{
????private?boolean?mIsRepeat;
????private?AnimationListener?mAnimationListener;
????private?ImageView?mImageView;
????private?int[]?mframeRess;
????/**
?????*?每幀動畫的播放間隔數組
?????*/
????private?int[]?mDurations;
????/**
?????*?每幀動畫的播放間隔
?????*/
????private?int?mDuration;
????/**
?????*?下一遍動畫播放的延遲時間
?????*/
????private?int?mDelay;
????private?int?mLastframe;
????private?boolean?mNext;
????private?boolean?mPause;
????private?int?mCurrentSelect;
????private?int?mCurrentframe;
????private?static?final?int?SELECTED_A?=?1;
????private?static?final?int?SELECTED_B?=?2;
????private?static?final?int?SELECTED_C?=?3;
????private?static?final?int?SELECTED_D?=?4;
????/**
?????*?@param?iv???????播放動畫的控件
?????*?@param?frameRes?播放的圖片數組
?????*?@param?duration?每幀動畫的播放間隔(毫秒)
?????*?@param?isRepeat?是否循環播放
?????*/
????public?frameAnimation(ImageView?iv?int[]?frameRes?int?duration?boolean?isRepeat)?{
????????this.mImageView?=?iv;
????????this.mframeRess?=?frameRes;
????????this.mDuration?=?duration;
????????this.mLastframe?=?frameRes.length?-?1;
????????this.mIsRepeat?=?isRepeat;
????????play(0);
????}
????/**
?????*?@param?iv????????播放動畫的控件
?????*?@param?frameRess?播放的圖片數組
?????*?@param?durations?每幀動畫的播放間隔(毫秒)
?????*?@param?isRepeat??是否循環播放
?????*/
????public?frameAnimation(ImageView?iv?int[]?frameRess?int[]?durations?boolean?isRepeat)?{
????????this.mImageView?=?iv;
????????this.mframeRess?=?frameRess;
????????this.mDurations?=?durations;
????????this.mLastframe?=?frameRess.length?-?1;
????????this.mIsRepeat?=?isRepeat;
????????playByDurations(0);
????}
????/**
?????*?循環播放動畫
?????*
?????*?@param?iv????????播放動畫的控件
?????*?@param?frameRess?播放的圖片數組
?????*?@param?duration??每幀動畫的播放間隔(毫秒)
?????*?@param?delay?????循環播放的時間間隔
?????*/
????public?frameAnimation(ImageView?iv?int[]?frameRess?int?duration?int?delay)?{
????????this.mImageView?=?iv;
????????this.mframeRess?=?frameRess;
????????this.mDuration?=?duration;
????????this.mDelay?=?delay;
????????this.mLastframe?=?frameRess.length?-?1;
????????playAndDelay(0);
????}
????/**
?????*?循環播放動畫
?????*
?????*?@param?iv????????播放動畫的控件
?????*?@param?frameRess?播放的圖片數組
?????*?@param?durations?每幀動畫的播放間隔(毫秒)
?????*?@param?delay?????循環播放的時間間隔
?????*/
????public?frameAnimation(ImageView?iv?int[]?frameRess?int[]?durations?int?delay)?{
????????this.mImageView?=?iv;
????????this.mframeRess?=?frameRess;
????????this.mDurations?=?durations;
????????this.mDelay?=?delay;
????????this.mLastframe?=?frameRess.length?-?1;
????????playByDurationsAndDelay(0);
????}
????private?void?playByDurationsAndDelay(final?int?i)?{
????????mImageView.postDelayed(new?Runnable()?{
????????????@Override
????????????public?void?run()?{
????????????????if?(mPause)?{???//?暫停和播放需求
????????????????????mCurrentSelect?=?SELECTED_A;
????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-02-26?15:09??RedPacket\
?????文件?????????147??2019-02-26?14:43??RedPacket\.gitignore
?????目錄???????????0??2019-02-26?14:44??RedPacket\.gradle\
?????目錄???????????0??2019-02-26?14:56??RedPacket\.gradle\4.4\
?????目錄???????????0??2019-02-26?14:43??RedPacket\.gradle\4.4\fileChanges\
?????文件???????????1??2019-02-26?15:05??RedPacket\.gradle\4.4\fileChanges\last-build.bin
?????目錄???????????0??2019-02-26?14:55??RedPacket\.gradle\4.4\fileContent\
?????文件??????????17??2019-02-26?15:05??RedPacket\.gradle\4.4\fileContent\fileContent.lock
?????目錄???????????0??2019-02-26?14:56??RedPacket\.gradle\4.4\fileHashes\
?????文件??????229819??2019-02-26?15:05??RedPacket\.gradle\4.4\fileHashes\fileHashes.bin
?????文件??????????17??2019-02-26?15:05??RedPacket\.gradle\4.4\fileHashes\fileHashes.lock
?????文件???????21489??2019-02-26?14:56??RedPacket\.gradle\4.4\fileHashes\resourceHashesCache.bin
?????目錄???????????0??2019-02-26?14:56??RedPacket\.gradle\4.4\javaCompile\
?????文件??????828689??2019-02-26?14:56??RedPacket\.gradle\4.4\javaCompile\classAnalysis.bin
?????文件??????368206??2019-02-26?14:56??RedPacket\.gradle\4.4\javaCompile\jarAnalysis.bin
?????文件??????????17??2019-02-26?14:56??RedPacket\.gradle\4.4\javaCompile\javaCompile.lock
?????文件???????85231??2019-02-26?14:56??RedPacket\.gradle\4.4\javaCompile\taskHistory.bin
?????文件???????24027??2019-02-26?14:56??RedPacket\.gradle\4.4\javaCompile\taskJars.bin
?????目錄???????????0??2019-02-26?14:44??RedPacket\.gradle\4.4\taskHistory\
?????文件??????941965??2019-02-26?15:05??RedPacket\.gradle\4.4\taskHistory\taskHistory.bin
?????文件??????????17??2019-02-26?15:05??RedPacket\.gradle\4.4\taskHistory\taskHistory.lock
?????目錄???????????0??2019-02-26?14:44??RedPacket\.gradle\buildOutputCleanup\
?????文件??????????17??2019-02-26?15:05??RedPacket\.gradle\buildOutputCleanup\buildOutputCleanup.lock
?????文件??????????51??2019-02-26?14:44??RedPacket\.gradle\buildOutputCleanup\cache.properties
?????文件???????20405??2019-02-26?15:05??RedPacket\.gradle\buildOutputCleanup\outputFiles.bin
?????目錄???????????0??2019-02-26?15:05??RedPacket\.idea\
?????目錄???????????0??2019-02-26?14:44??RedPacket\.idea\caches\
?????文件?????????537??2019-02-26?14:46??RedPacket\.idea\caches\build_file_checksums.ser
?????目錄???????????0??2019-02-26?14:43??RedPacket\.idea\codest
?????文件????????1803??2019-02-26?14:43??RedPacket\.idea\codest
?????文件?????????626??2019-02-26?14:43??RedPacket\.idea\gradle.xm
............此處省略136個文件信息
評論
共有 條評論