本文整理匯總了Java中android.widget.ImageView.setAnimation方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageView.setAnimation方法的具體用法?Java ImageView.setAnimation怎麽用?Java ImageView.setAnimation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.ImageView
的用法示例。
在下文中一共展示了ImageView.setAnimation方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onPostExecute
import android.widget.ImageView; //導入方法依賴的package包/類
/**
* Once the image is downloaded, associates it to the imageView
*/
@Override
protected void onPostExecute(Bitmap bitmap) {
if (isCancelled()) {
bitmap = null;
}
addBitmapToCache(position, bitmap);
if (imageViewReference != null) {
ImageView imageView = imageViewReference.get();
BitmapFetcherTask bitmapDownloaderTask = getBitmapDownloaderTask(imageView);
if (this == bitmapDownloaderTask) {
imageView.setImageBitmap(bitmap);
Animation anim = AnimationUtils.loadAnimation(imageView.getContext(), android.R.anim.fade_in);
imageView.setAnimation(anim);
anim.start();
}
} else {
setInvisible();
}
}
示例2: init
import android.widget.ImageView; //導入方法依賴的package包/類
private void init(){
mView = getView();
mText = (TextView)mView.findViewById(R.id.txt);
img = (ImageView)mView.findViewById(R.id.img);
Animation operatingAnim = AnimationUtils.loadAnimation(getContext(), R.anim.loading_anim);
LinearInterpolator lin = new LinearInterpolator();
operatingAnim.setInterpolator(lin);
img.setAnimation(operatingAnim);
img.startAnimation(operatingAnim);
}
示例3: startLoadingAnimation
import android.widget.ImageView; //導入方法依賴的package包/類
private void startLoadingAnimation(ImageView imageView) {
RotateAnimation loadingAnimation =
new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
loadingAnimation.setDuration(1000);
loadingAnimation.setRepeatCount(-1);
loadingAnimation.setInterpolator(new LinearInterpolator());
loadingAnimation.setFillAfter(false);
imageView.setAnimation(loadingAnimation);
loadingAnimation.start();
}
示例4: startLoadingAnimation
import android.widget.ImageView; //導入方法依賴的package包/類
private void startLoadingAnimation(ImageView imageView) {
RotateAnimation loadingAnimation =
new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
loadingAnimation.setDuration(1000);
loadingAnimation.setRepeatCount(-1);
loadingAnimation.setInterpolator(new LinearInterpolator());
imageView.setAnimation(loadingAnimation);
loadingAnimation.start();
}
示例5: showStatusView
import android.widget.ImageView; //導入方法依賴的package包/類
private void showStatusView(boolean loading) {
if (mStatusView == null) {
mStatusView = ((ViewStub) findViewById(R.id.view_stub)).inflate();
mStatusLoadingImg = (ImageView) mStatusView.findViewById(R.id.status_loading_img);
mStatusReloadBtn = (Button) mStatusView.findViewById(R.id.status_reload_button);
mStatusNoDataImg = (ImageView) mStatusView.findViewById(R.id.status_no_data_img);
mStatusReloadBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showStatusView(true);
getPresenter().loadMovieData();
}
});
}
if (loading) {
Animation animation = AnimationUtils.loadAnimation(this, R.anim.anim_rotate);
animation.setInterpolator(new LinearInterpolator());
mStatusLoadingImg.setAnimation(animation);
mStatusLoadingImg.setVisibility(View.VISIBLE);
mStatusReloadBtn.setVisibility(View.INVISIBLE);
mStatusNoDataImg.setVisibility(View.INVISIBLE);
} else {
mStatusLoadingImg.clearAnimation();
mStatusLoadingImg.setVisibility(View.INVISIBLE);
mStatusReloadBtn.setVisibility(View.VISIBLE);
mStatusNoDataImg.setVisibility(View.VISIBLE);
}
}
示例6: onLoadingState
import android.widget.ImageView; //導入方法依賴的package包/類
/**
* 加載中
*/
@DoMain
public void onLoadingState() {
FrameLayout contains = (FrameLayout) rootView.findViewById(R.id.state_contains);
contains.removeAllViews();
View loading = View.inflate(this.getContext(), R.layout.view_loading, null);
contains.addView(loading);
ImageView loading_img = (ImageView) loading.findViewById(R.id.loading_icon);
RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setDuration(500);
rotateAnimation.setRepeatMode(RotateAnimation.RESTART);
rotateAnimation.setRepeatCount(-1);
loading_img.setAnimation(rotateAnimation);
}
示例7: onLoadingState
import android.widget.ImageView; //導入方法依賴的package包/類
/**
* 加載中
*/
@DoMain
public void onLoadingState() {
FrameLayout contains = (FrameLayout) findViewById(R.id.state_contains);
contains.removeAllViews();
View loading = View.inflate(this, R.layout.view_loading, null);
contains.addView(loading);
ImageView loading_img = (ImageView) loading.findViewById(R.id.loading_icon);
RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setDuration(500);
rotateAnimation.setRepeatMode(RotateAnimation.RESTART);
rotateAnimation.setRepeatCount(-1);
loading_img.setAnimation(rotateAnimation);
}
示例8: startLoadingAnimation
import android.widget.ImageView; //導入方法依賴的package包/類
private void startLoadingAnimation(ImageView imageView) {
RotateAnimation loadingAnimation =
new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
loadingAnimation.setDuration(1000);
loadingAnimation.setRepeatCount(-1);
loadingAnimation.setInterpolator(new LinearInterpolator());
imageView.setAnimation(loadingAnimation);
loadingAnimation.start();
}
示例9: Init
import android.widget.ImageView; //導入方法依賴的package包/類
public void Init() {
GetSurplusMemory();
Round_img=(ImageView)findViewById(R.id.eliminate_roundimg);
Start_kill=(Button)findViewById(R.id.start_killtask);
release_memory=(TextView)findViewById(R.id.relase_memory);
increase_speed=(TextView)findViewById(R.id.increase_speed);
Allpercent=(TextView)findViewById(R.id.all_percent);
clear_endlayout=(LinearLayout)findViewById(R.id.clear_endlayout);
Clearing_layout=(RelativeLayout)findViewById(R.id.clearing_layout);
Animation animation=AnimationUtils.loadAnimation(EliminateMainActivity.this, R.anim.eliminatedialog_anmiation);
TotalMemory=GetTotalMemory();
Round_img.setAnimation(animation);
Start_kill.setClickable(false);
Start_kill.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
finish();
}
});
}
示例10: AndroidVsIosHeaderView
import android.widget.ImageView; //導入方法依賴的package包/類
public AndroidVsIosHeaderView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
inflate(context, R.layout.layout_irecyclerview_bat_vs_supper_refresh_header_view, this);
ivBatMan = (ImageView) findViewById(R.id.ivBatMan);
ivSuperMan = (ImageView) findViewById(R.id.ivSuperMan);
ivVs = (ImageView) findViewById(R.id.imageView);
PropertyValuesHolder translationX1 = PropertyValuesHolder.ofFloat("translationX",0.0f,100.0f,0.0f);
PropertyValuesHolder rotate = PropertyValuesHolder.ofFloat("rotationY",0.0f,380.0f,0.0f);
PropertyValuesHolder translationX2 = PropertyValuesHolder.ofFloat("translationX",0.0f,-100.0f,0.0f);
ObjectAnimator objectAnimator1 = ObjectAnimator.ofPropertyValuesHolder(ivBatMan, translationX1);
objectAnimator1.setRepeatCount(ValueAnimator.INFINITE);
objectAnimator1.setRepeatMode(ValueAnimator.INFINITE);
ObjectAnimator objectAnimator2 = ObjectAnimator.ofPropertyValuesHolder(ivSuperMan,translationX2);
objectAnimator2.setRepeatCount(ValueAnimator.INFINITE);
objectAnimator2.setRepeatMode(ValueAnimator.INFINITE);
ObjectAnimator objectAnimator3 = ObjectAnimator.ofPropertyValuesHolder(ivVs, rotate);
objectAnimator3.setRepeatCount(ValueAnimator.INFINITE);
objectAnimator3.setRepeatMode(ValueAnimator.INFINITE);
Animation animation =new RotateAnimation(0f,360f, Animation.RELATIVE_TO_SELF,
0.5f,Animation.RELATIVE_TO_SELF,0.5f);
Animation animation1 =new RotateAnimation(0f,-360f, Animation.RELATIVE_TO_SELF,
0.5f,Animation.RELATIVE_TO_SELF,0.5f);
animation.setFillAfter(true);
animation.setDuration(2000);
animation.setRepeatCount(ValueAnimator.INFINITE);
animation.setRepeatMode(ValueAnimator.INFINITE);
animation1.setFillAfter(true);
animation1.setDuration(2000);
animation1.setRepeatCount(ValueAnimator.INFINITE);
animation1.setRepeatMode(ValueAnimator.INFINITE);
ivBatMan.setAnimation(animation);
ivSuperMan.setAnimation(animation1);
btnSexAnimatorSet = new AnimatorSet();
btnSexAnimatorSet.playTogether(objectAnimator1, objectAnimator2,objectAnimator3);
btnSexAnimatorSet.setDuration(2000);
btnSexAnimatorSet.start();
}