Blinking screen on image transition between activities

后端 未结 12 2253
温柔的废话
温柔的废话 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

    Make some method in helper like

    public static Transition makeEnterTransition() {
        Transition fade = new Fade();
        fade.excludeTarget(android.R.id.navigationBarBackground, true);
        fade.excludeTarget(android.R.id.statusBarBackground, true);
        return fade;
    }
    

    Execute it in the activity that you are starting like this

    getWindow().setEnterTransition(TransitionUtils.makeEnterTransition());
    

    Source https://github.com/alexjlockwood/custom-lollipop-transitions/

提交回复
热议问题