Alarmio icon indicating copy to clipboard operation
Alarmio copied to clipboard

Architecture improvements...

Open fennifith opened this issue 4 years ago • 0 comments

I first started writing this app... a while ago. There are some pretty nasty things lurking in its codebase, and to be honest I didn't put a lot of thought into its structure when I was building it. I'm creating this issue as a general todo-list of anything that should be moved, refactored, and reorganized in the future. The plan is to use libraries from Android Jetpack, such as Room and LiveData, as well as a general DI framework like Koin.

  • [x] Move sound/radio player from Application class to injected component
  • [ ] Move sunset time calculator from Application class to injected component
  • [ ] Create common "AlertData" model that alarms & timers inherit from
  • [ ] Make an injected "AlertPlayer" component containing the repeat/vibrate logic from AlarmActivity
  • [ ] *Remove AlarmManager interaction from data models, move scheduling to injected component
  • [ ] *Switch alarm "database" (SharedPreferences, referenced from data models) to Room/SQL
  • [ ] *Implement LiveData / ViewModel classes for UI interaction
  • [ ] Write tests for some functionality (repeat behavior, etc)

* These are pretty heavy tasks and may need to be done all at once, or maintained in a separate branch until complete.

I did start working on some of these in the refactor branch a while ago - but it's a little out of date now, and I'm realizing it'd be better to introduce some of these changes separately. Open to feedback on any of the decisions here.

fennifith avatar May 15 '20 21:05 fennifith