Fix UI menu not dismissing on API level 22 and earlier
Issue: #8272 #minor-release PiperOrigin-RevId: 347010412
This commit is contained in:
parent
2accb41ef6
commit
94e745872d
@ -28,6 +28,10 @@
|
|||||||
* Forward `Timeline` and `MediaPeriodId` to `TrackSelection.Factory`.
|
* Forward `Timeline` and `MediaPeriodId` to `TrackSelection.Factory`.
|
||||||
* UI:
|
* UI:
|
||||||
* Miscellaneous fixes for `StyledPlayerControlView` in minimal mode.
|
* Miscellaneous fixes for `StyledPlayerControlView` in minimal mode.
|
||||||
|
* 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)).
|
||||||
* Show overflow button in `StyledPlayerControlView` only when there is not
|
* Show overflow button in `StyledPlayerControlView` only when there is not
|
||||||
enough space.
|
enough space.
|
||||||
* Update StyledPlayer's control overlay scrim from 30% opacity to 60%
|
* Update StyledPlayer's control overlay scrim from 30% opacity to 60%
|
||||||
|
@ -30,7 +30,9 @@ import android.annotation.SuppressLint;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
@ -671,6 +673,11 @@ public class StyledPlayerControlView extends FrameLayout {
|
|||||||
settingsView.setLayoutManager(new LinearLayoutManager(getContext()));
|
settingsView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||||
settingsWindow =
|
settingsWindow =
|
||||||
new PopupWindow(settingsView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true);
|
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);
|
settingsWindow.setOnDismissListener(componentListener);
|
||||||
needToHideBars = true;
|
needToHideBars = true;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user