image: simplify coverview internals

Remove the setting responsiveness from CoverView, given that it really
doesn't need to that anymore.
This commit is contained in:
Alexander Capehart 2023-07-25 19:25:14 -06:00
parent a201cb15bc
commit b2a3416289
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -76,7 +76,7 @@ import org.oxycblt.auxio.util.getInteger
class CoverView class CoverView
@JvmOverloads @JvmOverloads
constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr: Int = 0) : constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr: Int = 0) :
FrameLayout(context, attrs, defStyleAttr), ImageSettings.Listener, UISettings.Listener { FrameLayout(context, attrs, defStyleAttr) {
@Inject lateinit var imageLoader: ImageLoader @Inject lateinit var imageLoader: ImageLoader
@Inject lateinit var uiSettings: UISettings @Inject lateinit var uiSettings: UISettings
@Inject lateinit var imageSettings: ImageSettings @Inject lateinit var imageSettings: ImageSettings
@ -154,9 +154,6 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
} else { } else {
null null
} }
imageSettings.registerListener(this)
uiSettings.registerListener(this)
} }
override fun onFinishInflate() { override fun onFinishInflate() {
@ -187,23 +184,6 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
} }
} }
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
imageSettings.unregisterListener(this)
}
override fun onImageSettingsChanged() {
val cover = currentCover ?: return
bind(cover.songs, cover.desc, cover.errorRes)
}
override fun onRoundModeChanged() {
cornerRadiusRes = getCornerRadiusRes()
applyBackgroundsToChildren()
val cover = currentCover ?: return
bind(cover.songs, cover.desc, cover.errorRes)
}
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec) super.onMeasure(widthMeasureSpec, heightMeasureSpec)