Skip to content

Commit 2ed12aa

Browse files
committed
Change buildGestureListener visibility to protected for Java subclass access
1 parent f0108ca commit 2ed12aa

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/ui/MainPlayerUi.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,12 @@ public void setupAfterIntent() {
146146
}
147147
}
148148

149+
// `protected` matches the visibility declared in VideoPlayerUi.kt. The Kotlin parent used to
150+
// declare this as `internal`, which the Kotlin compiler mangles to a JVM-private name that
151+
// Java cannot see, so this class could not compile. Changing to `protected` gives the method
152+
// a stable, unmangled JVM name accessible from Java subclasses.
149153
@Override
150-
BasePlayerGestureListener buildGestureListener() {
154+
protected BasePlayerGestureListener buildGestureListener() {
151155
return new MainPlayerGestureListener(this);
152156
}
153157

app/src/main/java/org/schabi/newpipe/player/ui/PopupPlayerUi.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,11 @@ public void setupAfterIntent() {
101101
initPopupCloseOverlay();
102102
}
103103

104+
// Same reason as MainPlayerUi: `protected` is required so this Java class can override the
105+
// method declared in the Kotlin parent (VideoPlayerUi). Using `internal` in Kotlin produces
106+
// a mangled JVM name that Java subclasses cannot reference.
104107
@Override
105-
BasePlayerGestureListener buildGestureListener() {
108+
protected BasePlayerGestureListener buildGestureListener() {
106109
return new PopupPlayerGestureListener(this);
107110
}
108111

0 commit comments

Comments
 (0)