Animation Transtition Animation

/*this will go in button click, activity start, or whatever*/


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

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

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

/*This stays at the bottom of all code in onCreate*/
}
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); } } 

Komentar

Cara pembuatan Apps paling Populer

Create Stopwatch App in Android using Sketchware

TextInputLayout in Sketchware

How to find and​ highlight a word in a text field in Sketchware?

A Flash Light App in Sketchware

How to enable download in webview in Sketchware apps?

Intent - Open File By Type

Code for implementing Notifications in Sketchware

How to share an image from Drawable folder?

ActionBar back button