set the fastscrollbars color to primary color

This commit is contained in:
tibbi 2017-03-04 21:29:52 +01:00
parent 2e884bf894
commit 5a0b031d3f

View file

@ -1,6 +1,7 @@
package com.simplemobiletools.gallery.views package com.simplemobiletools.gallery.views
import android.content.Context import android.content.Context
import android.graphics.PorterDuff
import android.support.v4.widget.SwipeRefreshLayout import android.support.v4.widget.SwipeRefreshLayout
import android.support.v7.widget.GridLayoutManager import android.support.v7.widget.GridLayoutManager
import android.support.v7.widget.RecyclerView import android.support.v7.widget.RecyclerView
@ -10,6 +11,7 @@ import android.view.MotionEvent
import android.view.View import android.view.View
import android.widget.LinearLayout import android.widget.LinearLayout
import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.extensions.config
import kotlinx.android.synthetic.main.fastscroller.view.* import kotlinx.android.synthetic.main.fastscroller.view.*
// based on https://blog.stylingandroid.com/recyclerview-fastscroll-part-1 // based on https://blog.stylingandroid.com/recyclerview-fastscroll-part-1
@ -30,6 +32,7 @@ class FastScroller : LinearLayout {
fun setViews(recyclerView: RecyclerView, swipeRefreshLayout: SwipeRefreshLayout) { fun setViews(recyclerView: RecyclerView, swipeRefreshLayout: SwipeRefreshLayout) {
this.recyclerView = recyclerView this.recyclerView = recyclerView
this.swipeRefreshLayout = swipeRefreshLayout this.swipeRefreshLayout = swipeRefreshLayout
handle.background.setColorFilter(context.config.primaryColor, PorterDuff.Mode.SRC_IN)
recyclerView.setOnScrollListener(object : RecyclerView.OnScrollListener() { recyclerView.setOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(rv: RecyclerView, dx: Int, dy: Int) { override fun onScrolled(rv: RecyclerView, dx: Int, dy: Int) {