Commit 586e6257 by olly Committed by Oliver Woodman

Add explicit TargetApi annotation to remove lint error

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136597149
parent 3a5cb435
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
package com.google.android.exoplayer2.ui; package com.google.android.exoplayer2.ui;
import android.annotation.TargetApi;
import android.content.Context; import android.content.Context;
import android.content.res.TypedArray; import android.content.res.TypedArray;
import android.os.SystemClock; import android.os.SystemClock;
...@@ -351,13 +352,18 @@ public class PlaybackControlView extends FrameLayout { ...@@ -351,13 +352,18 @@ public class PlaybackControlView extends FrameLayout {
private void setButtonEnabled(boolean enabled, View view) { private void setButtonEnabled(boolean enabled, View view) {
view.setEnabled(enabled); view.setEnabled(enabled);
if (Util.SDK_INT >= 11) { if (Util.SDK_INT >= 11) {
view.setAlpha(enabled ? 1f : 0.3f); setViewAlphaV11(view, enabled ? 1f : 0.3f);
view.setVisibility(VISIBLE); view.setVisibility(VISIBLE);
} else { } else {
view.setVisibility(enabled ? VISIBLE : INVISIBLE); view.setVisibility(enabled ? VISIBLE : INVISIBLE);
} }
} }
@TargetApi(11)
private void setViewAlphaV11(View view, float alpha) {
view.setAlpha(alpha);
}
private String stringForTime(long timeMs) { private String stringForTime(long timeMs) {
if (timeMs == C.TIME_UNSET) { if (timeMs == C.TIME_UNSET) {
timeMs = 0; timeMs = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment