mirror of
https://github.com/samsonjs/media.git
synced 2026-04-16 13:05:46 +00:00
Don't call Drawable.setLayoutDirection pre-API-23
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=174323423
This commit is contained in:
parent
233a1d165f
commit
9abc1d2974
1 changed files with 6 additions and 4 deletions
|
|
@ -250,9 +250,7 @@ public class DefaultTimeBar extends View implements TimeBar {
|
|||
try {
|
||||
scrubberDrawable = a.getDrawable(R.styleable.DefaultTimeBar_scrubber_drawable);
|
||||
if (scrubberDrawable != null) {
|
||||
if (Util.SDK_INT >= 23) {
|
||||
scrubberDrawable.setLayoutDirection(getLayoutDirection());
|
||||
}
|
||||
setDrawableLayoutDirection(scrubberDrawable, getLayoutDirection());
|
||||
defaultTouchTargetHeight =
|
||||
Math.max(scrubberDrawable.getMinimumHeight(), defaultTouchTargetHeight);
|
||||
}
|
||||
|
|
@ -519,7 +517,7 @@ public class DefaultTimeBar extends View implements TimeBar {
|
|||
|
||||
@Override
|
||||
public void onRtlPropertiesChanged(int layoutDirection) {
|
||||
if (scrubberDrawable != null && scrubberDrawable.setLayoutDirection(layoutDirection)) {
|
||||
if (scrubberDrawable != null && setDrawableLayoutDirection(scrubberDrawable, layoutDirection)) {
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
|
@ -753,6 +751,10 @@ public class DefaultTimeBar extends View implements TimeBar {
|
|||
return (int) (dps * displayMetrics.density + 0.5f);
|
||||
}
|
||||
|
||||
private static boolean setDrawableLayoutDirection(Drawable drawable, int layoutDirection) {
|
||||
return Util.SDK_INT >= 23 && drawable.setLayoutDirection(layoutDirection);
|
||||
}
|
||||
|
||||
public static int getDefaultScrubberColor(int playedColor) {
|
||||
return 0xFF000000 | playedColor;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue