Search in sources :

Example 16 with Explode

use of android.transition.Explode in project KL2 by jweihao.

the class TransitionsToActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
    int flag = getIntent().getExtras().getInt("flag");
    // 根据flag的值来设置不同的动画效果
    switch(flag) {
        case 0:
            getWindow().setEnterTransition(new Explode());
            break;
        case 1:
            getWindow().setEnterTransition(new Slide());
            break;
        case 2:
            getWindow().setEnterTransition(new Fade());
            getWindow().setExitTransition(new Fade());
        case 3:
            break;
        default:
            break;
    }
    setContentView(R.layout.activity_transitions_to);
}
Also used : Explode(android.transition.Explode) Slide(android.transition.Slide) Fade(android.transition.Fade)

Example 17 with Explode

use of android.transition.Explode in project TicktockMusic by Lauzy.

the class FragmentAnimUtil method setEnterExitAnim.

public static void setEnterExitAnim(Fragment fragment) {
    Explode explode = new Explode();
    explode.setDuration(350);
    explode.setInterpolator(new DecelerateInterpolator());
    explode.setMode(Visibility.MODE_IN);
    Slide slide = new Slide();
    slide.setSlideEdge(Gravity.LEFT);
    slide.setDuration(200);
    Fade fade = new Fade();
    fade.setDuration(200);
    fragment.setReturnTransition(fade);
    fragment.setEnterTransition(explode);
    fragment.setSharedElementEnterTransition(new FragmentTransition());
    fragment.setSharedElementReturnTransition(new FragmentTransition());
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) Explode(android.transition.Explode) Slide(android.transition.Slide) Fade(android.transition.Fade)

Example 18 with Explode

use of android.transition.Explode in project ExpandingPager by qs-lll.

the class MainActivity method setupWindowAnimations.

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void setupWindowAnimations() {
    Explode slideTransition = new Explode();
    getWindow().setReenterTransition(slideTransition);
    getWindow().setExitTransition(slideTransition);
}
Also used : Explode(android.transition.Explode) TargetApi(android.annotation.TargetApi)

Example 19 with Explode

use of android.transition.Explode in project MaterialLogin by fanrunqi.

the class AActivityThree method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.a_activity_three);
    Explode explode = new Explode();
    explode.setDuration(500);
    getWindow().setExitTransition(explode);
    getWindow().setEnterTransition(explode);
}
Also used : Explode(android.transition.Explode)

Aggregations

Explode (android.transition.Explode)19 ActivityOptions (android.app.ActivityOptions)3 Intent (android.content.Intent)3 ActivityOptionsCompat (android.support.v4.app.ActivityOptionsCompat)3 Fade (android.transition.Fade)3 TargetApi (android.annotation.TargetApi)2 Point (android.graphics.Point)2 CardView (android.support.v7.widget.CardView)2 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)2 RecyclerView (android.support.v7.widget.RecyclerView)2 Slide (android.transition.Slide)2 View (android.view.View)2 AbsListView (android.widget.AbsListView)2 SampleListener (com.example.gsyvideoplayer.listener.SampleListener)2 ColorDrawable (android.graphics.drawable.ColorDrawable)1 Toolbar (android.support.v7.widget.Toolbar)1 Transition (android.transition.Transition)1 Window (android.view.Window)1 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)1 OnClick (butterknife.OnClick)1