Skip to content

Commit

Permalink
Fix crash on pre-api-21 devices.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ojw28 committed Sep 14, 2016
1 parent 5512aae commit ab49425
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit ab49425

Please sign in to comment.