15 Commits

Author SHA1 Message Date
Robert Bragg 649b65c0c0 Update examples
- Updates deps
- Some README updates considering the Winit backend based on
  android-activity has been merged upstream
- runs cargo fmt over examples
- Top-level Cargo.toml simply excludes "examples" instead of
  listing each sub-directory separately
2022-11-10 19:28:01 +00:00
Robert Bragg e8ae198653 Update example deps + update for latest winit branch
The winit based examples no longer have an explicit dependency on
android-activity and they instead consume the `android-activity` API via
the Winit crate so there's no need to keep the versions synchronized.
2022-10-22 21:51:27 +01:00
Robert Bragg 47afecda36 Release 0.4.0-beta 2022-09-20 02:56:05 +01:00
Robert Bragg 17f0c674c0 Don't ignore Cargo.lock files for examples 2022-09-20 00:41:21 +01:00
Robert Bragg 7cdb77eca4 Let applications report if they handled input events
The callback given to `AndroidApp::input_events()` is now expected to return
`InputStatus::Handled` or `InputStatus::Unhandled`.

When running with NativeActivity then if we know an input event hasn't been
handled we can notify the InputQueue which may result in fallback
handling.

Although the status is currently ignored with the GameActivity backend.

Since this is a breaking change that also affects the current Winit
backend this updates the winit based examples to stick with the 0.3
release of android-activity for now.

Fixes: #31
2022-09-20 00:14:38 +01:00
Robert Bragg a654f72f62 Expose the application Configuration by reference
This provides an API to access `Configuration` state for the application
without having to make deep copies of the large `Configuration` struct.

This should avoid the need for Winit to create a global static copy of
the Configuration whenever it changes - and instead it can just get
a `ConfigurationRef` which will always reflect the latest config for
the application.

Fixes: #5
2022-08-14 11:02:22 +01:00
Robert Bragg 7a77402279 native-activity: Fix InputAvailable support
"native-activity" builds were recently broken by bb8eeb705c which
this patch fixes.

The na-mainloop example has also been updated to verify this by
reducing the fake "render" timeout and also triggering a fake
render when an InputAvailable event is received.

Fixes: #12
2022-08-12 02:08:44 +01:00
Robert Bragg 0d0c10ebb2 Runs cargo fmt across everything 2022-08-11 23:16:55 +01:00
Robert Bragg 73a1acb3c7 examples: bump gradle-wrapper to fetch gradle-7.5-bin.zip 2022-08-11 03:12:33 +01:00
Robert Bragg b63b5e15fa Update READMEs 2022-07-03 23:34:25 +01:00
Robert Bragg 2264826535 Update examples to use android_activity 2022-07-03 22:18:46 +01:00
Robert Bragg d4459921b9 Remove global android_app() API
android_main() now takes an `app: AndroidApp` argument and has an
extern "Rust" ABI instead of "C" ABI.

This should help make it possible to run multiple native Activities in a
single process.
2022-07-03 22:18:45 +01:00
Robert Bragg 5d38fdf593 A few minor simplifications of the *-mainloop examples 2022-05-25 22:27:53 +01:00
Robert Bragg 2f3dbf12a6 add android:configChanges to manifests + remove some unused xml 2022-05-23 01:43:03 +01:00
Robert Bragg 19784d95e3 Add minimal mainloop example based on NativeActivity 2022-05-20 04:07:23 +01:00