Java 类android.transition.Explode 实例源码

项目:KTools    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        //转场动画
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        getWindow().setEnterTransition(new Explode());
        getWindow().setExitTransition(new Explode());
    }
    setContentView(R.layout.activity_main);
    ClassLoader loader = MainActivity.class.getClassLoader();
    if (loader != null){
        Log.d(TAG, "onCreate: classloader:" + loader.toString());
        Log.d(TAG, "onCreate: classloader:" + loader.getParent().toString());
    }

    ButterKnife.bind(this);
    initViews();
}
项目:AnimationShowcase    文件:FragmentSharedElementTransitionSource.java   
@OnClick(R.id.square2)
public void onClick() {

    FragmentSharedElementTransitionTarget targetFragment = new FragmentSharedElementTransitionTarget();
    // FIXME: 08/02/2017 the shared element transitions to the next fragment below other views while it should be on top as in Activity transitions
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        TransitionSet transitionSet = new TransitionSet();
        transitionSet.addTransition(new ChangeBounds());
        transitionSet.setPathMotion(new ArcMotion());
        targetFragment.setSharedElementEnterTransition(transitionSet);
        targetFragment.setSharedElementReturnTransition(transitionSet);
        targetFragment.setEnterTransition(TransitionInflater.from(getActivity()).inflateTransition(R.transition.slide_bottom));
        targetFragment.setExitTransition(TransitionInflater.from(getActivity()).inflateTransition(R.transition.slide_top_and_fade));
        setExitTransition(new Explode());
        setReenterTransition(new Explode());
        setAllowReturnTransitionOverlap(false);
    }
    getActivity().getSupportFragmentManager()
            .beginTransaction()
            .addSharedElement(square2, getString(R.string.custom_element_transition_name))
            .replace(R.id.fragmentContainer, targetFragment)
            .addToBackStack(null)
            .commit();
}
项目:BeHealthy    文件:MainFragment.java   
public void openTaskDetail(){
    Task clickedTask = adapter.getTask(mTaskViewPager.getCurrentItem());

    Fragment taskDetailFragment = new TaskDetailFragment();
    ((TaskDetailFragment)taskDetailFragment).setDisplayedTask(clickedTask);

    if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP) {
        Explode explode = new Explode();
        explode.setDuration(300);
        Fade fade = new Fade();
        fade.setDuration(400);
        taskDetailFragment.setEnterTransition(fade);
        setExitTransition(explode);
        setReenterTransition(explode);
    }

    getActivity().getSupportFragmentManager()
            .beginTransaction()
            .replace(R.id.content_frame, taskDetailFragment)
            .addToBackStack(null)
            .commit();

}
项目:jigsaw-android    文件:GameActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Window window = getWindow();
        window.requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        window.setEnterTransition(new Explode());
        window.setExitTransition(new Explode());
    }
    setContentView(R.layout.activity_game);

    Mailbox.getInstance().atHome(this);

    mTvTime = (TextView) findViewById(R.id.tv_time);
    mTvStep = (TextView) findViewById(R.id.tv_step);
    mBtnChooseAndStart = (Button) findViewById(R.id.btn_choose_and_start);
}
项目:GSYVideoPlayer    文件:FragmentVideoActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    // 设置一个exit transition
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        getWindow().setEnterTransition(new Explode());
        getWindow().setExitTransition(new Explode());
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_fragment);

    newFragment = new VideoFragment();
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.replace(R.id.frameLayout, newFragment);
    transaction.addToBackStack(null);
    transaction.commit();
}
项目:android-OurStreets    文件:GalleryFragment.java   
public GalleryFragment() {

        final Fade fade = new Fade();
        fade.addTarget(R.id.appbar);

        Explode explode = new Explode();
        explode.excludeTarget(R.id.appbar, true);

        Elevation elevation = new Elevation();
        elevation.addTarget(R.id.gallery_card);
        elevation.setStartDelay(250); // arbitrarily chosen delay

        TransitionSet exit = new TransitionSet();
        exit.addTransition(fade);
        exit.addTransition(explode);
        exit.addTransition(elevation);

        setExitTransition(exit);
    }
