Skip to content

Instantly share code, notes, and snippets.

@Anrimian
Created August 22, 2018 08:37
Show Gist options
  • Save Anrimian/83310c8ab2e2bbba51e83e6d99b64315 to your computer and use it in GitHub Desktop.
Save Anrimian/83310c8ab2e2bbba51e83e6d99b64315 to your computer and use it in GitHub Desktop.
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