Shared element activity transition on android 5

前端 未结 12 611
我寻月下人不归
我寻月下人不归 2021-01-30 13:20

I wanted to setup a shared element transition when going from one Activity to another.

The first Activity has a RecyclerView with items. When an item is clicked that it

12条回答
  •  日久生厌
    2021-01-30 13:59

    I have faced the same issue, actually I used firebase and I have list of information and when user tap it will call detailActivity with sharedAnimation in this activity I was updating it as seen using firebase so firebase event updating the list item as seen, in this case this problem is invoking because recycler view that screen layout was getting effected.

    and it invoke an exception because that transition id which one we have passed it was no more, so I solve this issue using this method.

    onPause() I have frozen the layout and onResume() set it as false;

     @Override
    public void onPause() {
        super.onPause();
        mRecycler.setLayoutFrozen(true);
    }
    
    @Override
    public void onResume() {
        super.onResume();
        mRecycler.setLayoutFrozen(false);
    }
    

    And it's working.

提交回复
热议问题