Skip to content

Migration

Alex Vasilkov edited this page Apr 4, 2017 · 1 revision

Migration from 2.2.0 to 2.3.0

  • ViewsTransitionBuilder is deprecated, recommended replacement is GestureTransitions:
// Animating from single image into full image mode
GestureTransitions.from(imageView).into(gestureImageView);
// From RecyclerView into ViewPager.
GestureTransitions.from(recyclerView, fromTracker).into(pagerView, intoTracker);
  • SimpleViewsTracker is deprecated, recommended replacement is SimpleTracker:
        SimpleTracker pagerTracker = new SimpleTracker() {
            @Override
            public View getViewAt(int pos) {
                ...
            }
        };
  • ViewsTracker is deprecated, recommended replacement is FromTracker and IntoTracker:
        FromTracker<String> fromTracker = new FromTracker<String>() {
            @Override
            public int getPositionById(@NonNull String id) {
                // Find and return position for given id.
                // Note that several ids may end up in single list position.
                return [position];
            }

            @Override
            public View getViewById(@NonNull String id) {
                // Find and return view for given id.
                return [view];
            }
        };
        IntoTracker<String> intoTracker = new IntoTracker<String>() {
            @Override
            public String getIdByPosition(int position) {
                // Find and return id for given position.
                // Note, that only one id per position should be possible for "To" view.
                return [id];
            }

            @Override
            public int getPositionById(@NonNull String id) {
                // Find and return position for given id.
                return [position];
            }

            @Override
            public View getViewById(@NonNull String id) {
                // Find and return view for given id.
                return [view];
            }
        };
Clone this wiki locally