Próbuję zrobić alfa i przetłumaczyć w RelativeLayout. I zdefiniować zarówno:Uruchom dwie animacje w tym samym układzie
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);
więc uruchomić animację w moim RelativeLayout
RelativeLayout.startAnimation(translate);
RelativeLayout.startAnimation(alpha);
Problemem jest to, że w tym przypadku, tylko uruchomić animację alfa, a nie tłumaczenie. Czy ktoś może mi pomóc? Powstaje pytanie, w jaki sposób mogę uruchomić dwa różne animacje w tym samym czasie w tym samym obiekcie (względem układu w moim przypadku)
rozwiązać kwestię. Dodałem go:
AnimationSet animationSet = new AnimationSet(true);
animationSet.addAnimation(alpha);
animationSet.addAnimation(translate);
RelativeLayout.startAnimation(animationSet);