mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-18 03:13:34 +00:00
Android todo example: cleanup console output and remove warning
This commit is contained in:
parent
4243040453
commit
f495235b74
2 changed files with 3 additions and 4 deletions
|
|
@ -110,7 +110,6 @@ fn android_main(app: i_slint_backend_android_activity::AndroidApp) {
|
|||
use i_slint_backend_android_activity::android_activity::{MainEvent, PollEvent};
|
||||
slint::platform::set_platform(Box::new(
|
||||
i_slint_backend_android_activity::AndroidPlatform::new_with_event_listener(app, |event| {
|
||||
eprintln!("Got event: {event:?}");
|
||||
match event {
|
||||
PollEvent::Main(MainEvent::SaveState { saver, .. }) => {
|
||||
STATE.with(|state| -> Option<()> {
|
||||
|
|
@ -156,7 +155,7 @@ struct SerializedState {
|
|||
|
||||
#[cfg(target_os = "android")]
|
||||
impl SerializedState {
|
||||
fn restore(mut self, state: &State) {
|
||||
fn restore(self, state: &State) {
|
||||
state.todo_model.set_vec(self.items);
|
||||
state.main_window.set_hide_done_items(self.hide_done);
|
||||
state.main_window.set_is_sort_by_name(self.sort);
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ Below is an example of how to set up your `Cargo.toml`:
|
|||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
slint = { version = "1.3.0", ... }
|
||||
i-slint-backend-android-activity = { version = "=1.3.0", features = ["native-activity"] }
|
||||
slint = { version = "1.3.2", ... }
|
||||
i-slint-backend-android-activity = { version = "=1.3.2", features = ["native-activity"] }
|
||||
```
|
||||
|
||||
As with any application using `android-activity`, you need to implement the `android_init` function as `#[no_mangle]`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue