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
  • Loading branch information
inotia00 authored and anddea committed Dec 11, 2024
1 parent fb65526 commit 58b5fbf
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,13 @@ private void setupDragHandle() {
*/
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();
Expand All @@ -153,7 +154,7 @@ private void initializeButton(final Context context, final String resourceIdenti
}

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

0 comments on commit 58b5fbf

Please sign in to comment.