diff --git a/app/src/main/java/app/revanced/integrations/patches/DisableSuggestedVideoEndScreenPatch.java b/app/src/main/java/app/revanced/integrations/patches/DisableSuggestedVideoEndScreenPatch.java index 8b04a192..117238cd 100644 --- a/app/src/main/java/app/revanced/integrations/patches/DisableSuggestedVideoEndScreenPatch.java +++ b/app/src/main/java/app/revanced/integrations/patches/DisableSuggestedVideoEndScreenPatch.java @@ -21,17 +21,10 @@ public final class DisableSuggestedVideoEndScreenPatch { if (lastView == parent) return; lastView = (ViewGroup)parent; - lastView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { - @Override - public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, - int oldRight, int oldBottom) { - // Disable sound effects to prevent the click sound. - imageView.setSoundEffectsEnabled(false); - imageView.performClick(); - - // Remove the listener to prevent it from being called multiple times. - lastView.removeOnLayoutChangeListener(this); - } + lastView.addOnLayoutChangeListener((v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> { + // Disable sound effects to prevent the click sound. + imageView.setSoundEffectsEnabled(false); + imageView.performClick(); }); } }