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 97b129e088
commit a7fc08a491

View File

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