项目:-Material-Design    文件:LearnTransitionActivityB.java   
public void setAnimation() {
    type = getIntent().getStringExtra("type");

    switch (type) {
        case "1":
            getWindow().setEnterTransition(new Explode());
            getWindow().setExitTransition(new Explode());
            break;
        case "2":
            getWindow().setEnterTransition(new Slide());
            getWindow().setExitTransition(new Slide());
            break;
        case "3":
            getWindow().setEnterTransition(new Fade());
            getWindow().setExitTransition(new Fade());
            break;
    }
}
项目:ihandsw    文件:AboutUsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    if(BuildUtil.isLargeThanAPI21()){
        Fade fade = new Fade();
        Explode explode = new Explode();
        fade.setDuration(100);
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        getWindow().setEnterTransition(fade);
        getWindow().setExitTransition(fade);
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about_us);

    getSupportActionBar().setTitle("关于我们");
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
项目:4Fun    文件:MainActivity.java   
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
            getWindow().setExitTransition(new Explode());
        }
        mDecorView = getWindow().getDecorView();
        mDefaultUIFlag = mDecorView.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
        getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.main_background));
//        setAppTheme();
        setContentView(R.layout.activity_main);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        ButterKnife.bind(this);
        analyseIntent();
        initChildViews(savedInstanceState);
    }
