android / codelab-constraint-layout

Constraint Layout Codelab
https://codelabs.developers.google.com/codelabs/constraint-layout/
Apache License 2.0
471 stars 242 forks source link

2.0 beta-3 issue onTransitionCompleted never called #74

Open Only-IceSoul opened 4 years ago

Only-IceSoul commented 4 years ago

onTransitionCompleted never called using TransitionToEnd/start, i am changing motion progress with scroll offset.

Code OnTouchListener:

if(event.actionMasked == MotionEvent.ACTION_MOVE) { motionLayout.progress = offsetProgress }

if(event.actionMasked == MotionEvent.ACTION_UP) {

            if (motionLayout.progress < 1f && motionLayout.progress > 0) {
                if (motionLayout.progress > 0.5f) {

                    motionLayout.transitionToEnd()

                } else {
                    // to start
                    motionLayout.transitionToStart()
                }
            }