Blinking screen on image transition between activities

后端 未结 12 2194
温柔的废话
温柔的废话 2020-12-02 07:01

I implemented an image transition between two activities using the new shared elements from lollipop. It\'s working but I get a weird white blinking on the entire screen du

12条回答
  •  有刺的猬
    2020-12-02 07:43

    Add these codes inside onCreate of both Activities where you doing Transition elements

       Fade fade = new Fade();
            View decor = getWindow().getDecorView();
            fade.excludeTarget(decor.findViewById(R.id.action_bar_container),true);
            fade.excludeTarget(android.R.id.statusBarBackground,true);
            fade.excludeTarget(android.R.id.navigationBarBackground,true);
    
            getWindow().setEnterTransition(fade);
            getWindow().setExitTransition(fade);
    

    This will exclude the animation from the navigation and status bar, So no more blinking

提交回复
热议问题