Skip to content

Commit

Permalink
Make updating showTimeoutMs takes effect immediately.
Browse files Browse the repository at this point in the history
Update PlaybackControlView and SimpleExoPlayerView so when showTimeoutMs is set
while the controller is shown, the new timeout takes effect immediately.

GitHub: google#3554

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179171727
  • Loading branch information
botaydotcom authored and ojw28 committed Dec 15, 2017
1 parent 8e35bff commit bb8c608
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,10 @@ public int getShowTimeoutMs() {
*/
public void setShowTimeoutMs(int showTimeoutMs) {
this.showTimeoutMs = showTimeoutMs;
// showTimeoutMs is changed, so call hideAfterTimeout to reset the timeout.
if (isVisible()) {
hideAfterTimeout();
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,11 @@ public int getControllerShowTimeoutMs() {
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();
}
}

/**
Expand Down

0 comments on commit bb8c608

Please sign in to comment.