项目:photo-picker-plus-android    文件:BaseActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    getWindow().setEnterTransition(new Explode());
    getWindow().setExitTransition(new Explode());
  }

  setContentView(getLayoutResource());

  Toolbar toolBar = (Toolbar) findViewById(R.id.toolbar);
  if (toolBar != null) {
    toolBar.bringToFront();
    setSupportActionBar(toolBar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setIcon(new ColorDrawable(android.R.color.transparent));
    getSupportActionBar().setTitle(R.string.choose_service);
    setToolBar(toolBar);
  }
}
项目:GitHub    文件:MainActivity.java   
@OnClick({R.id.bt_go, R.id.fab})
public void onClick(View view) {
    switch (view.getId()) {
        case R.id.fab:
            getWindow().setExitTransition(null);
            getWindow().setEnterTransition(null);

            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                ActivityOptions options =
                        ActivityOptions.makeSceneTransitionAnimation(this, fab, fab.getTransitionName());
                startActivity(new Intent(this, RegisterActivity.class), options.toBundle());
            } else {
                startActivity(new Intent(this, RegisterActivity.class));
            }
            break;
        case R.id.bt_go:
            Explode explode = new Explode();
            explode.setDuration(500);

            getWindow().setExitTransition(explode);
            getWindow().setEnterTransition(explode);
            ActivityOptionsCompat oc2 = ActivityOptionsCompat.makeSceneTransitionAnimation(this);
            Intent i2 = new Intent(this,LoginSuccessActivity.class);
            startActivity(i2, oc2.toBundle());
            break;
    }
}
项目:GitHub    文件:LoginSuccessActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login_success);

    Explode explode = new Explode();
    explode.setDuration(500);
    getWindow().setExitTransition(explode);
    getWindow().setEnterTransition(explode);
}
项目:GitHub    文件:SharedElementActivityActivity.java   
@Override
public void initView(Bundle savedInstanceState, View view) {
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
        Explode explode = (Explode) TransitionInflater.from(this).inflateTransition(R.transition.explode_1000);
        Fade fade = (Fade) TransitionInflater.from(this).inflateTransition(R.transition.fade_1000);
        getWindow().setEnterTransition(fade);
        getWindow().setExitTransition(explode);
    }
    findViewById(android.R.id.content).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            SharedElementActivityActivity.start(SharedElementActivityActivity.this);
        }
    });
}
项目:GitHub    文件:ActivityActivity.java   
@Override
public void initView(Bundle savedInstanceState, View view) {
    getToolBar().setTitle(getString(R.string.demo_activity));
    viewSharedElement = (ImageView) findViewById(R.id.view_shared_element);
    findViewById(R.id.btn_cls).setOnClickListener(this);
    findViewById(R.id.btn_cls_opt_anim).setOnClickListener(this);
    findViewById(R.id.btn_cls_opt_shared).setOnClickListener(this);
    findViewById(R.id.btn_cls_opt_scale_up).setOnClickListener(this);
    findViewById(R.id.btn_cls_opt_thumbnail_scale_up).setOnClickListener(this);
    findViewById(R.id.btn_cls_opt_clip_reveal).setOnClickListener(this);
    findViewById(R.id.btn_cls_anim).setOnClickListener(this);
    findViewById(R.id.btn_shared_element).setOnClickListener(this);
    findViewById(R.id.btn_start_home_activity).setOnClickListener(this);
    findViewById(R.id.btn_finish_all_activity).setOnClickListener(this);
    TextView tvAboutActivity = (TextView) findViewById(R.id.tv_about_activity);
    tvAboutActivity.setText("Is ImageActivity Exists: " + ActivityUtils.isActivityExists(Config.PKG, ImageActivity.class.getName())
            + "\ngetLauncherActivity: " + ActivityUtils.getLauncherActivity(Config.PKG)
            + "\ngetTopActivity: " + ActivityUtils.getTopActivity()
    );
    bitmap = ((BitmapDrawable) viewSharedElement.getDrawable()).getBitmap();

    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
        Explode explode = (Explode) TransitionInflater.from(this).inflateTransition(R.transition.explode_1000);
        Fade fade = (Fade) TransitionInflater.from(this).inflateTransition(R.transition.fade_1000);
        getWindow().setEnterTransition(explode);
        getWindow().setReturnTransition(fade);
    }
}
项目:TrackIt-Android    文件:SearchActivity.java   
@Override
public void onCreate(Bundle savedInstanceState) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        getWindow().setExitTransition(new Explode());
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_search);
    initialise();
    configure();
    setSearchListeners();
}
项目:QianXun    文件:LoginSuccessActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login_success);

    Explode explode = new Explode();
    explode.setDuration(500);
    getWindow().setExitTransition(explode);
    getWindow().setEnterTransition(explode);
}
项目:SOS-The-Healthcare-Companion    文件:ViewActivity.java   
public void setupTransitions() {
    // Add shared element transition animation if on Lollipop or later
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        // Enter transitions
        TransitionSet setEnter = new TransitionSet();

        Transition slideDown = new Explode();
        slideDown.addTarget(headerView);
        slideDown.excludeTarget(scrollView, true);
        slideDown.setDuration(500);
        setEnter.addTransition(slideDown);

        Transition fadeOut = new Slide(Gravity.BOTTOM);
        fadeOut.addTarget(scrollView);
        fadeOut.setDuration(500);
        setEnter.addTransition(fadeOut);

        // Exit transitions
        TransitionSet setExit = new TransitionSet();

        Transition slideDown2 = new Explode();
        slideDown2.addTarget(headerView);
        slideDown2.setDuration(570);
        setExit.addTransition(slideDown2);

        Transition fadeOut2 = new Slide(Gravity.BOTTOM);
        fadeOut2.addTarget(scrollView);
        fadeOut2.setDuration(280);
        setExit.addTransition(fadeOut2);

        getWindow().setEnterTransition(setEnter);
        getWindow().setReturnTransition(setExit);
    }
}
项目:JBase    文件:BaseActivity.java   
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().setExitTransition(new Explode());
    }
    super.onCreate(savedInstanceState);
    LoadingDialog.init(this);//用户页面返回时重设context
    mFragmentManager = getFragmentManager();
    mFragmentListMap = new HashMap<>();//创建一个fragment集合,根据viewID保存hash集合中,可以根据viewid进行操作而不乱

}
项目:FloatingNew    文件:SelectedApplication.java   
private void setupWindowAnimations() {
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
        Fade fade = new Fade();
        fade.setDuration(1000);
        getWindow().setEnterTransition(fade);
        Toast.makeText(this, "Animation", Toast.LENGTH_SHORT).show();
        Explode slide = new Explode();
        slide.setDuration(1000);
        getWindow().setReenterTransition(slide);
    }


}
项目:FloatingNew    文件:MainActivity.java   
private void setupWindowAnimations() {

        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
            Explode slide = new Explode();
            slide.setDuration(1000);
            getWindow().setExitTransition(slide);
        }

    }
