vicolo-dev / chrono

A modern and powerful clock, alarms, timer and stopwatch app for Android!
GNU General Public License v3.0
316 stars 14 forks source link

Add option to open specific page when opening from widgets #243

Open th23x opened 2 months ago

th23x commented 2 months ago

Describe the bug Great to have to option for a default page eg "Alarms" to be opened when launching Chrono - thanks for adding 👍

The function works as expexted when the app is previously closed - not open anymore in the recent apps overview. But it doesn't bring/show the set default page when the app was still open "in the background".

To Reproduce Steps to reproduce the behavior:

  1. Set "alarms" as default page
  2. Navigate to "timers" page
  3. Move to Android start screen - ie Chrono gets hidden but runs in the background
  4. Click the app icon or (new) widget
  5. Chrono comes the the foreground but shows the "timers" page, not the default "alarms"

Expected behavior Show default page once regaining focus

Screenshots n/a

Smartphone Information

Additional context Add any other context about the problem here.

AhsanSarwar45 commented 2 months ago

I don't think that would be desirable behavior. If you are doing something on one page, go to another app, and come back, you should continue where you left off rather than being suddenly taken back to default page.

But I can add another setting like 'Open default tab on focus' or something like that if someone does want this functionality.

th23x commented 2 months ago

Now that you mention I am not sure anymore...

Loosing / getting focus is potentially too much for forcing the default page again.

I stubled upon the idea when clicking on the new widget and expecting to get to the default.

AhsanSarwar45 commented 2 months ago

Maybe a setting to open a specific page when launched from the widget. In the future when we might have stopwatch or timer widgets, they would ofcourse open the relevant pages when clicked. Maybe it might be desirable to control which page to open when clicking on clock widget too.

th23x commented 2 months ago

Yes, indeed... In case there are more widgets coming, potentially a setting in each widget "action on click" would be great with the options:

Sounds like a good idea - and target user expectation as good as possible.

woj-tek commented 2 months ago

I had a kinda similar request (or maybe it's a bug?) that widget tap should always open the last visible tab. So I was somewhat confused by this issue because in my case:

1) tap on widget - it opens alarms 2) go to timers 3) hit back to exit the app

Taping on widget always open "Alarms" page.

Now, if I use "home" button instead of "back" then the widget always open last page.

For me keeping the focus and always opening last visible page is the desired behaviour

th23x commented 2 months ago

Interesting...usually not using the back button.

But of course, if it ends the app, afterwards returns to the default tab. While home button keeps the focus.

Maybe with many people and different desires for behavior best is an option per widget. And add "last open" option to the default page settings.

woj-tek commented 2 months ago

But of course, if it ends the app, afterwards returns to the default tab. While home button keeps the focus.

But app may be ended even when using home-button (OS kill)?

Maybe with many people and different desires for behavior best is an option per widget. And add "last open" option to the default page settings.

I think that would be ideal but possibly complicates the logic...

AhsanSarwar45 commented 1 month ago

But app may be ended even when using home-button (OS kill)?

If you press the back button to close app, thats kills the app. I think its the standard way in android. So when you open it again, it starts the app and should send you to the default page.

If you press the home button, that is supposed to minimize the app (send it to background). So when you open it again, it should send you where you left off.

Ofcourse if the app is minimized for a long duration, the system kills it to save battery and resources. Opening it again will take you to the default page.

All this is handled by the system and I don't think there is much to be controlled there. What we can control is the following 3 behaviors:

woj-tek commented 1 month ago
  • What happens when app is cold started (current behavior is to open default page. We can add an option to remember the last page and reopen that)

+1 on this one for me - it could be applied to all use cases (i.e. remember last page).

  • What happens when app is maximized from background (current behavior is to continue where you left off, and I think it should stay that way)

Minimised?

Indeed, making sure that the page is remembered would be a good idea (handling of OS killing the app, but again (1) with remembering last page should handle this one as well?)

  • What happens after app opens by clicking on widget or notification (this should open the relevant user defined page), irrespective of whether the app was minimized or killed.

This could be somewhat usefull but I'm not sure it's all that essential.

When to think about it currently the problem is the lack of consistency - sometimes the app main page, other times (either different button or long time no use) different page.

th23x commented 1 month ago

Would agree with @AhsanSarwar45 on the default Android handled cases.

For the 3 cases user definable:

What happens when app is cold started (current behavior is to open default page. We can add an option to remember the last page and reopen that)

Adding an option "rember last page used" sounds really good 👍

What happens when app is maximized from background (current behavior is to continue where you left off, and I think it should stay that way)

Agree, other than my original idea - because flipping between apps to eg ensure right timing for an alarm might by tricky

What happens after app opens by clicking on widget or notification (this should open the relevant user defined page), irrespective of whether the app was minimized or killed.

Would be great to allow some choices per widget, but personally with having the option "last tab open" in general, for me fine - as this in 95% cases for me would be what I expect, as I use most the alarms.