Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBlessing Chiwaura
18,037 Pointscustom transition help
help with custom transition ant figure out the error
public class AlphaScale extends Visibility {
@Override
public Animator onAppear(ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues) {
return createAlphaScaleAnimator (view, 0,1 );
}
@Override
public Animator onDisappear(ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues) {
return null;
}
private Animator createAlphaScaleAnimator(View view, float fromScale, float toScale, float fromAlpha, float toAlpha) {
AnimatorSet set = new AnimatorSet();
ObjectAnimator x = ObjectAnimator.ofFloat(view, View.SCALE_X, fromScale, toScale);
ObjectAnimator y = ObjectAnimator.ofFloat(view, View.SCALE_Y, fromScale, toScale);
ObjectAnimator alpha = ObjectAnimator.ofFloat(view, View.ALPHA, fromAlpha, toAlpha);
set.playTogether(x, y, alpha);
return set;
}
}
1 Answer
durul
62,690 Pointsreturn createAlphaScaleAnimator(view, 0, 1, 0, 1);