Neamar / KISS

Lightning fast, open-source, < 250kb Android launcher
https://kisslauncher.com/
GNU General Public License v3.0
2.93k stars 579 forks source link

Add time of day to history modes #2236

Closed jhavens1566 closed 5 months ago

jhavens1566 commented 9 months ago

This feature has been requested a few times that I can see. What this does is add a the time of day as an option for history modes. I used the same style of utilizing a SQLite query to handle the heavy lifting and the resulting code is quite simple, keeping up with the KISS philosophy. It may not be immediately obvious what is happening so I made a desmos graph to show how the one-liner equation performs this here: desmos. The two sliders represent two of the same pojo records with an adjustable time stamp, the chart is adjusted to show 24 days. The black line is the resulting value for that specific pojo record with time being the x axis.

I have been testing this for quite a few days now and it has become my favorite history mode. It combines frecency with time of day since more frequently accessed records tend to transform the triangle wave into a line, and recency since accessing the item just once resets the time decay. For any further questions on how it works please ask! If you end up accepting this I will be happy to update the docs and do some translation work (I can't guarantee translations as I would just utilize one of the many tools to blindly translate).

resolves #2231 resolves #1523

TBog commented 9 months ago

This looks interesting. I'll test it out to see if I find it useful even if I don't think I use apps at regular intervals.

jhavens1566 commented 9 months ago

Sounds good to me. On the first day it acts most like getHistoryByRecency(), then is gets more interesting after 24 hours, unless you already have history populated in your debug build.

marunjar commented 9 months ago

nice one, i like it. it's working fine here

JewayD commented 8 months ago

Hello, I posted the #2231 issue. I'm very grateful you worked on a solution. Sorry for my newbie question - I don't know about coding - how do you get it working ? Or maybe should I patiently wait for an update via F-Droid ?

jhavens1566 commented 8 months ago

@JewayD It would be a lenghty process if you've never done it, but you can clone my fork and open the project in android studio and then build it targeting your phone. Not sure to what level you need instruction on how to do that. If you havent for example ever used adb it may take some learning.

JewayD commented 8 months ago

@JewayD It would be a lenghty process if you've never done it...

@jhavens1566 I had not planned that... but I think I'll have a try and learn how to use Android Studio... Thank you anyway

marunjar commented 8 months ago

Pretty interesting how repetitive app usage is. However, this worked really well for me over last 2 weeks.

Only thing i would eventually tweak is range of 24 days. That is long and I already have some calls in history that just won't go away. But thats only a personal feeling.

I think it will be my prefererred history mode from now on, so can be merged IMO.

Any other thoughts on this?

jhavens1566 commented 8 months ago

The decay rate goes at 1 hour per day. So i figured to just go with 24 days as the final cutout since that means that history item would be buried at the bottom anyway. Maybe it should be calculated and based on a setting for decay rate?

marunjar commented 8 months ago

But thats only a personal feeling.

not necessesary just because of me 😉

jhavens1566 commented 8 months ago

Maybe we'll see what others think then.

I should add I also didnt want it to decay away too fast because there are some possible weekly repetative tasks. Having it buried at max 7 hours deep didnt seem too bad for weekend vs weekday tasks.

racuna commented 7 months ago

"Adapted to user" history mode remembers the last 36 hours. Should be better to make adjustable by the user?. e.g. 72 hours (3 days) so on mondays, the launcher remembers what was opened last friday.

How this applies here when also the time of the day is a part of the variables to manage?

jhavens1566 commented 7 months ago

Anything else needed to merge this?