From fd10a3cbb02ab41ef643e9cced40140bb79c6c1b Mon Sep 17 00:00:00 2001 From: olly Date: Wed, 31 Jan 2018 15:22:35 -0800 Subject: [PATCH] Fix initial visibility of PlayerControlView This applies when PlayerControlView is used as a standalone component (not inside PlayerView). Previously hideAtMs was set to 0, which caused the view to be immediatley hidden in onAttachedToWindow. After this change the first time the view is attached to the window is effectively treated as a "user interaction" for the purposes of deciding when to timeout. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=184056324 --- .../com/google/android/exoplayer2/ui/PlayerControlView.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java index 2613ad023e..63c791d166 100644 --- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java +++ b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java @@ -271,6 +271,7 @@ public class PlayerControlView extends FrameLayout { fastForwardMs = DEFAULT_FAST_FORWARD_MS; showTimeoutMs = DEFAULT_SHOW_TIMEOUT_MS; repeatToggleModes = DEFAULT_REPEAT_TOGGLE_MODES; + hideAtMs = C.TIME_UNSET; showShuffleButton = false; if (playbackAttrs != null) { TypedArray a = @@ -937,6 +938,8 @@ public class PlayerControlView extends FrameLayout { } else { postDelayed(hideAction, delayMs); } + } else if (isVisible()) { + hideAfterTimeout(); } updateAll(); }