andkulikov / Transitions-Everywhere

Set of extra Transitions on top of Jetpack Transitions Library
Apache License 2.0
4.82k stars 486 forks source link

use transition to with intents #22

Closed schermannj closed 9 years ago

schermannj commented 9 years ago

Hello, I using your library for my android app and I want to use your transition with Intents e.g. when I change activity I want add some animation but when I do it with your library It animate at first and next change activity. How can I do it or is it impossible?

andkulikov commented 9 years ago

hi! can you show example of your code? where and how do you start transition?

schermannj commented 9 years ago

I'm using fragment, so this is in the my main fragment

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    mSceneRoot = (ViewGroup) getActivity().findViewById(R.id.messages_recycle_view);
    generalScene = new Scene(mSceneRoot, mSceneRoot.findViewById(R.id.container));
    historyScene = Scene.getSceneForLayout(mSceneRoot, R.layout.history_window_fragment, getActivity().getApplicationContext());
}

and next in recyclerViewOnItemClickListner:

            Intent intent = new Intent(getActivity(), SomeActivity.class);
            startActivity(intent);
            TransitionManager.go(Scene.getSceneForLayout(mSceneRoot, R.layout.window_fragment, view.getContext()));

With this code I try to specify concrete item view, but it not work too - I see on screen hardcoded data from window_layout.xml

    view.getContext()
schermannj commented 9 years ago

oh, I found here issue, that transition does't work with this library...and I also understand what i'm doing wrong.

andkulikov commented 9 years ago

yes. for now you can just put all two scenes inside one activity(or fragment) and perform transitions between them