Progress Bar Visibility reset after I start interacting with UI when using motion layout

前端 未结 2 1880
礼貌的吻别
礼貌的吻别 2021-01-14 18:02

ConstraintLayout version: 2.0.0-alpha3

So I am using MotionLayout I wanted to create something similar to this. https://blog.stylingandroid.com/motionlayout-collapsi

相关标签:
2条回答
  • 2021-01-14 18:14

    I've managed to get a work around for this issue until alpha4 is released.

    In my use case I have a button which is normally only shown when a list is in end it mode. So to keep it hidden when the list isn't in edit mode I'm changing the constraints based on the edit mode.

     private void enableDoneButton(boolean enabled){
        int visibility = enabled ? View.VISIBLE : View.GONE;
        ConstraintSet startSet = container.getConstraintSet(R.layout.fragment_menu);
        startSet.setVisibility(R.id.fab_done, visibility);
    }
    

    Hope this helps in the meantime.

    0 讨论(0)
  • 2021-01-14 18:25

    The bug is now fixed! Go and live your merry life without any visibility glitches :)

    For future readers: This was known bug in MotionLayout where the state reset when the user touched something. Nicolas is talking about this around here: https://youtu.be/r8cYDlBOPaA?t=2276

    The team fixed it in Alpha 4.

    0 讨论(0)
提交回复
热议问题