应用加载过程中的loading动画:
LoadingView .java
/**** loading 动画的实现
* @author
*
*/
public class LoadingView extends RelativeLayout {
private LayoutInflater mLayoutInflater;
private RelativeLayout mRLayout;
private ImageView mDot01Iv, mDot02Iv, mDot03Iv, mDot04Iv, mDot05Iv;
private Handler mHandler = null;
Context mContext;
public LoadingView(Context context) {
super(context);
mContext = context;
}
public LoadingView(Context context, AttributeSet attrs) {
super(context, attrs);
mContext = context;
mLayoutInflater = LayoutInflater.from(context);
mRLayout = (RelativeLayout) mLayoutInflater.inflate(
R.layout.view_loading,
LoadingView.this, true);
mDot01Iv = (ImageView) mRLayout
.findViewById(R.id.view_loading_first_iv);
mDot02Iv = (ImageView) mRLayout.findViewById(R.id.view_loading_sec_iv);
mDot03Iv = (ImageView) mRLayout
.findViewById(R.id.view_loading_third_iv);
mDot04Iv = (ImageView) mRLayout.findViewById(R.id.view_loading_four_iv);
mDot05Iv = (ImageView) mRLayout.findViewById(R.id.view_loading_five_iv);
}
/***
* 显示loading动画
*/
public void show() {
playAnimation();
}
/***
* 取消loading动画
*/
public void dismiss() {
Thread.interrupted();
}
// 不断发送消息,切换图片
private void playAn