mirror of
https://github.com/rust-mobile/android-activity.git
synced 2026-07-04 05:47:26 +00:00
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
This commit is contained in:
@@ -52,6 +52,9 @@ fn android_main(app: AndroidApp) {
|
||||
MainEvent::InputAvailable { .. } => {
|
||||
redraw_pending = true;
|
||||
}
|
||||
MainEvent::ConfigChanged { .. } => {
|
||||
info!("Config Changed: {:#?}", app.config());
|
||||
}
|
||||
MainEvent::LowMemory => {}
|
||||
|
||||
MainEvent::Destroy => quit = true,
|
||||
|
||||
Generated
-1
@@ -13,7 +13,6 @@
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
@@ -52,6 +52,9 @@ fn android_main(app: AndroidApp) {
|
||||
MainEvent::InputAvailable { .. } => {
|
||||
redraw_pending = true;
|
||||
}
|
||||
MainEvent::ConfigChanged { .. } => {
|
||||
info!("Config Changed: {:#?}", app.config());
|
||||
}
|
||||
MainEvent::LowMemory => {}
|
||||
|
||||
MainEvent::Destroy => quit = true,
|
||||
|
||||
Reference in New Issue
Block a user