Commit Graph

61 Commits

Author SHA1 Message Date
KikiManjaro
1282362fce Add color selection to OSC
* Add bold text and antialiasing for osc buttons
* Fix osc dpad and button position (widder than taller)
* Set default OSC color to white background with black text
2023-03-05 12:45:07 +01:00
KikiManjaro
66d2965c63 Fix resetControls for opacity of OSC 2023-03-05 12:45:07 +01:00
lynxnb
cd426d9f18 Split PreferenceSettings into AppSettings and EmulationSettings
`PreferenceSettings` was removed in favor of:
* `AppSettings`: stores general purpose settings mostly used for UI configuration and state
* `EmulationSettings`: stores emulation-related settings, most of these are passed to native emulation code
2023-02-27 19:56:53 +01:00
lynxnb
a1ca84f95e Move Kotlin settings to a dedicate package 2023-02-27 19:56:53 +01:00
Abandoned Cart
b20c6e9fc4 onBackPressed -> onBackPressedDispatcher 2023-02-16 14:50:02 +01:00
german77
9e1c9caa36 input: Fix motion orientation based on phone orientation 2023-02-07 16:16:41 +00:00
german77
56d43a70c0 Implement SixAxis sensor 2023-02-07 16:16:41 +00:00
lynxnb
aa36c591c6 Exclude Home button from controller setup guide 2023-01-11 20:51:18 +00:00
Abandoned Cart
b08fcd7027 Favor a predefined "click" over system vibration 2022-12-10 14:57:33 +00:00
Abandoned Cart
cfd3bfecba Add a rudimentary OSC button vibration setting 2022-12-10 14:57:33 +00:00
lynxnb
163f4f2014 Fix window insets handling when in landscape mode
To avoid code duplication, insets handling has been moved to a separate interface.
2022-11-23 19:49:42 +05:30
lynxnb
b209ae8e90 Account for stick flat area when retrieving axes value from a MotionEvent 2022-11-17 21:54:15 +01:00
lynxnb
c966220bab Zero-initialize axes history instead of using null values
Use zero initialization for axes history instead of using null values. Fixes the first axis event after launching a game being completely ignored.
2022-11-17 21:54:15 +01:00
lynxnb
3a657c44cc Don't ignore HAT axes input events
Capture HAT axes events ourselves instead of relying on the android framework to turn them into KeyCodes. Fixes handling of DPAD button presses on most controllers.
2022-11-17 21:54:15 +01:00
lynxnb
f1ec771944 Fix inverted axis polarity
In the case of axis value being zero, polarity would favor one side of the stick resulting in invalid values. Fix that by taking into account axis history when calculating polarity.
2022-11-17 21:54:15 +01:00
lynxnb
675e8dbb2e Move input handling code to a dedicated class 2022-11-17 21:54:15 +01:00
lybxlpsv
18861d73a3 Set systemUiVisibility during onResume for A11 2022-11-17 14:04:57 +01:00
lynxnb
86364a84a2 Allow content to be drawn behind the navigation bar 2022-11-09 23:07:23 +05:30
lynxnb
f63fdf26c9 Partially revert 'Make all Dialogs use @color/backgroundColor as the background color'
This partially reverts commit 36a1f2a2ec.
2022-11-09 23:07:23 +05:30
lynxnb
cfa5f0e030 Fix OSC alpha not changing on button press 2022-08-20 17:00:40 +02:00
KikiManjaro
3407f6d530 Add OSC opacity adjustment 2022-08-20 13:46:17 +02:00
lynxnb
c4bf92a49f Fix Kotlin compilation errors from incorrect overloading of null-safe types 2022-08-17 12:16:26 +02:00
lynxnb
5b4ca79dc8 Rename Settings Kotlin class to PreferenceSettings
SharedPreferences will be partially swapped out in the future to support per-game settings. In the meantime, make it clear from which class settings are coming from.
2022-07-26 20:16:24 +05:30
PixelyIon
36a7ad06bd Use built-in vibrator by default for controller #0
The vibration device had to be set manually prior which led to it generally not being set at all even though a user might want vibration, this commit fixes that by making controller #0 use the built-in vibrator by default.
2022-04-14 14:14:52 +05:30
lynxnb
08e24915d8 Add support for drawing inside the display cutout areas 2022-04-14 14:14:52 +05:30
PixelyIon
5dea15632c Add Controller Setup Guide
A setup guide for controllers that goes through every available button/stick sequentially and opens up a corresponding dialog to map them.
2022-04-14 14:14:52 +05:30
PixelyIon
e2cae74425 Fix RecyclerView height in CoordinatorLayout for non touch-mode
Any `RecyclerView`s with an app bar in a `CoordinatorLayout` would end up going off-screen due to the layout behavior implementing an offset by using a transform which would not correctly handle focusing on off-screen objects. This has now been fixed by manually adjusting height to be clipped to what is visible on the screen.
2022-04-14 14:14:52 +05:30
PixelyIon
8f0db18624 Fix ControllerActivity Controller Type Change Crash
If the controller type was changed from a type with a larger amount of buttons/axes to one with a fewer amount, a crash would occur due to the transition animation retaining those elements as children yet returning `NO_POSITION` from `getChildAdapterPosition` in `DividerItemDecoration` which was an unhandled case and led to an OOB array access.
2022-04-14 14:14:52 +05:30
PixelyIon
69ef93bfa8 Add Dividers to ControllerActivity's RecyclerView
Dividers after titles were missing in `ControllerActivity` which made it look inconsistent with `SettingsActivity` which did have them. They have now been added by extending `DividerItemDecoration` to be drawn before any `ControllerHeaderItem`.
2021-11-11 20:20:19 +05:30
PixelyIon
36a1f2a2ec Make all Dialogs use @color/backgroundColor as the background color
We wanted the color of the modals used by the dialogs to be the same as our regular background color rather than a lighter grey. This has now been enforced with style attributes in the case of `AlertDialog` and `setBackground` in the case of `BottomSheetDialog`.
2021-11-11 16:34:38 +05:30
lynxnb
df120ab76d Fix unicode characters being turned into emojis for some vendors 2021-11-10 17:41:07 +01:00
PixelyIon
bed9fbf5e7 Fix EmulationActivity.vibrateDevice assert due to null Vibrator
`EmulationActivity.vibrateDevice` would assert when a `null` Vibrator is provided due to one not being set in the controller configuration. This has now been fixed by the code not playing a vibration when a vibration device isn't selected.
2021-11-01 00:28:11 +05:30
PixelyIon
a7548c79a0 Android 12 Support + Update Libraries + Include Khronos Validation Layer
* Fix handling `SA_EXPOSE_TAGBITS` bit being set in Android 12 `sigaction`
* Fix CMake bug using `CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE` when not supported causing `-fuse-ld=gold` to be emitted as a linker flag
* Support using `VIBRATOR_MANAGER_SERVICE` rather than `VIBRATOR_SERVICE` on Android 12
* Optimize Imports for Kotlin code
* Move away from deprecated APIs in Kotlin or explicitly mark where it's not possible
* Update SDK, NDK and libraries
* Enable Gradle Configuration Cache
2021-10-26 10:46:36 +05:30
Willi Ye
bf2e20565f Check if fragment is attached when doing animations 2021-06-17 20:30:22 +05:30
Willi Ye
ce60101989 Filter on screen buttons by controller type 2021-06-17 20:30:22 +05:30
Willi Ye
2ff06d5421 Apply changed layout to all items
* Fix memory leaks
2021-06-17 20:30:22 +05:30
Willi Ye
e50f5a5d72 Make controller layout more preferences like 2021-06-17 20:30:22 +05:30
Willi Ye
8f3390f073 Use activity contracts for callbacks 2021-06-17 20:30:22 +05:30
Willi Ye
479209886b Rework search
* Call search once for all formats
2021-06-17 20:30:22 +05:30
Willi Ye
571e189ecd Make serialVersionUID static
* Some minor cleanup
2021-06-17 20:30:22 +05:30
Willi Ye
dca632d0d8 Correct reset value of global scale 2021-06-17 20:30:22 +05:30
Willi Ye
4b53a3b1a6 Enable full screen on resume
* Fix registering of buttons pairs in OSC with multiple fingers
* Enable OSC by default
* Increased OSC scale by default
2021-06-17 20:30:22 +05:30
Willi Ye
1fae3488ad Add button pairings to allow simultaneous pressing 2021-06-17 20:30:22 +05:30
Willi Ye
696f0c7769 Remove injection in dialog fragments
* Set result code in document activity
2021-06-17 20:30:22 +05:30
Willi Ye
f5d5caf939 Switch to viewbinding and di with hilt 2021-06-17 20:30:22 +05:30
Willi Ye
b12b4df35b Assign recenter setting to osc
* Make handheld/pro controller default for controller id 0
2021-06-17 20:30:22 +05:30
Willi Ye
71ca46fe1a Update dependencies and gradle
* Enable OSC if controller id is 0
* Fix night colors
2021-06-17 20:30:22 +05:30
Willi Ye
9f6a5df5e0 Redesign UI
* Change colors
* Replace toolbar in main activity
* Initial implementation of ViewModel
2021-06-17 20:30:22 +05:30
Willi Ye
f479aeb4ac Add comments 2020-11-12 22:19:55 +05:30
Willi Ye
7526a985fb Use property delegate to handle preferences
* Add option to disable joystick recentering
2020-11-12 22:19:55 +05:30