Java 类android.transition.Transition.TransitionListener 实例源码

项目:Material-SearchTransition    文件:MainActivity.java   
private TransitionListener navigateToSearchWhenDone() {
    return new SimpleTransitionListener() {
        @Override
        public void onTransitionEnd(Transition transition) {
            Intent intent = new Intent(MainActivity.this, SearchActivity.class);
            startActivity(intent);

            // we are handing the enter transitions ourselves
            // this line overrides that
            overridePendingTransition(0, 0);

            // by this point of execution we have animated the 'expansion' of the Toolbar and hidden its contents.
            // We are half way there. Continue to the SearchActivity to finish the animation
        }
    };
}