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

24 lines
732 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-08-03 23:03:31 -04:00
val white = ContextCompat.getColor(context, R.color.md_white_1000)
setColorSchemeColors(white, white, white)
2020-03-10 22:53:49 -04:00
}
}