Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to enable sleep timer based on current time #6384

Merged
merged 15 commits into from Apr 15, 2023

Conversation

mueller-ma
Copy link
Contributor

This is useful if you want to enable the sleep timer at night automatically.

Closes #6122

@mueller-ma mueller-ma force-pushed the sleep-timer-time-based branch 3 times, most recently from 44bf71e to ddcacc0 Compare March 18, 2023 10:01
This is useful if you want to enable the sleep timer at night automatically.

Closes AntennaPod#6122
@ByteHamster
Copy link
Member

For reference, here is a screenshot that shows the new dialog.

To be honest, I'm not 100% happy with the UX design. I wonder if we can somehow combine this with #5226, changing the wording slightly.

I'm not fully happy with my design either. @keunes do you have an idea?

@keunes
Copy link
Member

keunes commented Apr 2, 2023

Hello,
From the original request to auto-activate in #2085:

I often forget to enable a sleep timer in the evening and when I wake up in the morning my half queue has been played

Given that the original request was just one person (no thumb-ups) who forgot to enable it in a specific timeframe, I think we should not have 2 separate settings but integrate the timeslot into the existing setting.

Yes, that will make it hard for folks to always activate sleep timer. But no-one really ever requested always-on. And combining the two settings will make it easier to understand.

About the wording & UX: I think I would do a simple text, plus button to adjust timings:

  • "Automatically activate the sleep timer when pressing play between HH:MM and HH:MM" (which should respect AM/PM settings).
  • Then the button below could say 'change times'. Tapping on which then opens a dedicated interface.

That way we avoid a very bulky sleep timer modal when this setting is activated.

The modal to change the time could be similar to what OrganicMaps has:
https://user-images.githubusercontent.com/11229646/229357656-2a59b3ea-e54e-44d3-b61c-543788a00236.mp4

(Or something more fancy that visually represents the period as in your sketches.)

@ByteHamster
Copy link
Member

I would do a simple text, plus button to adjust timings

How about replacing the "change times" button with a cogwheel icon on the right of the checkbox?

The checkbox text could then also be changed automatically between "Automatically activate the sleep timer when pressing play between HH:MM and HH:MM" and "Automatically activate the sleep timer when pressing play" (when from=to)

@keunes
Copy link
Member

keunes commented Apr 2, 2023

How about replacing the "change times" button with a cogwheel icon on the right of the checkbox?

That would be an option, but I fear that it is not clear enough. If the setting is not active the button can of course be greyed out. And the button can be text-only.

The checkbox text could then also be changed automatically

Yes, that could be nice to have.

@ByteHamster
Copy link
Member

I fear that a textual button would make the dialog more complex. At least in the current state of the PR, the button somehow takes more "focus" on the dialog than I would want it to have. The icon would be more "calm" and not distract users who are not interested in the feature.

@mueller-ma
Copy link
Contributor Author

I updated the UI to have the dialog less bulky:

grafik
grafik
grafik

The time picker changes to am/pm based on the locale.

@keunes
Copy link
Member

keunes commented Apr 2, 2023

I fear that a textual button would make the dialog more complex. At least in the current state of the PR, the button somehow takes more "focus" on the dialog than I would want it to have.

Note that I'm referring to a pure 'text button' (which, basically, acts like a link). It doesn't have a container, so really doesn't make the dialog complex.
button styles

Looking at the new screenshots, I would change it indeed from an 'outlined' to a 'text' button. I would also make it start-aligned (same starting point as the text - i.e. right from the checkbox).

@mueller-ma
Copy link
Contributor Author

mueller-ma commented Apr 2, 2023

Looking at the new screenshots, I would change it indeed from an 'outlined' to a 'text' button.

Done

grafik

I would also make it start-aligned (same starting point as the text - i.e. right from the checkbox).

Not sure if that's easily possible, because the checkbox and its label is one view. I could align it left from the checkbox, but that looks worse than center aligned.

@ByteHamster
Copy link
Member

I just pushed a very first proof-of-concept for a time range picker. I think it is more convenient than the two individual time pickers (especially since the normal pickers are extremely bulky and force you to deal with minute-level precision). Maybe you can use my proof-of-concept as a starting point for a full implementation :)

@mueller-ma
Copy link
Contributor Author

Your picker only allows to set hours. Is this something you want to keep? For me personally it's fine and reduces some code in SleepTimerPreferences.

@ByteHamster
Copy link
Member

Anything more than an accuracy of 15 minutes feels like an overkill, and I think full hours should be enough. That also makes the dialog more manageable because of the larger steps.

@keunes
Copy link
Member

keunes commented Apr 4, 2023

Maybe we can allow half hours or 15 minutes? (Without adding stripes/indicators to the circle)

Other question: is it possible to swipe one point 'over'the other? E.g., for the example above; I keep the three as is, but swipe the other from 9 to 1 (to get the period from 1-3 active)?

If not: what happens if the two dots are on top of each-other - can you move both ways or just 1?

Lastly: is it possible to have no period active? E.g., for the example above; I move the point on 9 to exactly 3 – what happens? Will I then have the 'automatic on' setting active while it's not doing anything because I selected time always off? (I think this should not be possible and we should always require minimum 1 step between the two points.)

@antennapod-bot
Copy link

This pull request has been mentioned on AntennaPod Forum. There might be relevant details there:

https://forum.antennapod.org/t/automatically-set-sleep-timer/2907/2

@mueller-ma
Copy link
Contributor Author

mueller-ma commented Apr 5, 2023

is it possible to swipe one point 'over'the other? E.g., for the example above; I keep the three as is, but swipe the other from 9 to 1 (to get the period from 1-3 active)?

Yes, that's possible.

what happens if the two dots are on top of each-other - can you move both ways or just 1?

You can then move one dot in both directions.

Lastly: is it possible to have no period active? E.g., for the example above; I move the point on 9 to exactly 3 – what happens? Will I then have the 'automatic on' setting active while it's not doing anything because I selected time always off? (I think this should not be possible and we should always require minimum 1 step between the two points.)

It will disable the "time based" part of this setting:

grafik

@ByteHamster
Copy link
Member

Now, by default, we have a checkbox called "Automatically activate the sleep timer when pressing play" and a button called "Change times" next to it. That feels a bit weird. At that point, there are no times to be changed, so it is not clear what the button does. With a cogwheel icon instead of the text button, this would be more clear.

@keunes
Copy link
Member

keunes commented Apr 7, 2023

Now, by default, we have a checkbox called "Automatically activate the sleep timer when pressing play" and a button called "Change times" next to it. That feels a bit weird.

I think we should set a sane default that works for most people. E.g. 23:00-04:00

A cogwheel without much context is confusing also. Setting a default will showcase what the feature can (is intended to) be used for.

@mueller-ma
Copy link
Contributor Author

Where's the place where you set default preferences in the app?

@ByteHamster
Copy link
Member

There is no global place, it's just the second argument when loading from the preferences.

@ByteHamster ByteHamster changed the title Add option to enabled sleep timer based on current time Add option to enable sleep timer based on current time Apr 12, 2023
@ByteHamster ByteHamster merged commit 0bdf9d9 into AntennaPod:develop Apr 15, 2023
7 checks passed
@ByteHamster
Copy link
Member

Thanks, will be in 3.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to auto-enable sleep timer within a specific time of day
4 participants