ItemDecoration make wrong transition

166 Views Asked by At

When I use Shared Element Transitions and ItemDecoration with recyclerview,animation when onBackPress make same size imageview but each one of them take CENTER_CROP at different point ,it produces about 1 centimeter movement after end animation.

Anyone have the same problem,help !!!

ItemDecoration

if((position_vs_title+1)%mGridSize==0){
            outRect.left=0;
            outRect.right=0;
        }else {
            outRect.left=0;
            outRect.right=mSizeGridSpacingPx;
        }
        outRect.bottom=mSizeGridSpacingPx;
        outRect.top=0;

Shared Element Transitions

Intent intent=new Intent(getActivity(),Show_Picture.class);
                intent.setAction(Intent.ACTION_VIEW);
                intent.putExtra("imagePosition",position);
                ActivityOptionsCompat optionsCompat=ActivityOptionsCompat.makeSceneTransitionAnimation(getActivity(),view,"myimage");
                startActivity(intent,optionsCompat.toBundle()
0

There are 0 best solutions below