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


Java ImageView.startAnimation方法代码示例

本文整理汇总了Java中android.widget.ImageView.startAnimation方法的典型用法代码示例。如果您正苦于以下问题:Java ImageView.startAnimation方法的具体用法?Java ImageView.startAnimation怎么用?Java ImageView.startAnimation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.ImageView的用法示例。


在下文中一共展示了ImageView.startAnimation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ScanManager

import android.widget.ImageView; //导入方法依赖的package包/类
/**
 * 用于启动照相机扫描二维码,在activity的onCreate里面构造出来
 * 在activity的生命周期中调用此类相对应的生命周期方法
 *
 * @param activity      扫描的activity
 * @param scanPreview   预览的SurfaceView
 * @param scanContainer 扫描的布局,全屏布局
 * @param scanCropView  扫描的矩形区域
 * @param scanLine      扫描线
 */
public ScanManager(Activity activity, SurfaceView scanPreview, View scanContainer,
                   View scanCropView, ImageView scanLine, int scanMode, ScanListener listener) {
    this.activity = activity;
    this.scanPreview = scanPreview;
    this.scanContainer = scanContainer;
    this.scanCropView = scanCropView;
    this.scanLine = scanLine;
    this.listener = listener;
    this.scanMode = scanMode;
    //启动动画
    TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT,
            0.9f);
    animation.setDuration(4500);
    animation.setRepeatCount(-1);
    animation.setRepeatMode(Animation.RESTART);
    scanLine.startAnimation(animation);

}
 
开发者ID:StickyTolt,项目名称:ForeverLibrary,代码行数:29,代码来源:ScanManager.java

示例2: ScanManager

import android.widget.ImageView; //导入方法依赖的package包/类
/**
 * 用于启动照相机扫描二维码,在activity的onCreate里面构造出来
 * 在activity的生命周期中调用此类相对应的生命周期方法
 * @param activity   扫描的activity
 * @param scanPreview  预览的SurfaceView
 * @param scanContainer  扫描的布局,全屏布局
 * @param scanCropView  扫描的矩形区域
 * @param scanLine  扫描线
 * 
 * 
 */
public ScanManager(Activity activity, SurfaceView scanPreview, View scanContainer,
                      View scanCropView, ImageView scanLine, int scanMode, ScanListener listener) {
	this.activity=activity;
	this.scanPreview=scanPreview;
	this.scanContainer=scanContainer;
	this.scanCropView=scanCropView;
	this.scanLine=scanLine;
	this.listener=listener;
	this.scanMode=scanMode;
	//启动动画
	TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT,
			0.9f);
	animation.setDuration(4500);
	animation.setRepeatCount(-1);
	animation.setRepeatMode(Animation.RESTART);
	scanLine.startAnimation(animation);
	
}
 
开发者ID:AnyRTC,项目名称:anyRTC-RTCP-Android,代码行数:30,代码来源:ScanManager.java

示例3: onWindowFocusChanged

import android.widget.ImageView; //导入方法依赖的package包/类
/**
	 * 当窗口焦点改变时调用
	 */
	public void onWindowFocusChanged(boolean hasFocus) {
		 imageView = (ImageView) findViewById(R.id.spinnerImageView);
		//此方法是用xml文件方式来实现动画效果
		 animation = AnimationUtils.loadAnimation(getContext(), R.anim.spinner);
	        //动画完成后,是否保留动画最后的状态,设为true
	      animation.setFillAfter(true);
	      if(animation!=null)
	      {
	    	  imageView.startAnimation(animation);
	      }
		// 获取ImageView上的动画背景(此方法是用一组图片来达到动画效果)
//		AnimationDrawable spinner = (AnimationDrawable) imageView.getBackground();
//		// 开始动画
//		spinner.start();
	}
 
开发者ID:dufangyu1990,项目名称:LeCatApp,代码行数:19,代码来源:CustomLoadDialog.java

示例4: onCreate

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    Window window = getWindow();
    window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    setContentView(R.layout.activity_capture);

    scanPreview = (SurfaceView) findViewById(R.id.capture_preview);
    scanContainer = (RelativeLayout) findViewById(R.id.capture_container);
    scanCropView = (RelativeLayout) findViewById(R.id.capture_crop_view);
    scanLine = (ImageView) findViewById(R.id.capture_scan_line);

    inactivityTimer = new InactivityTimer(this);
    beepManager = new BeepManager(this);

    TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f, Animation
            .RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT,
            0.9f);
    animation.setDuration(4500);
    animation.setRepeatCount(-1);
    animation.setRepeatMode(Animation.RESTART);
    scanLine.startAnimation(animation);
}
 