项目:TransitionDemo    文件:ImageActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        getWindow().setEnterTransition(new Explode());
    }

    setContentView(R.layout.activity_image);

    imageView = (ImageView) findViewById(R.id.imageView);
    textView = (TextView) findViewById(R.id.textView);

    ViewCompat.setTransitionName(imageView, VIEW_NAME_IMAGE);

    Intent intent = getIntent();
    if (intent != null) {
        imageId = intent.getIntExtra(KEY_IMAGE_ID, 0);
        description = intent.getStringExtra(KEY_DESCRIPTION);
    }
    imageView.setImageResource(imageId);
    textView.setText(description);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        addTransitionListener();
    }
}
项目:douban-movie    文件:SubjectActivity.java   
/**
 * activity scene transition animation
 */
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private Transition makeTransition() {
    TransitionSet transition = new TransitionSet();
    transition.addTransition(new Explode());
    transition.addTransition(new Fade());
    transition.setDuration(400);
    return transition;
}
项目:learn-newFeatures_Android_5.0    文件:ExplodeActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
    getWindow().setAllowEnterTransitionOverlap(true);
    getWindow().setAllowReturnTransitionOverlap(true);
    Explode explode = new Explode();
    explode.setDuration(1000);
    getWindow().setEnterTransition(explode);
    getWindow().setExitTransition(explode);

    setContentView(R.layout.activity_animation);
}
项目:HeartRead    文件:OneEssayActivity.java   
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void initTransitionAnimation() {
    getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
    //设置Activity过渡动画
    getWindow().setEnterTransition(new Explode());

}
项目:HeartRead    文件:GuokeDetailActivity.java   
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
    //设置Activity过渡动画
    getWindow().setEnterTransition(new Explode());
    setContentView(R.layout.guoke_detail_page);

    initToolbar();
    initStatusBar();

    LoadRequest();
}
项目:HeartRead    文件:OneQuestionActivity.java   
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void initTransitionAnimation(){
    getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
    //设置Activity过渡动画
    getWindow().setEnterTransition(new Explode());

}
项目:HeartRead    文件:ZhiHuDetailActivity.java   
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void initTransitionAnimation() {
    getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
    //设置Activity过渡动画
    getWindow().setEnterTransition(new Explode());

}
项目:HeartRead    文件:OneSerialActivity.java   
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void initTransitionAnimation(){
    getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
    //设置Activity过渡动画
    getWindow().setEnterTransition(new Explode());

}
项目:wnacg    文件:ComBaseActivity.java   
@Override
protected void beforeCreate() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        getWindow().setExitTransition(new Explode());//new Slide()  new Fade()
    }
}
项目:StudyBox_Android    文件:BaseExamActivity.java   
private void setUpEnterTransition() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Explode transition = new Explode();
        transition.setDuration(TRANSITION_DURATION);
        getWindow().setEnterTransition(transition);
    }
}
项目:MoonlightNote    文件:MoonlightActivity.java   
private void setTransition() {

        Explode explode = new Explode();
        explode.setDuration(500);
        explode.setMode(Explode.MODE_IN);

        Explode explode1 = new Explode();
        explode1.setDuration(500);
        explode1.setMode(Explode.MODE_OUT);

        getWindow().setEnterTransition(explode);
        getWindow().setReturnTransition(explode1);
    }
项目:ihandsw    文件:BaseActivity.java   
/**
 * 重写父类的onCreate方法,在该方法中调用initInjector,afterCreate等方法,在以后的activity代码中就不用书写这些
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
    if(BuildUtil.isLargeThanAPI21()){
        Fade fade = new Fade();
        Explode explode = new Explode();
        fade.setDuration(100);
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
        getWindow().setEnterTransition(explode);
        getWindow().setExitTransition(fade);
    }

    super.onCreate(savedInstanceState);
    beforeSetView();
    //设定透明状态栏
    if(!BuildUtil.isLowerThanAPI19() && transStatusFlag){
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    }
    int layout = setContentView();
    setContentView(layout);
    mApplicationComponent = ((IHandSwApplication)getApplication()).getComponent();
    mActivityComponent = DaggerActivityComponent.builder()
            .activityModule(new ActivityModule(this))
            .applicationComponent(mApplicationComponent)
            .build();
    mToastUtil = mActivityComponent.getToastUtil();
    mRetrofit = mActivityComponent.getRetrofit();
    Activities.add(this);
    initInjector();
    attachView();
    custom();
    afterCreate();
    //推送必调用
    PushAgent.getInstance(this).onAppStart();
}
项目:WeChatPictureSelector    文件:PictureSelectActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setEnterTransition(new Fade());
    getWindow().setExitTransition(new Explode());
    setContentView(R.layout.activity_picture_select);

    initViews();
    initDatas();
    initEvents();
}
项目:android-temperature-logger    文件:DashboardFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  View v = inflater.inflate(R.layout.fragment_dashboard, container, false);

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    setExitTransition(new Explode());
  }

  return v;
}
项目:BandWith    文件:ApplyActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.my_apply);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    final ActionBar ab = getSupportActionBar();
    ab.setTitle("신청리스트");
    ab.setDisplayHomeAsUpEnabled(true);

    mPrefs = getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
    mEditor = mPrefs.edit();
    ViewPager applyPager = (ViewPager) findViewById(R.id.viewpager);
    if (applyPager != null) {
        setupTabViewPager(applyPager);
    }

    TabLayout tabLayout = (TabLayout) findViewById(R.id.apply_tabs);
    tabLayout.setupWithViewPager(applyPager);

    if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Window window = getWindow();
        Transition exitTrans = new Explode();
        Transition reenterTrans = new Explode();

        window.setExitTransition(exitTrans);
        window.setReenterTransition(reenterTrans);
        window.setAllowEnterTransitionOverlap(true);
        window.setAllowReturnTransitionOverlap(true);
    }


}
项目:android-52Kit    文件:LicenseActivity.java   
/***********************************************************************************************
 *
 * Lifecycle Methods
 *
 */

