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:
@@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user