mirror of
https://github.com/revanced/revanced-patches
synced 2025-01-15 04:57:41 +01:00
fix(YouTube - SponsorBlock): Fix create new segment crash on tablet custom roms (#3946)
This commit is contained in:
parent
1cb84507d0
commit
a0da377ba8
@ -107,12 +107,13 @@ public final class NewSegmentLayout extends FrameLayout {
|
|||||||
*/
|
*/
|
||||||
private void initializeButton(final Context context, final String resourceIdentifierName,
|
private void initializeButton(final Context context, final String resourceIdentifierName,
|
||||||
final ButtonOnClickHandlerFunction handler, final String debugMessage) {
|
final ButtonOnClickHandlerFunction handler, final String debugMessage) {
|
||||||
final ImageButton button = findViewById(getResourceIdentifier(context, resourceIdentifierName, "id"));
|
ImageButton button = findViewById(getResourceIdentifier(context, resourceIdentifierName, "id"));
|
||||||
|
|
||||||
// Add ripple effect
|
|
||||||
button.setBackgroundResource(rippleEffectId);
|
button.setBackgroundResource(rippleEffectId);
|
||||||
RippleDrawable rippleDrawable = (RippleDrawable) button.getBackground();
|
RippleDrawable rippleDrawable = new RippleDrawable(
|
||||||
rippleDrawable.setColor(rippleColorStateList);
|
rippleColorStateList, null, null
|
||||||
|
);
|
||||||
|
button.setBackground(rippleDrawable);
|
||||||
|
|
||||||
button.setOnClickListener((v) -> {
|
button.setOnClickListener((v) -> {
|
||||||
handler.apply();
|
handler.apply();
|
||||||
@ -121,7 +122,7 @@ public final class NewSegmentLayout extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface ButtonOnClickHandlerFunction {
|
private interface ButtonOnClickHandlerFunction {
|
||||||
void apply();
|
void apply();
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user