md: add widget module to ARCHITECTURE

Add documentation on the widget module to ARCHITECTURE.md.
This commit is contained in:
OxygenCobalt
2021-08-06 12:12:21 -06:00
parent e81d4b6d17
commit 1d828c7b0a
3 changed files with 37 additions and 5 deletions
@@ -8,7 +8,9 @@ import org.oxycblt.auxio.settings.SettingsManager
/**
* A wrapper around each [WidgetProvider] that plugs into the main Auxio process and updates the
* widget state based off of that. This cannot be rolled into [WidgetProvider] directly.
* widget state based off of that. This cannot be rolled into [WidgetProvider] directly, as it may
* result in memory leaks if [PlaybackStateManager]/[SettingsManager] gets created and bound
* to without being released.
*/
class WidgetController(private val context: Context) :
PlaybackStateManager.Callback,
@@ -22,6 +24,9 @@ class WidgetController(private val context: Context) :
settingsManager.addCallback(this)
}
/*
* Update the widget.
*/
fun update() {
widget.update(context, playbackManager)
}
@@ -5,8 +5,8 @@ import org.oxycblt.auxio.music.Song
import org.oxycblt.auxio.playback.state.LoopMode
/*
* A condensed variant of the current playback state, used so that PlaybackStateManager does not
* need to be queried directly.
* An immutable condensed variant of the current playback state, used so that PlaybackStateManager
* does not need to be queried directly.
*/
data class WidgetState(
val song: Song,