Example usage for android.view Window FEATURE_ACTIVITY_TRANSITIONS

List of usage examples for android.view Window FEATURE_ACTIVITY_TRANSITIONS

Introduction

In this page you can find the example usage for android.view Window FEATURE_ACTIVITY_TRANSITIONS.

Prototype

int FEATURE_ACTIVITY_TRANSITIONS

To view the source code for android.view Window FEATURE_ACTIVITY_TRANSITIONS.

Click Source Link

Document

Enables Activities to run Activity Transitions either through sending or receiving ActivityOptions bundle created with android.app.ActivityOptions#makeSceneTransitionAnimation(android.app.Activity,android.util.Pair[]) or android.app.ActivityOptions#makeSceneTransitionAnimation(android.app.Activity,View,String) .

Usage

From source file:com.massivedisaster.activitymanager.activity.AbstractFragmentActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        requestWindowFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
        requestWindowFeature(Window.FEATURE_CONTENT_TRANSITIONS);
    }/* w w w  . ja v  a 2  s . c  om*/

    super.onCreate(savedInstanceState);

    View rootView = LayoutInflater.from(this).inflate(getLayoutResId(), null);
    setContentView(rootView);
    initializeDataBinding(rootView);

    if (getSupportFragmentManager().getFragments().isEmpty()
            && getSupportFragmentManager().getBackStackEntryCount() == 0) {
        if (getIntent().hasExtra(ACTIVITY_MANAGER_FRAGMENT)) {
            performInitialTransaction(getFragment(getIntent().getStringExtra(ACTIVITY_MANAGER_FRAGMENT)),
                    getFragmentTag());
        } else if (getDefaultFragment() != null) {
            performInitialTransaction(getFragment(getDefaultFragment().getCanonicalName()), null);
        }
    }
}