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

This commit is contained in:
inotia00 2024-12-08 11:52:02 +09:00
parent e0bdce0c19
commit 654368ffe2

View File

@ -101,12 +101,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(getIdentifier(resourceIdentifierName, ResourceUtils.ResourceType.ID, context));
ImageButton button = findViewById(getIdentifier(resourceIdentifierName, ResourceUtils.ResourceType.ID, context));
// 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();
@ -115,7 +116,7 @@ public final class NewSegmentLayout extends FrameLayout {
}
@FunctionalInterface
public interface ButtonOnClickHandlerFunction {
private interface ButtonOnClickHandlerFunction {
void apply();
}
}