Add explicit TargetApi annotation to remove lint error

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136597149
This commit is contained in:
olly 2016-10-19 08:18:48 -07:00 committed by Oliver Woodman
parent 3a5cb43541
commit 586e6257cd

View file

@ -15,6 +15,7 @@
*/
package com.google.android.exoplayer2.ui;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.SystemClock;
@ -351,13 +352,18 @@ public class PlaybackControlView extends FrameLayout {
private void setButtonEnabled(boolean enabled, View view) {
view.setEnabled(enabled);
if (Util.SDK_INT >= 11) {
view.setAlpha(enabled ? 1f : 0.3f);
setViewAlphaV11(view, enabled ? 1f : 0.3f);
view.setVisibility(VISIBLE);
} else {
view.setVisibility(enabled ? VISIBLE : INVISIBLE);
}
}
@TargetApi(11)
private void setViewAlphaV11(View view, float alpha) {
view.setAlpha(alpha);
}
private String stringForTime(long timeMs) {
if (timeMs == C.TIME_UNSET) {
timeMs = 0;