TypedArray doesn't implement AutoCloseable on older devices so .use{} caused a crash.
It turned out the special handling for background colours was unnecessary anyway.
- Switch from ActivityResultContracts.GetContent() to OpenDocument()
which restores ACTION_OPEN_DOCUMENT behavior, granting write access
to file descriptors opened in C++ via ContentHandler.openFd().
- Replace unsafe force-unwraps (!!) in EmulationActivity with null checks.
- Improve the column measurement logic so it updates the column width when text changes.
- Use matchParentSize on the clickable target in OutlinedBox so that it is clickable when the OutlinedBox contains contents with dynamic height.
Using dual core during netplay seems sufficiently detrimental that its worth showing this warning message and the option to turn dual core off when starting netplay.
Custom composable that switched between compact and medium size app bar depending on a combination of orientation and screen size. (Small app bar when horizontal on small devices, medium app bar otherwise. Medium app bar supports collapse on scroll.
Previously we would vibrate for 100 ms on every vibration, which was
especially annoying if a game was doing a bunch of vibrations that were
supposed to be much shorter than that. Now we tell Android to vibrate
for 10 s, then cancel the vibration as soon as the game turns the
vibration off.
This lets rumble work even if the user has turned off the Android
setting Sound and vibration > Vibration and haptics > Interactive
haptics > Touch feedback. Rumble can still be disabled through Dolphin's
controller bindings and through in-game settings (GameCube) or SYSCONF
(Wii).
Now SerialInterfaceManager::UpdateDevices reads the configured SI
devices directly from Config instead.
The main reason why I wanted to do this is so that Android can change SI
devices while emulation is running. (Android didn't have the code for
calling ChangeDevice.) But when implementing the change, I noticed that
NetPlay and Movie were using ChangeDevice as a way of overriding the SI
devices configured by the user. Replacing this ended up making the change
larger than I first anticipated.
For Wii Remotes, there was no equivalent to ChangeDevice, so NetPlay and
Movie were using Config::SetCurrent to override the Wii Remote source
configured by the user. If we can use the config system to override Wii
Remote sources, why not do the same for SI devices? This commit makes
NetPlay and Movie set SI devices and Wii Remote sources in the NetPlay
and Movie config layers, as that is the conceptually appropriate place
to do it.
As far as I can tell, the old Movie code for overriding SI devices and
Wii Remote sources didn't actually work. This new code does. I didn't
investigate exactly why it didn't work, but maybe it's because loading
a movie happens before emulation actually starts.
NetplayScreen was not drawing under the bottom nav bar like other screens. In landscape mode half of the screen scrolls and half is fixed, to make this look natural with edge to edge, provide a fade on the bottom of the scrolling side so things look natural when the screens loads and is resting at 0 scroll offset.
To avoid using dual pane layout on very small devices, ensure that the current width available for display is at least medium (600dp).
It also has to be landscape, the dual pane mode looks weird on a tablet in portrait mode since there's not that much content.
We just about get away with using a StateFlow in NetplaySession since the host sends AbortGameDigest when closing their own dialog. Without that it would be harder for the UI to distinguish between subsequent dialogs. If that wasn't the case then NetplaySession might need to expose the individual progress and result updates and have the view model assemble it into the overall GameDigestProgress.