Created
August 22, 2018 08:37
-
-
Save Anrimian/83310c8ab2e2bbba51e83e6d99b64315 to your computer and use it in GitHub Desktop.
This file contains 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
import android.support.constraint.motion.MotionLayout; | |
import android.support.v4.view.ViewCompat; | |
public class MotionLayoutUtils { | |
public static void setProgress(MotionLayout motionLayout, float progress) { | |
if (ViewCompat.isLaidOut(motionLayout)) { | |
motionLayout.setProgress(progress); | |
} else { | |
motionLayout.post(() -> motionLayout.setProgress(progress)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment