drpout / boilr

Price alarms for Bitcoin, cryptocurrencies, cryptoassets, futures and options.
http://boilr.mobi
GNU General Public License v3.0
128 stars 67 forks source link

Use a costum picker to input update interval and time frame duration #60

Open dllud opened 9 years ago

dllud commented 9 years ago

Right now update interval and time frame inputs use an EditText where the user must write the number of seconds or minutes respectively. If the user wants to set a long period she is forced to do some math in her head (e.g. for a 12 min update interval she has to write 720 s).

I was planning to use an adaptation of the Android TimePicker. timepicker On the rightmost wheel there would be the words seconds, minutes, hours, days and weeks. On the left one there would be numbers: 1-59 for seconds and minutes, 1-23 for hours, 1-6 for days and 1-52 for weeks. However @algazarra noticed that such wouldn't allow the input of values like 1.5 min. Furthermore, most users, not knowing they can do a long click on the number and use the numeric keypad, will spend a tedious time scrolling numbers back and forth.

Therefore I purpose an adaptation of DeskClock's TimerSetupView. deskclock-timersetup In update interval input it would look just like the screenshot above. For the time frame the fields would be W (weeks), H (hours) and M (minutes).

Please comment.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

algazarra commented 9 years ago

Looks good to me. Awesome solution. Still, i gotta say i'm concerned with the interface and aesthetic coherence.

dllud commented 9 years ago

I just gave a deep look into how to implement this.

Perfect Universe Plan

android-betterpickers has a HMS Picker that can be modified to support DHM besides HMS. First I would merge it with CyanogenMod 12 DeskClock TimerSetupView that already has double-digit hours support (fixes derekbrameyer/android-betterpickers#34). On top of this I would implement DHM and perhaps other options: HM (as requested on derekbrameyer/android-betterpickers#74), MWD, YMW, etc. I would grab the final result and open a merge request on android-betterpickers to give it back to the community.

The BIG problem

android-betterpickers requires the huge Android Support Library v4. Using it would more than double Boilr's apk size (current boilr-0.5.0.apk: ~750 KiB; android-support-v4.jar: ~970 KiB). As Boilr targets API 11, and perhaps even higher in the near future, it is possible to implement a HMS Picker without Support Library v4. Fortunately, there are plans to drop v4 on betterpickers: derekbrameyer/android-betterpickers#73.

Our options

a) Create our own library: cherry pick HMS Picker from android-betterpickers, port it to API 11 or 16, add DHM and others, publish the library for community benefit. b) Wait until @derekbrameyer goes full minSdkVersion 15 on android-betterpickers and implement on top of that.

My decision

As this feature is marked as bells and whistles I'll avoid the huge workload of option a) and go for b) instead. In the meantime, if user requests start to pile up, I may reconsider a).

dllud commented 9 years ago

The HMS picker suffers from an usability issue when one tries to input something like 10H 00M 00S. Notice the user would have to click 0 five times. We can mitigate this with: a) A 00 button. b) Allowing a click on a given field (e.g. H) to set it directly (@algazarra suggestion).

I bet the user will spend a long time until noticing she can click on a field. Thus I am tending towards the 00 button.

algazarra commented 9 years ago

b) Allowing a click on a given field (e.g. H) to set it directly

Actually, my first instinct was trying to input directly to a given field. It felt frustrating having to manually input all the zeros.

Although the double 0 would work, it seems a "patch" and not a clean long term solution. You know?