jherkenhoff / qalculate-android

Powerful and versatile multi-purpose calculator for the Android platform
GNU General Public License v2.0
124 stars 5 forks source link

Autocompletion / Suggestions #27

Open jherkenhoff opened 2 years ago

jherkenhoff commented 2 years ago

When typing an expression, there should be some mechanism of autocompletion.

jherkenhoff commented 1 month ago

I have implemented an early version of autocomplete, as can be seen in the screen recording below:

Screen_recording_20240920_103102.webm

The suggestion algorithm is very dumb and needs improvement. Suggestions should be scored and sorted by quality of match and maybe considering frequently used units/functions etc...

I placed the suggestions over the quick-keys in an attempt to make them easily reachable with the thumb, but I don't know how I feel about it blocking the quick keys. On one hand, its not a problem because the autocomplete suggestions go away when I click on one, but on the other hand I don't always want to have to click on them. For example when entering c*8 (eight times the speed of light), I don't want to bother having to click on the Speed-of-light-suggestion in order to reach my "multiplication quick key" again.

Another option would be to place the autocomplete suggestions as a list over the inpnut bar? But that would block the view on the current result and calculation history, but that might not be too bad?

@ByteHamster, since you are currently the only active contributor, do you have thoughts on this?

ByteHamster commented 1 month ago

Maybe covering the result and history could be a bit more elegant. When hiding it after pressing the "=" key, it shouldn't usually get in the way. However, your current solution looks super nice as well. I'm really looking forward to getting this app released to users. Having the power of calculate on my phone is such a game changer.

By the way, do you also get strange keyboard behavior sometimes? For me, the cursor sometimes jumps or the box gets cleared when it shouldn't. My guess would be that it has something to do with Compose re-layouting it, but I have never worked wirh Compose before.

jherkenhoff commented 4 weeks ago

Thanks for your feedback. I tried it with a list over the "calculation list". Here is a screen recording:

Screen_recording_20240922_115817.webm

I still have no strong opinion about which way to go...

Concerning the weird keyboard behaviour: I have not witnessed this :thinking:

ByteHamster commented 3 weeks ago

I think I like the "calculation list" (more recent video) more :)