ViewFlipper setAutoStart - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ViewFlipper setAutoStart method.

This code example shows how to use the following methods:setLongClickable, setOnTouchListener, setAutoStart, setFlipInterval
		return introduction_view;
	} 
	 
	private void initViewFlipper() { 
		// ¿ªÆô×Ô¶¯Æô¶¯²¢ÉèÖÃʱ¼ä¼ä¸ô 
		flipper.setAutoStart(true);
		flipper.setFlipInterval(4000);
		 // Éú³ÉÊÖÊÆʶ±ðÀàʵÀý   
        gestureDetector = new GestureDetector(context, new GerstureListener());
        // ¸øViewFlipperÉèÖÃÒ»¸öTouchListener 
        flipper.setOnTouchListener(this);  
        // ÔÊÐí³¤°´ViewFlipper 
        flipper.setLongClickable(true);  
	} 
	 
	@Override 
	public boolean onTouch(View v, MotionEvent event) {
		return gestureDetector.onTouchEvent(event);
	} 
	 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setAutoStart, stopFlipping
		aa.startNow();
	} 
 
	@Override 
	public boolean onTouchEvent(MotionEvent event) {
		viewFlipper.stopFlipping(); // µã»÷ʼþºó£¬Í£Ö¹×Ô¶¯²¥·Å
		viewFlipper.setAutoStart(false);
		return gestureDetector.onTouchEvent(event); // ×¢²áÊÖÊÆʼþ
	} 
 
	@Override 
	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
			float velocityY) {
		if (e2.getX() - e1.getX() > 120) {
			if (viewFlipper.getCurrentView().getId() != R.id.start) {
				Animation rInAnim = AnimationUtils.loadAnimation(this,
						R.anim.push_right_in); // ÏòÓÒ»¬¶¯×ó²à½øÈëµÄ½¥±äЧ¹û£¨alpha 0.1 -> 
												// 1.0£© 
				Animation rOutAnim = AnimationUtils.loadAnimation(this,
						R.anim.push_right_out); // ÏòÓÒ»¬¶¯ÓҲ໬³öµÄ½¥±äЧ¹û£¨alpha 1.0 -> 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setAutoStart, stopFlipping
		} 
	} 
 
	@Override 
	public boolean onTouchEvent(MotionEvent event) {
		viewFlipper.stopFlipping();				// 点击事件后,停止自动播放
		viewFlipper.setAutoStart(false);	
		return gestureDetector.onTouchEvent(event); 		// 注册手势事件
	} 
 
	@Override 
	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
		if (e2.getX() - e1.getX() > 120) {			 // 从左向右滑动(左进右出)
			Animation rInAnim = AnimationUtils.loadAnimation(mActivity, R.anim.push_right_in); 	// 向右滑动左侧进入的渐变效果(alpha  0.1 -> 1.0)
			Animation rOutAnim = AnimationUtils.loadAnimation(mActivity, R.anim.push_right_out); // 向右滑动右侧滑出的渐变效果(alpha 1.0  -> 0.1)
 
			viewFlipper.setInAnimation(rInAnim);
			viewFlipper.setOutAnimation(rOutAnim);
			viewFlipper.showPrevious();
			return true; 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
setAutoStart Method Overview
Set if this view automatically calls startFlipping() when it becomes attached to a window.
See Code Examples for other Android ViewFlipper Methods: