miammiam Posted September 27, 2010 Share Posted September 27, 2010 Bonjour a tous, voila je suis débutant dans la programmation d'applications Android, et la je ne sait pas comment faire une chose bien particulière. En faite j'ai créé un SplashScreen avec une image et un son, qui est redirigé après x secondes vers une autres page, et j'aimerais ajouter un effet graphique(je n'ai pas le nom exacte en faite), de "fondu"(l'image devient progressivement noir puis l'autre page apparait elle aussi progressivement). Voila donc si vous voyer de quoi je veut parler et si vous avez la solution, cela m'aiderai beaucoup. Ci-joint le code source de mon SplashScreen(ci ca peut aider). Merci d'avance. import android.app.Activity; import android.content.Intent; import android.content.pm.ActivityInfo; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.view.Window; import android.view.WindowManager; import android.media.MediaPlayer; import android.content.Context; public class Splash extends Activity { private static final int STOPSPLASH = 0; private static final long SPLASHTIME = 3000; MediaPlayer mp1; final Context mContext = this; private Handler splashHandler = new Handler() { @Override public void handleMessage(Message msg) { switch (msg.what) { case STOPSPLASH: Intent intent = new Intent(Splash.this, Language.class); startActivity(intent); Splash.this.finish(); break; } super.handleMessage(msg); } }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setContentView(R.layout.splash); Message msg = new Message(); msg.what = STOPSPLASH; splashHandler.sendMessageDelayed(msg, SPLASHTIME); mp1 = MediaPlayer.create(mContext, R.raw.fallingrockstudio); mp1.start(); } } Link to comment Share on other sites More sharing options...
Cyril Mottier Posted September 28, 2010 Share Posted September 28, 2010 http://d.android.com/reference/android/app/Activity.html#overridePendingTransition(int,int) Link to comment Share on other sites More sharing options...
miammiam Posted October 20, 2010 Author Share Posted October 20, 2010 merci pour l'aiguillage :) je complète avec ce lien qui m'a permis de mettre en place ces effets de transitions. http://www.anddev.org/novice-tutorials-f8/splash-fade-activity-animations-overridependingtransition-t9464.html encore merci. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.