Search code examples
androiddecimalnumberpicker

Double (decimal) Number Picker for daily weight tracking - Android


I've been researching this for hours with no progress.
I need an easy user interface to enter daily weight.
I'm trying to avoid an EditText interface for it lacking in the user experience.
My FitnessPal, for example, has exactly what I am looking for.
MyFitnessPal's weight input
The Android number picked seems hard wired for integers. If it allows for double variables, I can't figure out how to make it work.
Any help is appreciated.


Solution

  • I ended up using two separate number pickers (integer), aligning them side by side, and placing a TextView "period" between them -- to give the appearance of a double variable. Then in the java, I converted them to doubles, performed some math and was able to get my number. Maybe not the most efficient, but it worked.