[Internal] Use AnimatorSet#playTogether without workarounds on API 23+#4601
[Internal] Use AnimatorSet#playTogether without workarounds on API 23+#4601pubiqq wants to merge 1 commit intomaterial-components:masterfrom
Conversation
576b39e to
4f3cbfe
Compare
4f3cbfe to
e19e242
Compare
e19e242 to
c2fcc12
Compare
| Animator animator = items.get(i); | ||
| totalDuration = Math.max(totalDuration, animator.getStartDelay() + animator.getDuration()); | ||
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | ||
| Api23Impl.playTogether(animatorSet, items); |
There was a problem hiding this comment.
I think we can just inline the system call to be more accurate in semantics? (Like, it's not a "compat" impl.)
There was a problem hiding this comment.
From a semantic standpoint, there is no significant difference between "for API ≥ 23, we invoke the platform implementation" and "for API ≥ 23, we invoke the implementation for API ≥ 23 (Api23Impl), which is the platform implementation". Even in the sample from the official guidelines, the platform method is called through an intermediate class.
But if you really want to, sure, you can edit my implementation and inline the platform call directly. Moreover, you can even remove all Api*Impl entirely and just use the platform call, like this:
@RestrictTo(Scope.LIBRARY_GROUP)
public class AnimatorSetCompat {
public static void playTogether(@NonNull AnimatorSet animatorSet, @NonNull List<Animator> items) {
animatorSet.playTogether(items);
}
}since the library no longer supports platforms prior to Marshmallow.
No description provided.