Skip to content

Commit

Permalink
fix(YouTube - SponsorBlock): Fix create new segment crash on tablet c…
Browse files Browse the repository at this point in the history
…ustom roms (#3946)
  • Loading branch information
LisoUseInAIKyrios authored Nov 21, 2024
1 parent 1cb8450 commit a0da377
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ public NewSegmentLayout(final Context context, final AttributeSet attributeSet,
*/
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();
Expand All @@ -121,7 +122,7 @@ private void initializeButton(final Context context, final String resourceIdenti
}

@FunctionalInterface
public interface ButtonOnClickHandlerFunction {
private interface ButtonOnClickHandlerFunction {
void apply();
}
}
}

0 comments on commit a0da377

Please sign in to comment.