Sto cercando di eseguire un alfa e tradurre in un RelativeLayout. Mi definisco entrambi:Avvia due animazioni nello stesso layout
AlphaAnimation alpha;
alpha = new AlphaAnimation(0.0f, 1.0f);
alpha.setDuration(1500);
alpha.setFillAfter(true);
TranslateAnimation translate;
translate = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0,
Animation.RELATIVE_TO_SELF, 0,
Animation.RELATIVE_TO_SELF, 1,
Animation.RELATIVE_TO_SELF, 0);
translate.setDuration(1000);
Così ho avviare l'animazione nel mio RelativeLayout
RelativeLayout.startAnimation(translate);
RelativeLayout.startAnimation(alpha);
Il problema è che in questo caso, solo avviare l'animazione alfa e non la traduzione. Qualcuno può aiutarmi? La domanda è: come posso iniziare due animazioni differenti allo stesso tempo nello stesso oggetto (Layout relativa nel mio caso)
risolvo la questione. Ho aggiunto:
AnimationSet animationSet = new AnimationSet(true);
animationSet.addAnimation(alpha);
animationSet.addAnimation(translate);
RelativeLayout.startAnimation(animationSet);