mirror of
https://github.com/revanced/revanced-patches
synced 2025-01-14 20:37:31 +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,
|
||||
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);
|
||||
RippleDrawable rippleDrawable = (RippleDrawable) button.getBackground();
|
||||
rippleDrawable.setColor(rippleColorStateList);
|
||||
RippleDrawable rippleDrawable = new RippleDrawable(
|
||||
rippleColorStateList, null, null
|
||||
);
|
||||
button.setBackground(rippleDrawable);
|
||||
|
||||
button.setOnClickListener((v) -> {
|
||||
handler.apply();
|
||||
@ -121,7 +122,7 @@ public final class NewSegmentLayout extends FrameLayout {
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
public interface ButtonOnClickHandlerFunction {
|
||||
private interface ButtonOnClickHandlerFunction {
|
||||
void apply();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user