vmiklos / plees-tracker

Plees Tracker is a simple sleep tracker for your Android phone.
https://vmiklos.hu/plees-tracker/
MIT License
151 stars 38 forks source link

Feature Request: Sleep rating #28

Closed Narcolapser closed 3 years ago

Narcolapser commented 3 years ago

I tried to do this on my own and submit a pull request, but alas, I'm new to Kotlin (I normally code in Python or Java, thought I could hack it.) So I was unable to achieve my objective: Simple 1-5 rating for sleep.

The (non-privacy respecting/add riddled) sleep apps I've used in the past usually all have a simple 1-5 (though usually in half or quarter steps) star rating system. I find this momentary reflection on my sleep to be valuable in tracking the over all quality of my sleep. I can't imagine it would be to hard to implement, but the compiler yelled at me when I tried so I'm submitting a feature request instead.

vmiklos commented 3 years ago

How would the UI look for this? Do I press the stop button and if I opt in (new setting), I get to rate using a "popup"?

Narcolapser commented 3 years ago

yea, that's usually what I've seen. These apps usually have a phony-baloney sleep graph (makes guesses when you might be in deep sleep. As my name suggests, I'm narcoleptic, for medical reasons I know what my sleep cycle looks like) with an option of stars below. The idea with those is a kind of review of your slumber before you give a manual input for a review.

Drawing from that, to provide user context I think the snapshot review is a good idea. I'm not sure how Kotlin works but if you could just take that same display card that is used to display "past sleeps" and display that, it would give me a moment to think "yea, that sleep and wake time looks right" see how much I slept and then punch one of the 5 stars below. The confirm behavior would be a good question. It seems silly to have to click a star and then click ok, but I think since your finger covers the stars when you press it could lead to problems of fat fingering and cause frustration, while a confirm button would feel pretty normal.

vmiklos commented 3 years ago

I did a bit of research: so the android UI has a rating bar for this:

https://developer.android.com/reference/android/widget/RatingBar

it would be possible to show the rating below the "slept for" row for each sleep. This could be 0 stars by default, and then you can set it to something useful by tapping on the stars.

This also means I need to extend the DB schema to store the rating, but it seems that's not too complex:

https://developer.android.com/training/data-storage/room/migrating-db-versions

This has the benefit that there is no annoying / interrupting popup and I don't have to add more settings, either.

Narcolapser commented 3 years ago

yea, I get not wanting the popup, This sounds good to me.

vmiklos commented 3 years ago

This is now fixed on master. I'll also cut a new release in the next few days for those who install from fdroid.

vmiklos commented 3 years ago

v7.0.0 is now released, should show up in fdroid in a couple of days.

Narcolapser commented 3 years ago

You are awesome!