Skip to content

Commit

Permalink
Fix UI menu not dismissing on API level 22 and earlier
Browse files Browse the repository at this point in the history
Issue: #8272
PiperOrigin-RevId: 347010412
  • Loading branch information
ojw28 authored and icbaker committed Jan 11, 2021
1 parent a028ce8 commit 3a0b1f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

### 2.12.3 (???-??-??) ###

* UI:
* Fix issue where pop-up menus belonging to `StyledPlayerControlView`
would not be dismissed when tapping outside of the menu area or pressing
the back button, on API level 22 and earlier
([#8272](https://github.com/google/ExoPlayer/issues/8272)).
* IMA extension:
* Fix a condition where playback can get stuck before an empty ad
([#8205](https://github.com/google/ExoPlayer/issues/8205)).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Looper;
import android.util.AttributeSet;
Expand Down Expand Up @@ -673,6 +675,11 @@ public StyledPlayerControlView(
settingsView.setLayoutManager(new LinearLayoutManager(getContext()));
settingsWindow =
new PopupWindow(settingsView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true);
if (Util.SDK_INT < 23) {
// Work around issue where tapping outside of the menu area or pressing the back button
// doesn't dismiss the menu as expected. See: https://github.com/google/ExoPlayer/issues/8272.
settingsWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
}
settingsWindow.setOnDismissListener(componentListener);
needToHideBars = true;

Expand Down

0 comments on commit 3a0b1f7

Please sign in to comment.