arkaic / CalNMacs

Personal Android App for calorie tracking
0 stars 0 forks source link

[Enhance] Allow decimals for food data before displaying to food list page #14

Closed arkaic closed 8 years ago

arkaic commented 8 years ago

Couple of options

"one is to create a custom SimpleCursorAdapter and override setViewText(). in your implementation check if the textview in question is passed and set the view value to what you desire. you have to convert from String to int (or float, what you need) to apply your precision.

another one is to implement SimpleCursorAdapter.ViewBinder, set it as a binder in your adapter's setViewBinder and do your thing in the binder's setViewValue"

http://stackoverflow.com/questions/19212813/simplecursoradapter-modify-data-before-load-into-listview