Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
fix(Hide player buttons patch): Override on click listener
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios committed Oct 16, 2024
1 parent 694aacf commit f7b8249
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ private static void hideButton(View parentView, int resourceId) {
} else {
Logger.printDebug(() -> "Hiding previous/next button");
Utils.hideViewBy0dpUnderCondition(true, nextPreviousButton);

// Button is no longer visible, but the click listener needs to be cleared otherwise
// the button can still be pressed even though it's 0dp.
//
// The listener is added after this hook in the same target method.
// To keep thing simple, the listener can be cleared on a deferred main thread call.
Utils.runOnMainThread(() -> nextPreviousButton.setOnClickListener(null));
}
} catch (Exception ex) {
Logger.printException(() -> "hideButton failure", ex);
Expand Down

0 comments on commit f7b8249

Please sign in to comment.