Last active
March 8, 2019 10:49
-
-
Save jossiwolf/37753bb1af051860d7f8d836e17fd29e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Helper class for [MotionLayout.TransitionListener] which provides Android Support Annotations and proper parameter names | |
*/ | |
abstract class TransitionListener: MotionLayout.TransitionListener { | |
/** | |
* Called when a transition has been completed | |
*/ | |
override fun onTransitionCompleted(view: MotionLayout, @IdRes constraintSetId: Int) = Unit | |
/** | |
* Called when a [KeyTrigger] is triggered | |
*/ | |
override fun onTransitionTrigger(view: MotionLayout, @IdRes triggerId: Int, isPositive: Boolean, progress: Float) = Unit | |
/** | |
* Called when a transition has been started | |
*/ | |
@Deprecated("This is not being called due to a bug in MotionLayout. This will be fixed in Alpha 4 (hopefully).") | |
override fun onTransitionStarted(view: MotionLayout, @IdRes startConstraintSetId: Int, @IdRes endConstraintSetId: Int) = Unit | |
/** | |
* Called when the transition or its progress changes | |
*/ | |
override fun onTransitionChange(view: MotionLayout, @IdRes startConstraintSetId: Int, @IdRes endConstraintSetId: Int, progress: Float) = Unit | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment