2012-09-10 2 views
5

로고가 여러 개 있습니다. 스플래시 화면에 표시하고 싶습니다. 퍼즐처럼 전체 로고를 만드십시오. 어떻게 할 수 있습니까?안드로이드에서 다른 이미지로 스플래시 화면에 애니메이션을 표시하는 방법

나는 그것을 처음 사용하고 있습니다. 누구든지 나를 도울 수 있습니다. 같은

하십시오

감사합니다

+1

http://developer.android.com/reference/android/graphics/drawable /AnimationDrawable.html이 링크로 이동하여 프레임별로 프레임 애니메이션을 읽을 수 있습니다. –

+3

http://manisivapuram.blogspot.in/2011/06/slideshow-of-images-using-android.html –

답변

1
package com.techipost.imageslider; 

import android.app.Activity; 
import android.os.Bundle; 
import android.view.*; 
import android.view.animation.Animation; 
import android.view.animation.AnimationUtils; 
import android.widget.ImageView; 
import android.os.Handler; 
import java.util.Timer; 
import java.util.TimerTask; 
import com.techipost.imageslider.R; 

public class SliderActivity extends Activity { 

    public int currentimageindex=0; 
    Timer timer; 
    TimerTask task; 
    ImageView slidingimage; 

    private int[] IMAGE_IDS = { 
      R.drawable.splash0, R.drawable.splash1, R.drawable.splash2, 
      R.drawable.splash3 
     }; 

    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.mygame); 
     final Handler mHandler = new Handler(); 

     // Create runnable for posting 
     final Runnable mUpdateResults = new Runnable() { 
      public void run() { 

       AnimateandSlideShow(); 

      } 
     }; 

     int delay = 1000; // delay for 1 sec. 

     int period = 8000; // repeat every 4 sec. 

     Timer timer = new Timer(); 

     timer.scheduleAtFixedRate(new TimerTask() { 

     public void run() { 

      mHandler.post(mUpdateResults); 

     } 

     }, delay, period); 



    } 

    public void onClick(View v) { 

     finish(); 
     android.os.Process.killProcess(android.os.Process.myPid()); 
     } 

    /** 
    * Helper method to start the animation on the splash screen 
    */ 
    private void AnimateandSlideShow() {   

     slidingimage = (ImageView)findViewById(R.id.ImageView3_Left); 
     slidingimage.setImageResource(IMAGE_IDS[currentimageindex%IMAGE_IDS.length]); 

     currentimageindex++; 

     Animation rotateimage = AnimationUtils.loadAnimation(this, R.anim.custom_anim); 

     // slidingimage.startAnimation(rotateimage);    

    }  


} 
+0

사실 저는 이미지를 배열에 60 개의 로고 이미지로 담았습니다. 하나씩 표시하고 싶습니다. 1 초 간격으로 1 개씩 –

+0

하나의 이미지가 이미지보기에서 로고를 완성합니다. 이렇게하면 가능합니다. 많이 시도했지만 적절한 해결책을 얻지 못했습니다. –

+0

아니요. 불가능합니다. chat.Minimum 20 points 채팅에 필요합니다. –

0

이 방법을 시도하고 AnimateandSlideShow을 유지() 함수

new CountDownTimer(1000,60000) { 
       // 1000(1 sec interval time) 
       // 250 (0.25 sec) 
     @Override 
     public void onTick(long millisUntilFinished) { 
      // TODO Auto-generated method stub 

      AnimateandSlideShow(); 

     } 

     @Override 
     public void onFinish() { 
      // TODO Auto-generated method stub 

      // Call NextActivity 

      Intent intent = new Intent(this,NewActivityName.class); 
      intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
      startActivity(intent); 
     } 
    }.start(); 
+0

당신은 어떻게 시도하고 있습니까 ?? – moDev

관련 문제