mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-11 21:17:47 +01:00
fix(YouTube - Disable suggested video end screen): Properly hide it every time the screen appears
Previously, the screen appeared, which a handler was attached to, in order to hide it again, but the handler was removed again from the same screen, so the next time it appeared, it was not hidden.
This commit is contained in:
parent
847cce43f6
commit
828ff6f31e
@ -21,17 +21,10 @@ public final class DisableSuggestedVideoEndScreenPatch {
|
|||||||
if (lastView == parent) return;
|
if (lastView == parent) return;
|
||||||
|
|
||||||
lastView = (ViewGroup)parent;
|
lastView = (ViewGroup)parent;
|
||||||
lastView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
|
lastView.addOnLayoutChangeListener((v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
|
||||||
@Override
|
// Disable sound effects to prevent the click sound.
|
||||||
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop,
|
imageView.setSoundEffectsEnabled(false);
|
||||||
int oldRight, int oldBottom) {
|
imageView.performClick();
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user