Closed chrisbraucker closed 9 years ago
Regarding widget updates on changes in app, I see two options:
or rather implement the former and add the latter as needed.
The second solution sounds more complex, but better. In case of relapse, I suppose that it wouldn't work if we only update the widget on app load, as the widget would still need to be updated.
Right now, the widget gets updated every time the user closes (pauses) an activity that extends from MainActivity. Meaning: Press the Back or Home button and the widget updates.
Native android widget displaying the current streak, maybe with a 'next achievement' indicator of sorts. The App Widgets developer guide seems to be a good start.
Updating the widget is done via onUpdate(). For this to work, read-only database access is needed to fetch the last relapse date. A single 1x1 scalable widget should suffice, maybe with functionality to start a specific intent on tapping, like entering data/sex/relapse or showing latest stats.