Files
kryon/tests/android_device_host.zi
T
waozi edf71b9de0 Give text fields a numeric mode with a number keyboard
TextFieldProps.numeric accepts only the digits 0-9 for typed, pasted and
input-method text, and asks the platform for a number keyboard: Android
receives it through setTextInputState, which now takes (JJ[BIIZZZ)V with
numeric before multiline, and the web editor sets inputmode=numeric.

The Android device test host also stubs SetMouseOffset, which
android_surface has needed since 468d6326, so the text editor test links
again.
2026-10-12 19:10:37 -03:00

128 lines
2.3 KiB
Ziran

// Host stubs for the Android device behavior test: the raylib JNI surface
// stays absent and the platform keyboard effect records calls instead of
// reaching Java.
#import "android_jni"
#import "android_surface"
#import "session"
keyboard_calls: s32;
keyboard_visible: bool;
#program_export
SetPlatformTextKeyboardVisible :: (session: Session, visible: bool) {
unused session
keyboard_calls += 1
keyboard_visible = visible
}
#program_export
GetAndroidApp :: () -> *NativeAndroidApp {
return null
}
activity_finish_calls: s32;
#program_export
ANativeActivity_finish :: (activity: *void) {
unused activity
activity_finish_calls += 1
}
#program_export
GetScreenWidth :: () -> s32 {
return 1080
}
#program_export
GetScreenHeight :: () -> s32 {
return 1920
}
#program_export
SetMouseOffset :: (x: s32, y: s32) {
unused x
unused y
}
#program_export
GetWindowHandle :: () -> *void {
return null
}
#program_export
ANativeWindow_getFormat :: (window: *void) -> s32 {
unused window
return 1
}
#program_export
ANativeWindow_setBuffersGeometry :: (window: *void, width: s32,
height: s32, format: s32) -> s32 {
unused window
unused width
unused height
unused format
return 0
}
#program_export
ANativeWindow_getWidth :: (window: *void) -> s32 {
unused window
return 1080
}
#program_export
ANativeWindow_getHeight :: (window: *void) -> s32 {
unused window
return 1920
}
#program_export
rlViewport :: (x: s32, y: s32, width: s32, height: s32) {
unused x
unused y
unused width
unused height
}
#program_export
rlMatrixMode :: (mode: s32) {
unused mode
}
#program_export
rlLoadIdentity :: () {
}
#program_export
rlGetMatrixProjection :: () -> SurfaceMatrix {
matrix: SurfaceMatrix
return matrix
}
#program_export
rlOrtho :: (left: float64, right: float64, bottom: float64,
top: float64, near: float64, far: float64) {
unused left
unused right
unused bottom
unused top
unused near
unused far
}
#program_export
ClearBackground :: (color: SurfaceColor) {
unused color
}
#program_export
DrawRectangle :: (x: s32, y: s32, width: s32, height: s32,
color: SurfaceColor) {
unused x
unused y
unused width
unused height
unused color
}