2020-03-10 22:53:49 -04:00
|
|
|
package eu.kanade.tachiyomi.widget
|
|
|
|
|
|
|
|
import android.content.Context
|
|
|
|
import android.util.AttributeSet
|
|
|
|
import androidx.core.content.ContextCompat
|
|
|
|
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
|
|
|
import eu.kanade.tachiyomi.R
|
|
|
|
import eu.kanade.tachiyomi.util.system.getResourceColor
|
|
|
|
|
|
|
|
class ThemedSwipeRefreshLayout @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
|
2020-04-25 14:24:45 -04:00
|
|
|
SwipeRefreshLayout(context, attrs) {
|
2020-03-10 22:53:49 -04:00
|
|
|
|
|
|
|
init {
|
|
|
|
setColors()
|
|
|
|
}
|
|
|
|
|
|
|
|
private fun setColors() {
|
|
|
|
setProgressBackgroundColorSchemeColor(context.getResourceColor(R.attr.colorAccent))
|
|
|
|
setColorSchemeColors(
|
2020-04-25 14:24:45 -04:00
|
|
|
ContextCompat.getColor(context, R.color.md_white_1000),
|
|
|
|
ContextCompat.getColor(context, R.color.md_white_1000),
|
|
|
|
ContextCompat.getColor(context, R.color.md_white_1000)
|
|
|
|
)
|
2020-03-10 22:53:49 -04:00
|
|
|
}
|
|
|
|
}
|