mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-17 23:07:18 +02:00
fix(YouTube - SponsorBlock): Fix create new segment crash on tablet custom roms
This commit is contained in:
parent
e0bdce0c19
commit
654368ffe2
@ -101,12 +101,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(getIdentifier(resourceIdentifierName, ResourceUtils.ResourceType.ID, context));
|
ImageButton button = findViewById(getIdentifier(resourceIdentifierName, ResourceUtils.ResourceType.ID, context));
|
||||||
|
|
||||||
// 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();
|
||||||
@ -115,7 +116,7 @@ public final class NewSegmentLayout extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface ButtonOnClickHandlerFunction {
|
private interface ButtonOnClickHandlerFunction {
|
||||||
void apply();
|
void apply();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user