2020-03-11 03:53:49 +01: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
|
|
|
|
|
|
|
|
class ThemedSwipeRefreshLayout @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
|
2020-04-25 20:24:45 +02:00
|
|
|
SwipeRefreshLayout(context, attrs) {
|
2020-03-11 03:53:49 +01:00
|
|
|
|
|
|
|
init {
|
|
|
|
setColors()
|
|
|
|
}
|
|
|
|
|
|
|
|
private fun setColors() {
|
2020-06-11 05:01:47 +02:00
|
|
|
// Background is controlled with "swipeRefreshLayoutProgressSpinnerBackgroundColor" in XML
|
|
|
|
|
|
|
|
// This updates the progress arrow color
|
2020-08-04 05:03:31 +02:00
|
|
|
val white = ContextCompat.getColor(context, R.color.md_white_1000)
|
|
|
|
setColorSchemeColors(white, white, white)
|
2020-03-11 03:53:49 +01:00
|
|
|
}
|
|
|
|
}
|