Commit graph

92 commits

Author SHA1 Message Date
Marcel Admiraal 76c1a0e91d
Fix unchecked call to put() warning in GodotInputHandler.java
(cherry picked from commit 8270e101a7)
2021-07-06 11:10:44 +02:00
Marcel Admiraal 1ed89353b0 Remove unused imports from Android Java code 2021-07-02 14:41:57 +01:00
Marcel Admiraal 96e56af9b9 Remove redundant interface modifiers from Android Java code 2021-07-02 09:41:09 +01:00
Rémi Verschelde c7c93355e3
Merge pull request #49436 from madmiraal/add-android-external-dir-3.x
[3.x] Add OS.get_external_data_dir() to get Android external directory
2021-06-10 18:24:21 +02:00
Marcel Admiraal 6d63ccba31 Add OS.get_external_data_dir() to get Android external directory 2021-06-10 16:48:37 +01:00
Marcel Admiraal cdba79ca72 Remove unused AudioDriverAndroid from Android 2021-06-10 08:31:23 +01:00
Rémi Verschelde 80e1585a6e
Style: Cleanup uses of double spaces between words
Or after punctuation. Tried to leave third-party stuff alone, unless it has
been heavily modified for Godot.

(cherry picked from commit c1c76850cb)
2021-06-07 12:06:59 +02:00
Rémi Verschelde e96f0ea1d7
Android: Remove non-functional native video OS methods
Those methods are only properly implemented for iOS.

Supersedes #43811.
2021-05-07 16:42:17 +02:00
bruvzg dab4cf3ed6
Add physical_scancode (keyboard layout independent keycodes) to InputEventKey and InputMap.
Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
2021-05-06 23:19:45 +03:00
Rémi Verschelde b5e1e05ef2
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
Rémi Verschelde 3d15f04668
Style: clang-format: Disable AllowShortIfStatementsOnASingleLine 2021-05-04 14:45:15 +02:00
Fredia Huya-Kouadio bc68872e2d Disable the requestLegacyExternalStorage attribute when there are no storage permissions. 2021-04-16 07:26:24 -07:00
Fredia Huya-Kouadio dedeada310 Fix issue causing the response callback to be invoked with the invalid requestCode. 2021-04-09 13:38:36 -07:00
Fredia Huya-Kouadio 14e7f6fa7c Fix onMainRequestPermissionsResult callback for Android plugins. 2021-03-17 09:30:19 -07:00
Fredia Huya-Kouadio 864f4201b9
Enable doNotStrip when doing development/debugging within Android Studio
(cherry picked from commit 4380004176)
2021-03-17 15:17:02 +01:00
Fredia Huya-Kouadio 94df08aae1 Leverage java annotations to simplify the logic used to register the Godot plugin methods. 2021-03-16 01:20:43 -07:00
Fredia Huya-Kouadio c5fb32d594 Update the logic to load Godot Android plugins packaged into the binary.
The previous logic had the side effect of imposing a limit of one plugin per `aar` binary. The update lifts that restriction.
2021-02-26 09:09:40 -08:00
Fredia Huya-Kouadio 65eb5fdf1e Update the initialization timeline for the Godot fragment to be more consistent with the previous activity based timeline.
(cherry picked from commit 3ce7678374)
2021-02-25 15:14:32 +01:00
Fredia Huya-Kouadio 9fb5215db5 Add logic to record the version of the Godot engine for the Android platform.
(cherry picked from commit bc5120eb97)
2021-02-25 15:14:32 +01:00
Fredia Huya-Kouadio 96a3f01ac5
Add missing ndkVersion to the library gradle build config.
(cherry picked from commit 9418197081)
2021-02-18 10:37:59 +01:00
Fredia Huya-Kouadio 64f5a7b8ca Expose GodotPlugin's utility methods used for registration and signal emitting.
This enables creation and use of a plugin like class by composition rather than inheritance.
2021-02-15 15:57:36 -08:00
Michael Conrad 8777282c40 Fix joystick axis mapping issues with NVIDIA shield. Probably others.
Issues addressed:

a) Axis mappings were including virtual mouse axes on NVIDIA Shield TV.

The virtual mouse axes have the same axis numbers as the normal analog stick numbers. This was completely breaking joypad support on NVIDIA Shield TV.

b) Joypads were being tracked in a List with the index in the list being treated as the Godot device id.

If a device were to be removed, any device later in the list would be shifted, potentially causing future events with the shifted joypads to have incorrect IDs according to the Godot engine.

c) Unnecessary events were being sent to the Godot engine.

A check was added (per Joystick) that will prevent sending events for all axes when only a single axis value changed.
A similar check was added for "HATs".

See #45712
2021-02-09 08:33:42 -05:00
zaevi 56535539d4
add search extensions for scons' path
(cherry picked from commit befbfecd4d)
2021-02-02 13:02:47 +01:00
Rémi Verschelde 49646383f1
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆

(cherry picked from commit b5334d14f7)
2021-01-13 16:17:06 +01:00
Rémi Verschelde 188609e5ab
CI: Update to clang-format 11 and apply ternary operator changes
(cherry picked from commit af878716f2)
2021-01-13 16:14:35 +01:00
alan-w-255 cbda02991f fix android wrong multi-touch pointerid 2020-11-27 16:46:21 +08:00
Vaughan Ling 7a9660e8d2
Change android orientations from sensor to user
# Conflicts:
#	platform/android/java/lib/src/org/godotengine/godot/GodotIO.java