开发者ID:Hultron,项目名称:LifeHelper,代码行数:25,代码来源:CaptureActivity.java

示例5: onCreate

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    MedalAnimation medalAnimation_tv = new MedalAnimation.Builder()
            .setSpeed(3000)
            .setTurn(1)
            .build();

    medalAnimation_tv.startAnimation(findViewById(R.id.textView_title));

    MedalAnimation medalAnimation = new MedalAnimation.Builder()
            .setDirection(MedalAnimation.LEFT)
            .setSpeed(4200)
            .setTurn(4)
            .build();

    ImageView imageView = (ImageView)findViewById(R.id.badge);
    imageView.startAnimation(medalAnimation);
}
 
开发者ID:skydoves,项目名称:Medal,代码行数:22,代码来源:ExampleActivity.java

示例6: animationDisplay

import android.widget.ImageView; //导入方法依赖的package包/类
public static void animationDisplay(ImageView imageView, Drawable drawable, Animation animation) {
    imageView.setImageDrawable(drawable);
    if (cloneMethod != null && animation != null) {
        try {
            imageView.startAnimation((Animation) cloneMethod.invoke(animation));
        } catch (Throwable ex) {
            imageView.startAnimation(animation);
        }
    } else {
        imageView.startAnimation(animation);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:ImageAnimationHelper.java

示例7: onClick

import android.widget.ImageView; //导入方法依赖的package包/类
/**
 * Imageview event click listeners
 *
 * @param view Imageview that was clicked
 */
@Override
public void onClick(View view) {
    ImageView image = (ImageView) view;
    image.startAnimation(animFadein);
    presenter.onImageViewClicked(Integer.parseInt(view.getTag().toString()));
}
 
开发者ID:snappy46,项目名称:GuitarixDroid,代码行数:12,代码来源:MainActivity.java

示例8: onCreate

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    Window window = getWindow();
    window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    setContentView(R.layout.activity_scan);

    scanPreview = (SurfaceView) findViewById(R.id.capture_preview);
    scanContainer = (RelativeLayout) findViewById(R.id.capture_container);
    scanCropView = (RelativeLayout) findViewById(R.id.capture_crop_view);
    scanLine = (ImageView) findViewById(R.id.capture_scan_line);

    inactivityTimer = new InactivityTimer(this);
    beepManager = new BeepManager(this);

    TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.9f);
    animation.setDuration(4500);
    animation.setRepeatCount(-1);
    animation.setRepeatMode(Animation.RESTART);
    scanLine.startAnimation(animation);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

}
 
开发者ID:TonnyL,项目名称:Espresso,代码行数:28,代码来源:CaptureActivity.java

示例9: updateProgressBar

import android.widget.ImageView; //导入方法依赖的package包/类
/**
 * 
 * @param testType
 */
public void updateProgressBar(final QoSTestResultEnum testType) {
	if (viewMap != null) {
		View view = viewMap.get(testType);
		if (view != null) {
			ImageView image = (ImageView) view.findViewById(R.id.test_view_qos_image);
			if (image.getAnimation() == null) {
				image.setImageResource(R.drawable.traffic_lights_yellow);
				image.startAnimation(AnimationUtils.loadAnimation(getContext(), R.anim.rotate));
			}
		}
	}
}
 
开发者ID:rtr-nettest,项目名称:open-rmbt,代码行数:17,代码来源:GroupCountView.java

示例10: onCreate

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	// TODO Auto-generated method stub
	super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
iv=(ImageView)findViewById(R.id.imageView1);
tv=(TextView)findViewById(R.id.textView1);
animFadeOut=AnimationUtils.loadAnimation(getApplicationContext(), R.anim.fade_out);
animfadein=AnimationUtils.loadAnimation(getApplicationContext(), R.anim.together);
animFadeOut.setAnimationListener(this);
animfadein.setAnimationListener(this);
iv.startAnimation(animfadein);
tv.startAnimation(animFadeOut);


