* Remove unused code
* Make measurement key available as a static field as well
* Move enable logic to base class
* State dependency explicitly in all measurement views
* Add new class to keep track of settings for a measurement view
* Use new settings class to get hold of estimation settings
* Move handling of estimation/percentage enabled to base class
* Remove unused imports
* Update to c29dea32
* Refactor measurement settings
- Make it possible to disable all measurements (except weight). Fixes
#226 and fixes#224.
- Add separate preference screens to all measurements to configure
e.g. if the measurement should be displayed in the overview graph
(this fixes#225 in a different way compared to previously), if
relative or absolute weight should be used etc.
- Include reordering of measurements in the main measurement
preference screen.
* Store empty values for measurements that aren't enabled
* Move dependency handling to settings class
This way it can check dependencies in isEnabled() as well.
* Don't set auto values if measurement is disabled
* Fix initial switch value
* Use instanceof instead of comparing name string
The resource id for the name string should not be known by users of MeasurementView.
* Move measurement on graph settings to settings class
It takes time to open the soft input and with the new inc/dec buttons
it should not be needed as much. If needed it is quickly summoned by
clicking the input view.
Also it doesn't look nice when the phone is in horizontal mode as then
the soft input takes up the whole screen and one has to push back to
get to the inc/dec buttons.
See discussion in #222.
If weight is updated and some measurements are shown as absolute
values, but saved as percentages, then we must re-save them using the
new weight. Otherwise the measurements will change without actually
having changed.
* Add inc and dec buttons to the dialog for quickly doing small
adjustments in the same way as in activity.
* Improve "next" measurement behavior by not recreating the whole
dialog and instead update the icon, title, view and buttons.
When exporting a file to a directory that already has a file with the
same name, android adds " (1)" to the filename. If limiting type to
text/* when picking file to import, then it's not possible to select
that file.
By forcing transactions to run before creating new fragment we don't
end up with two fragments due to selectDrawerItem being called twice
during creation.
Fixes#175