Android实现创意实现创意LoadingView动画效果动画效果
Android上的热火锅煮萝卜蔬菜的Loading动画效果。 这是一个锅煮萝卜的Loading动画,效果仿照自之前IOS上看到的一个效
果,觉得挺有意思,就移植过来了,在此完成了Dialog的样式,方便使用者作为LoadingView去使用。
关键性代码:
package yellow5a5.demo.boilingloadingview.View;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.drawable.ClipDrawable;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import java.util.Timer;
import java.util.TimerTask;
import yellow5a5.demo.boilingloadingview.R;
/**
* Created by Weiwu on 16/1/2.
*/
public class BoilingPanView extends RelativeLayout {
private View mView;
private ClipDrawable mWaterDrawable;
private WaterView mWaterView;
private FlameView mFlameView;
private View mPea1;
private View mPea2;
private ImageView mPotato;
private ImageView mCarrot;
private ImageView mCoverView;
private Animation mLeftInAnim;
private Animation mRightInAnim;
private boolean isRightRotate = true;
private ValueAnimator mCoverAnim;
private BoilingAnimListener mBoilingAnimListener;
public interface BoilingAnimListener {
//初始动画结束监听
void onFirstAnimEnd();
}
public void setBoilingAnimListener(BoilingAnimListener l) {
this.mBoilingAnimListener = l;
}
private Handler mHandle = new Handler(new Handler.Callback() {
@Override
public boolean handleMessage(Message msg) {
if (msg.what == 0X0000) {
mWaterDrawable.setLevel(mWaterDrawable.getLevel() + 800);
}
评论0
最新资源