(cherry picked from commit d658063833)
2020-11-17 12:01:59 +01:00
Fredia Huya-Kouadio 566835e181
Update the logic to query for the 'scons' command executable path.
(cherry picked from commit 46cc3233d8)
2020-11-17 12:01:59 +01:00
Mark Riedesel 92ff6c5164 Implement OS.get_screen_orientation() for Android 2020-11-13 10:14:06 -05:00
thebestnom 8405f1225e [3.2] Android: Keyboard modifier and arrow key support 2020-11-13 15:10:17 +02:00
Fredia Huya-Kouadio 835d4535b7
Add a separate nativeSrcsConfigs module to handle Android Studio constraints for native code editor support.
(cherry picked from commit edf762fba6)
2020-11-11 15:30:56 +01:00
thebestnom 191c84f952 Android: Mouse Implementation
Implement mouse
Move touch to inputManager
Change to use android/input.h
2020-10-30 15:23:29 +02:00
Mark Riedesel 2bec10fd1c Implement OS.get_window_safe_area() for Android 2020-10-27 11:52:20 -04:00
Rémi Verschelde fc50d5b38c
Merge pull request #42186 from m4gr3d/3.2-android-subview
[3.2] Godot Android Subview Implementation
2020-09-27 20:05:33 +02:00
Fredia Huya-Kouadio 8d9733f90c Add overridable init method for the Godot fragment instance. 2020-09-18 16:45:46 -07:00
Fredia Huya-Kouadio e99dc65b64 Enable the ability to use Godot as a subview within an Android app
(cherry picked from commit 920639511d)
2020-09-18 16:45:40 -07:00
Aman Jain ee9127bd20 Create strings.xml files to mimic behavior of _fix_resources method 2020-09-18 16:17:27 -07:00
Fredia Huya-Kouadio a8240f7351 Fix issue causing the textedit to move upward 2020-08-18 17:05:23 -07:00
Rémi Verschelde 5972495d99 Revert "Virtual keyboard size adjustment fixes"
Also reverts "[3.2] Move PopupWindow logic to GodotEditText on Android".

This reverts commits 69db38742f and.
ff0ada164b.
2020-08-14 00:32:04 +02:00
PouleyKetchoupp ff0ada164b [3.2] Move PopupWindow logic to GodotEditText on Android 2020-07-28 21:03:55 +02:00
Rémi Verschelde 37bac7d75d
Merge pull request #40672 from nekomatata/virtual-keyboard-height-fix-3.2
[3.2] Virtual keyboard size adjustment fixes
2020-07-27 08:57:52 +02:00
Rémi Verschelde a2edf04fd2
Merge pull request #40469 from nekomatata/virtual-keyboard-enter-fixes-3.2
[3.2] Fix Return key events in LineEdit & TextEdit on Android
2020-07-26 20:26:02 +02:00
PouleyKetchoupp 69db38742f Virtual keyboard size adjustment fixes
1. Disable virtual keyboard focus adjustment on Android
The default adjustment setting was causing the view to pan down in order
to adjust the focus on the text content.
We don't need any focus adjustment since we're using a fixed size window
for our application.
Documentation:
https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_ADJUST_NOTHING

2. Fix virtual keyboard height regression
Disabling virtual keyboard focus adjustement caused get_keyboard_height
to always return 0 because it was calculated when the view is resized.
In order to fix it, a PopupWindow is now created on top of the main view
and is set for focus adjustments so the keyboard size can be calculated
based on this popup without affecting the main view.
2020-07-24 18:26:20 +02:00
Rémi Verschelde b40f3f9740 Style: Sync other changes from new fix_style.sh and clang_format.sh 2020-07-24 10:39:18 +02:00
PouleyKetchoupp c0b394572f Fix Return key events in LineEdit & TextEdit on Android
Depending on the device implementation, editor actions could be
received with different action ids or not at all for multi-line.

Added a parameter to virtual keyboards to properly handle single-line
and multi-line cases in all situations.

Single-line:
Input type set to text without multiline to make sure actions are sent.
IME options are set to DONE action to force action id consistency.

Multi-line:
Input type set to text and multiline to make sure enter triggers new lines.
Actions are disabled by the multiline flag, so '\n' characters are
handled in text changed callbacks.
2020-07-17 18:25:40 +02:00
Rémi Verschelde 0246a1a276 Revert "Enable the ability to use Godot as a subview within an Android app"
This reverts commit 920639511d.

The changes are good, this revert is only done for release management reasons
as we want this feature to get more testing before making it in a stable build,
but a 3.2.3 release is imminent to handle some regressions in 3.2.2.

This will be re-committed in a 3.2-based feature branch, and we'll merge it
again once we're confident about it (probably for 3.2.4).
2020-07-10 08:51:21 +02:00
Fredia Huya-Kouadio 920639511d Enable the ability to use Godot as a subview within an Android app 2020-06-25 19:57:03 -07:00
Fredia Huya-Kouadio 61aa477e1c Clean up the GodotPlugin public API. 2020-06-16 09:24:41 -07:00
Fredia Huya-Kouadio 2e7e3dcfe4 Enable legacy external storage for Android 10 2020-05-27 13:34:40 -07:00
Fredia Huya-Kouadio 06b7f611f8 Provide the ability for clients of the Godot library to add their own command line arguments 2020-05-27 02:12:54 -07:00