2012-09-10 10 views
5

Tengo varias imágenes de un logotipo, quiero mostrarlo en mi pantalla de bienvenida y hacer un logotipo completo como si fuera un rompecabezas. ¿Cómo puedo hacer esto?Cómo mostrar la animación en la pantalla de bienvenida con diferentes imágenes en Android

Lo estoy usando por primera vez. ¿Alguien puede ayudarme?

favor

Gracias

+1

http://developer.android.com/reference/android/graphics/drawable /AnimationDrawable.html Vaya a este enlace y lea sobre la animación cuadro por cuadro. Puede lograrlo. –

+3

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

Respuesta

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

En realidad, he puesto mis imágenes en una matriz de 60 imágenes de un logotipo, y quiero mostrarlo uno por uno en un intervalo de 1 segundo –

+0

un adiós una imágenes completan el logotipo en una vista de imagen ... así es posible por favor, ayúdame lo he intentado mucho, pero no obteniendo la solución adecuada –

+0

No, no puedo ... no tengo puntos para chat. Mínimo de 20 puntos que necesito para chatear. –

0

Prueba este camino y mantener AnimateandSlideShow() la función misma

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

¿Cómo estás? – moDev

Cuestiones relacionadas