mihon/app/src/main/java/eu/kanade/tachiyomi/widget/ThemedSwipeRefreshLayout.kt

27 lines
850 B
Kotlin
Raw Normal View History

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
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() {
2020-06-10 23:01:47 -04:00
// Background is controlled with "swipeRefreshLayoutProgressSpinnerBackgroundColor" in XML
// This updates the progress arrow color
2020-03-10 22:53:49 -04:00
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
}
}