mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-21 10:03:55 +00:00
fix(YouTube - SponsorBlock): Fix create new segment crash on tablet custom roms (#3946)
This commit is contained in:
committed by
GitHub
parent
97b129e088
commit
a7fc08a491
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user