From ab49425e4360bef5e520a3fb554e03383aa15b58 Mon Sep 17 00:00:00 2001 From: olly Date: Wed, 14 Sep 2016 12:13:32 -0700 Subject: [PATCH] Fix crash on pre-api-21 devices. The four-arg constructor didn't exist in ViewGroup for earlier API levels. I think it can probably be safely omitted, unless you know otherwise? Issue: #1820 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=133156975 --- .../google/android/exoplayer2/ui/PlaybackControlView.java | 6 +++++- .../google/android/exoplayer2/ui/SimpleExoPlayerView.java | 8 +------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/library/src/main/java/com/google/android/exoplayer2/ui/PlaybackControlView.java b/library/src/main/java/com/google/android/exoplayer2/ui/PlaybackControlView.java index d07f9285552..25a8e1e7160 100644 --- a/library/src/main/java/com/google/android/exoplayer2/ui/PlaybackControlView.java +++ b/library/src/main/java/com/google/android/exoplayer2/ui/PlaybackControlView.java @@ -97,7 +97,11 @@ public PlaybackControlView(Context context) { } public PlaybackControlView(Context context, AttributeSet attrs) { - super(context, attrs); + this(context, attrs, 0); + } + + public PlaybackControlView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); currentWindow = new Timeline.Window(); formatBuilder = new StringBuilder(); diff --git a/library/src/main/java/com/google/android/exoplayer2/ui/SimpleExoPlayerView.java b/library/src/main/java/com/google/android/exoplayer2/ui/SimpleExoPlayerView.java index 1cc7482bce0..390ab2ee7af 100644 --- a/library/src/main/java/com/google/android/exoplayer2/ui/SimpleExoPlayerView.java +++ b/library/src/main/java/com/google/android/exoplayer2/ui/SimpleExoPlayerView.java @@ -64,12 +64,7 @@ public SimpleExoPlayerView(Context context, AttributeSet attrs) { } public SimpleExoPlayerView(Context context, AttributeSet attrs, int defStyleAttr) { - this(context, attrs, defStyleAttr, 0); - } - - public SimpleExoPlayerView(Context context, AttributeSet attrs, int defStyleAttr, - int defStyleRes) { - super(context, attrs, defStyleAttr, defStyleRes); + super(context, attrs, defStyleAttr); boolean useTextureView = false; if (attrs != null) { @@ -86,7 +81,6 @@ public SimpleExoPlayerView(Context context, AttributeSet attrs, int defStyleAttr } LayoutInflater.from(context).inflate(R.layout.exoplayer_video_view, this); - componentListener = new ComponentListener(); layout = (AspectRatioFrameLayout) findViewById(R.id.video_frame); controller = (PlaybackControlView) findViewById(R.id.control);