vmiklos / plees-tracker

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

Add DND (Do Not Disturb) Integration #448

Closed MachineThing closed 2 months ago

MachineThing commented 2 months ago

This pull request adds these following changes to the app:

This might not be the perfect way to do this but it does seem to work well for me at least (on emulator and real phone), and this pull request also solves issue #419

vmiklos commented 2 months ago

Hi, this looks quite promising. I like how it defaults to false, so existing happy users are left alone.

Could you please fix up the ktlint problems? See the CI log.

Apart from that, if you could write a paragraph in guide/ about the feature, that would be also useful.

Thanks!

MachineThing commented 2 months ago

Yeah I will soon, I believe the KtLint issues are coming from the fact the lines are too long (that is more than 100 characters long)

If you don't mind can you tell me how I can edit the guide? Thank you!

MachineThing commented 2 months ago

I fixed the KtLint issues and added a small paragraph on the function.

I like how it defaults to false, so existing happy users are left alone.

By the way if your curious it defaults to false because the app needs to ask the user for permissions to make it so the app can turn DND on and off, so it prompts the user to give it permissions when toggled on and the app notices it doesn't have permissions. :smile: