-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add option to enable sleep timer based on current time #6384
Conversation
44bf71e
to
ddcacc0
Compare
This is useful if you want to enable the sleep timer at night automatically. Closes AntennaPod#6122
ddcacc0
to
c2b72a7
Compare
core/src/main/java/de/danoeh/antennapod/core/preferences/SleepTimerPreferences.java
Outdated
Show resolved
Hide resolved
Hello,
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:
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: (Or something more fancy that visually represents the period as in your sketches.) |
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) |
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.
Yes, that could be nice to have. |
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. |
8a32052
to
d69175f
Compare
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. 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). |
Done
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. |
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 :) |
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 |
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. |
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.) |
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 |
Yes, that's possible.
You can then move one dot in both directions.
It will disable the "time based" part of this setting: |
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. |
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. |
Where's the place where you set default preferences in the app? |
There is no global place, it's just the second argument when loading from the preferences. |
app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceTest.java
Outdated
Show resolved
Hide resolved
core/src/main/java/de/danoeh/antennapod/core/preferences/SleepTimerPreferences.java
Outdated
Show resolved
Hide resolved
core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java
Outdated
Show resolved
Hide resolved
Thanks, will be in 3.1.0 |
This is useful if you want to enable the sleep timer at night automatically.
Closes #6122