Create 4 Image animation in sketchware


Image animation's


Code in OnStart

}
private android.transition.Fade makeFadeTransition(){
android.transition.Fade fade = new android.transition.Fade();
fade.setDuration(2000); fade.setInterpolator(new AnticipateInterpolator());
return fade; }

private android.transition.Slide makeSlideTransition(){
android.transition.Slide slide = new android.transition.Slide(); slide.setSlideEdge(Gravity.TOP);
slide.setInterpolator(new BounceInterpolator());
slide.setDuration(2000);
return slide; }

private android.transition.Explode makeExplodeTransition(){
android.transition.Explode explode = new android.transition.Explode();
explode.setDuration(2000);
explode.setInterpolator(new AnticipateOvershootInterpolator());
return explode; }

private android.transition.AutoTransition makeAutoTransition(){
android.transition.AutoTransition autoTransition = new android.transition.AutoTransition(); autoTransition.setDuration(2000); autoTransition.setInterpolator(new AnticipateOvershootInterpolator());
return autoTransition; }

private void toggleVisibility(View... views){
for(View v: views){
if(v.getVisibility()==View.VISIBLE){
v.setVisibility(View.INVISIBLE);
} else {
v.setVisibility(View.VISIBLE); } }


Button 1

android.transition.TransitionManager.beginDelayedTransition(linear1,makeFadeTransition());
toggleVisibility(imageview1,imageview2,imageview3,imageview4);

Button 2

android.transition.TransitionManager.beginDelayedTransition(linear1,makeSlideTransition());
toggleVisibility(imageview1,imageview2,imageview3,imageview4);

Button 3

android.transition.TransitionManager.beginDelayedTransition(linear1,makeExplodeTransition());
toggleVisibility(imageview1,imageview2,imageview3,imageview4);


Video Help


Post a Comment

Previous Post Next Post