@Override @SuppressLint("NewApi")
public void onCreate(Bundle savedInstanceState) {
    // Set window transition elements
    if(BuildUtils.isLollipop()) {
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);

        TransitionSet transitions = new TransitionSet()
                .addTransition(new ChangeBounds())
                .addTransition(new Fade());

        getWindow().setEnterTransition(new Explode());
        getWindow().setExitTransition(new Explode());
        getWindow().setSharedElementEnterTransition(transitions);
        getWindow().setSharedElementExitTransition(transitions);
    }

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_license);

    // Load UI
    mToolbar = ButterKnife.findById(this, R.id.appbar);
    mRecyler = ButterKnife.findById(this, R.id.recycler);

    // Set the toolbar as the support actionbar
    setSupportActionBar(mToolbar);
    parseExtras(savedInstanceState);

    // Set listeners
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    mToolbar.setNavigationOnClickListener(this);

    mRecyler.setAdapter(mAdapter);
    mRecyler.setLayoutManager(new LinearLayoutManager(this));
    mRecyler.setItemAnimator(new DefaultItemAnimator());
    mRecyler.addItemDecoration(new StickyRecyclerHeadersElevationDecoration(mAdapter));
    mAdapter.setOnItemClickListener(this);

}
项目:android-52Kit    文件:DetailActivity.java   
/***********************************************************************************************
 *
 * Lifecycle Methods
 *
 */

@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {

    // Set window transition elements
    if(BuildUtils.isLollipop()) {
        getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);

        TransitionSet transitions = new TransitionSet()
               .addTransition(new ChangeBounds())
               .addTransition(new Fade());

        getWindow().setEnterTransition(new Explode());
        getWindow().setExitTransition(new Explode());
        getWindow().setSharedElementEnterTransition(transitions);
        getWindow().setSharedElementExitTransition(transitions);
    }
    super.onCreate(savedInstanceState);
    overridePendingTransition(0, 0);

    setContentView(R.layout.activity_license_detail);

    // Inflate components
    mAppbar = ButterKnife.findById(this, R.id.appbar);
    mName = ButterKnife.findById(this, R.id.name);
    mAuthor = ButterKnife.findById(this, R.id.author);
    mLicense = ButterKnife.findById(this, R.id.license);

    // Apply components
    setSupportActionBar(mAppbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    mAppbar.setNavigationOnClickListener(this);

    // Parse extras
    parseExtras(savedInstanceState);
}
项目:android-animation-arsenal    文件:AnimationArsenal.java   
/**
 * returns Explode Transition
 *
 * @param listener transition listener
 * @param duration duration for transition
 * @return returns explode transition (null if API level 14 is less than LOLLIPOP)
 */
public static Transition getExplodeTransition(Transition.TransitionListener listener, int
        duration)
{
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
    {
        Explode explode = new Explode();
        explode.setDuration(duration);
        explode.addListener(listener);
        return explode;
    }
    return null;
}
项目:TutosAndroidFrance    文件:MainActivity.java   
private void setupWindowAnimations() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {

        Explode explode = new Explode();
        getWindow().setExitTransition(explode);

        Fade fade = new Fade();
        getWindow().setReenterTransition(fade);
    }
}
项目:Studddinv2_android    文件:CollegeSelectorFragment.java   
public static void goToMainActivity(Activity act) {
    Intent i = new Intent(act, MainActivity.class);
    if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
        Activity activity = act;
        Bundle options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity).toBundle();
        activity.getWindow().setExitTransition(new Explode().setDuration(1500));
        ActivityCompat.startActivityForResult(activity, i, 0, options);
    } else {
        act.startActivity(i);
    }
    act.finish();
}