Commit bb8c6087 by hoangtc Committed by Oliver Woodman

Make updating showTimeoutMs takes effect immediately.

Update PlaybackControlView and SimpleExoPlayerView so when showTimeoutMs is set
while the controller is shown, the new timeout takes effect immediately.

GitHub: #3554

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179171727
parent 8e35bffc
......@@ -519,6 +519,10 @@ public class PlaybackControlView extends FrameLayout {
*/
public void setShowTimeoutMs(int showTimeoutMs) {
this.showTimeoutMs = showTimeoutMs;
// showTimeoutMs is changed, so call hideAfterTimeout to reset the timeout.
if (isVisible()) {
hideAfterTimeout();
}
}
/**
......
......@@ -613,6 +613,11 @@ public final class SimpleExoPlayerView extends FrameLayout {
public void setControllerShowTimeoutMs(int controllerShowTimeoutMs) {
Assertions.checkState(controller != null);
this.controllerShowTimeoutMs = controllerShowTimeoutMs;
// If controller is already visible, call showController to update the controller's timeout
// if necessary.
if (controller.isVisible()) {
showController();
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment