When a soft keyboard's backspace sends KEYCODE_DEL via sendKeyEvent(),
GodotEditText.onKeyDown() delegates to super.onKeyDown() which modifies
the EditText's Editable, triggering beforeTextChanged() in
GodotTextInputWrapper, which then forwards KEYCODE_DEL to the engine.
However, the EditText is only seeded with text up to the cursor position
(mOriginText) when the keyboard opens. Once the user backspaces through
all of that content, the EditText becomes empty. At that point,
super.onKeyDown(KEYCODE_DEL) on an empty EditText makes no change to the
Editable, so beforeTextChanged() never fires and the engine receives no
DEL event — even though the engine's own buffer still has text before
the cursor.
This causes a visible bug: the user can delete characters they typed in
the current session, but backspacing further into pre-existing text does
nothing. Re-tapping the field fixes it temporarily because showKeyboard()
is called again, reseeding the EditText with the current text and cursor
position.
Fixed this by forwarding KEYCODE_DEL directly to the engine when the
EditText is empty, bypassing the TextWatcher path that can't fire in
that state. This produces no double events since beforeTextChanged()
is physically unable to fire on an empty field.
Move DEL release event from onKeyDown to onKeyUp
Kotlin's `==` on the proxy compiles to `proxy.equals(args[0])`, which
the JDK proxy dispatches back through the InvocationHandler, hitting
the same branch and recursing into StackOverflowError. Use `===` for
reference equality, matching the default Object#equals behavior.
Object.hashCode() must return Int (32-bit), but the proxy InvocationHandler
returned godotObjectID directly (Long, 64-bit). When a HashMap-like container
called proxy.hashCode(), the auto-generated proxy did (Integer) result on a
java.lang.Long and threw ClassCastException.
Signed-off-by: Muteem <29696635+Muteem@users.noreply.github.com>
JDK contract: InvocationHandler.invoke's args parameter is null when
the proxied interface method takes no arguments. The proxy handlers
in AndroidRuntimePlugin used `*args` directly, which spread-deref'd
null and threw NullPointerException.
Signed-off-by: Muteem <29696635+Muteem@users.noreply.github.com>
The current obb support was specific to the Google Play store which has deprecated the format in favor on Android bundle and Play asset delivery.
For projects that still have a dependency on the Play store obb support, the deprecated logic has been moved into a separate Godot Obb Android plugin.
Trigger haptic feedback when a long-press gesture fires a right-click
(context menu) in the Android editor. Uses Android's native
`HapticFeedbackConstants.LONG_PRESS` on the render view surface.
An editor setting `interface/touchscreen/haptic_on_long_press` is added
under the existing touchscreen section to allow users to disable this
behavior. The setting defaults to enabled on native touchscreen devices.
This will allow decoupling `display_server.h` from a number of headers in the
codebase which only require those enums and not all the DisplayServer API.
The project is setup in Android Studio with three buildtypes:
- `release` for release builds of the engine
- `debug` for debug builds of the engine with `dev_mode`, `dev_build`, and `debug_symbols` disabled
- `dev` for debug builds of the engine with `dev_mode`, `dev_build`, and `debug_symbols` enabled
This commit deprecates and removes the `dev` buildtype and instead enables `dev_mode`, `dev_build`, and `debug_symbols` for the `debug` buildtype when building with Android Studio.
The `release` buildtype has also been updated such that a `release` build built with Android Studio and signed with non-production keys can be installed side-by-side with a production-signed release (e.g: from the store).
This PR:
- Fixes the orientation detection logic on Android
- Adds an orientation_changed signal in DisplayServer
Co-Authored-By: bruvzg <7645683+bruvzg@users.noreply.github.com>