h= new Handler();
h.postDelayed(new Runnable() {
	
	@Override
	public void run() {
		// TODO Auto-generated method stub
		finish();
		if(!bbp)
		{
			Intent intent =new Intent(Splash.this,MainActivity.class);
			Splash.this.startActivity(intent);
			
		}
		
		
		
		
	}
}, holding);
 
 }
 
开发者ID:aakashno123,项目名称:Mobile-phone-tracking-App,代码行数:37,代码来源:Splash.java

示例11: onCreate

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.whats_door);
      
      mLeft = (ImageView)findViewById(R.id.imageLeft);
      mRight = (ImageView)findViewById(R.id.imageRight);
      mText = (TextView)findViewById(R.id.anim_text);
      
      AnimationSet anim = new AnimationSet(true);
TranslateAnimation mytranslateanim = new TranslateAnimation(Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,-1f,Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,0f);
mytranslateanim.setDuration(2000);
anim.setStartOffset(800);
anim.addAnimation(mytranslateanim);
anim.setFillAfter(true);
mLeft.startAnimation(anim);

AnimationSet anim1 = new AnimationSet(true);
TranslateAnimation mytranslateanim1 = new TranslateAnimation(Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,+1f,Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,0f);
mytranslateanim1.setDuration(1500);
anim1.addAnimation(mytranslateanim1);
anim1.setStartOffset(800);
anim1.setFillAfter(true);
mRight.startAnimation(anim1);

AnimationSet anim2 = new AnimationSet(true);
ScaleAnimation myscaleanim = new ScaleAnimation(1f,3f,1f,3f,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
myscaleanim.setDuration(1000);
AlphaAnimation myalphaanim = new AlphaAnimation(1,0.0001f);
myalphaanim.setDuration(1500);
anim2.addAnimation(myscaleanim);
anim2.addAnimation(myalphaanim);
anim2.setFillAfter(true);
mText.startAnimation(anim2);
new Thread(this).start();
  }
 
开发者ID:qizhenghao,项目名称:HiBangClient,代码行数:37,代码来源:WhatsnewDoor.java

示例12: onCreate

import android.widget.ImageView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);
    ImageView logo = findViewById(R.id.logo_splash);
    Animation myFadeInAnimation = AnimationUtils.loadAnimation(this, R.anim.blink_and_fade);
    logo.startAnimation(myFadeInAnimation);
    // Instantiate the database
    DatabaseManager.getInstance().splashLoadAutocomplete(this);
}
 
开发者ID:iskandergaba,项目名称:Botanist,代码行数:11,代码来源:SplashActivity.java

示例13: doAnimationExpand

import android.widget.ImageView; //导入方法依赖的package包/类
protected void doAnimationExpand(@Nonnull ImageView imageView) {
    RotateAnimation rotate =
            new RotateAnimation(360, 180, RELATIVE_TO_SELF, 0.5f, RELATIVE_TO_SELF, 0.5f);
    rotate.setDuration(300);
    rotate.setFillAfter(true);
    imageView.startAnimation(rotate);
}
 
开发者ID:nhocga1995s,项目名称:MyCalendar,代码行数:8,代码来源:RecycleViewBaseViewHolder.java

示例14: doAnimationCollapse

import android.widget.ImageView; //导入方法依赖的package包/类
protected void doAnimationCollapse(@Nonnull ImageView imageView) {
    RotateAnimation rotate =
            new RotateAnimation(180, 360, RELATIVE_TO_SELF, 0.5f, RELATIVE_TO_SELF, 0.5f);
    rotate.setDuration(300);
    rotate.setFillAfter(true);
    imageView.startAnimation(rotate);
}
 
开发者ID:nhocga1995s,项目名称:MyCalendar,代码行数:8,代码来源:RecycleViewBaseViewHolder.java

示例15: rotateImageForever

import android.widget.ImageView; //导入方法依赖的package包/类
public static void rotateImageForever(Context context, ImageView ivSwap, int id) {
	Animation operatingAnim = AnimationUtils.loadAnimation(context,id);
	LinearInterpolator lin = new LinearInterpolator();
	operatingAnim.setInterpolator(lin);
	if (operatingAnim != null) {
		ivSwap.startAnimation(operatingAnim);
	}
}
 
开发者ID:SShineTeam,项目名称:Huochexing12306,代码行数:9,代码来源:ImageUtil.java


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