stub FocusFinder to fix crash when pressing arrow keys

Since we now have basic support for keyboard input, new code paths can
be reached. For example in the ViewPager in the MainActivity of NewPipe.
This commit is contained in:
Julian Winkler
2025-01-26 18:27:27 +01:00
parent d0d2a28cef
commit 0091fd6b59
3 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
package android.view;
public class FocusFinder {
public static FocusFinder getInstance() {
return new FocusFinder();
}
public View findNextFocus(ViewGroup root, View focused, int direction) {
return null;
}
}

View File

@@ -0,0 +1,9 @@
package android.view;
public class SoundEffectConstants {
// the typo is part of the API
public static int getContantForFocusDirection(int direction) {
return 0;
}
}

View File

@@ -460,6 +460,7 @@ srcs = [
'android/view/Choreographer.java',
'android/view/ContextThemeWrapper.java',
'android/view/Display.java',
'android/view/FocusFinder.java',
'android/view/GestureDetector.java',
'android/view/HardwareCanvas.java',
'android/view/Gravity.java',
@@ -476,6 +477,7 @@ srcs = [
'android/view/MotionEvent.java',
'android/view/PointerIcon.java',
'android/view/ScaleGestureDetector.java',
'android/view/SoundEffectConstants.java',
'android/view/SubMenu.java',
'android/view/Surface.java',
'android/view/SurfaceHolder.java',