fix(YouTube - SponsorBlock): Fix create new segment crash on tablet custom roms (#3946)

This commit is contained in:
LisoUseInAIKyrios 2024-11-21 09:44:32 +04:00 committed by GitHub
parent 1cb84507d0
commit a0da377ba8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();
} }
} }