klimeryk / garmodoro

Pomodoro for Garmin devices using Connect IQ
GNU General Public License v3.0
86 stars 23 forks source link

App will exit if swap right #11

Open Cianid opened 5 years ago

Cianid commented 5 years ago

Hi. The app is awesome.But there is one main problem wich can be fixed:App will exit if swap right.Looks like it doesn't work fully asynchronous. Is it possible to fix quick?Thanks!

klimeryk commented 5 years ago

Thanks for reporting! Which device have you experienced this on? What's the expected outcome? I can put the app in "background" on my Fenix 3 HR (by holding the Down button), but the thing is that's very device-dependent and Garmin did not make it consistent across devices - some support this, some don't. And apparently some have a right swap that should do that as well?

Cianid commented 5 years ago

Hi Igor.Thank you for your quick response. My device is Vivoactive 3.I was expecting switch to watch face without exiting(cancellation of current pomodoro iterations) from the application.However, when I get back to application I need to start iterations from the beginning.

klimeryk commented 5 years ago

And do other custom applications behave this way? (they go into background) Unfortunately, I only have a Fenix 3 HR to test on (and it does not truly support background apps the way Vivoactive 3 does, I think) - and the simulator that Garmin is only good for testing the main app, but not like how the app behaves on the actual watch when it comes to putting it into background, etc. So I'm not sure if I'll be able to fix this quickly.

Cianid commented 5 years ago

I will be appreciated if you will fix it. But even if you are not able to fix it ,thanks in any way. Have a nice day!May be you can show me the code line(where this behaviour is handled) of your sources?When I have time, I can try to fix it myself and properly test it on my device.

klimeryk commented 5 years ago

Sorry for the slow follow-up.

So, the thing is, the app doesn't have any custom handling for the onBack event: https://github.com/klimeryk/garmodoro/blob/master/source/GarmodoroDelegate.mc#L79

It just removes the view and essentially kills the app. It used to not do that (https://github.com/klimeryk/garmodoro/commit/b1bf89d8b900085cb02aec5f1c72d95a810e19aa#diff-bcae12df46cf81c5c2ed68100b370ced), but that created problems with other devices.

tompropst commented 5 years ago

@klimeryk, this is something I would also like to see.

And do other custom applications behave this way?

The activity apps that are preinstalled (like the Run, Bike, etc.) keep their state after onBack. I have another app (Stopwatch) that uses the onBack for app functions instead of Ui.SLIDE_RIGHT. To go to the watch face, you press the hardware button (I'm not sure what event this is). The app keeps its state in this case.

I'm not familiar with the Garmin SDK. Is it possible to put the app in background as you do on the Fenix 3 with the down button (not present on the Vivoactive 3) when the onBack event occurs (and on the button press)?

klimeryk commented 5 years ago

I agree that it'd be great if it behaved consistently across devices, unfortunately it's something that can only be tested when having a physical device (the simulator does not support this), so I'm limited to the Fenix 3 HR I own. That's why I default to the device-specific way of handling this. On Fenix 3 HR it works as expected. There are also new possibilities with newer versions of IQ, but that would in turn limit the number of devices this would run on and that's a big no-go in my book.

In https://github.com/klimeryk/garmodoro/commit/84b088b60834d5fe4eceae62eb0571ae6d4da0d4, I've added showing the current time always in-app. That should fix the biggest reason IMHO to put the app in background. Hope that will lessen the impact of this issue!

epnasis commented 7 months ago

I have similar issue as reported with my Garmin MK3i 51mm. Any plans to have Pomodoro run in the background? Ideally with glance show it's status?