当前位置: 首页>>代码示例>>Java>>正文


Java ImageView.setAnimation方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:abelabbesnabi,项目名称:cordova-plugin-image-picker,代码行数:23,代码来源:ImageFetcher.java

示例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);
}
 
开发者ID:teisun,项目名称:SunmiUI,代码行数:11,代码来源:LoadView.java

示例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();
}
 
开发者ID:Lingzh0ng,项目名称:BrotherWeather,代码行数:12,代码来源:CustomRefreshLayout.java

示例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();
}
 
开发者ID:Lingzh0ng,项目名称:BrotherWeather,代码行数:11,代码来源:CustomRefreshLayout2.java

示例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);
    }
}
 
开发者ID:woxingxiao,项目名称:GracefulMovies,代码行数:30,代码来源:MainActivity.java

示例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);
}
 
开发者ID:penghongru,项目名称:Coder,代码行数:17,代码来源:StateFragment.java

示例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);
}
 
开发者ID:penghongru,项目名称:Coder,代码行数:17,代码来源:StateActivity.java

示例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();
  }
 
开发者ID:Lingzh0ng,项目名称:ITSM,代码行数:12,代码来源:ReleaseStatusRecyclerViewAdapter.java

示例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();	
	}
});
}
 
开发者ID:Evan-Galvin,项目名称:FreeStreams-TVLauncher,代码行数:23,代码来源:EliminateMainActivity.java

示例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();

}
 
开发者ID:wp521,项目名称:MyFire,代码行数:45,代码来源:AndroidVsIosHeaderView.java


注:本文中的android.widget.ImageView.setAnimation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。