use proper text color at fastscroller letters

This commit is contained in:
tibbi 2020-02-05 16:09:17 +01:00
parent 7b30d6efd5
commit b67cb04f4a

View File

@ -2,6 +2,7 @@ package com.simplemobiletools.contacts.pro.fragments
import android.content.Context
import android.content.Intent
import android.content.res.ColorStateList
import android.util.AttributeSet
import android.view.ViewGroup
import androidx.coordinatorlayout.widget.CoordinatorLayout
@ -153,6 +154,19 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
if (!wasLetterFastScrollerSetup) {
wasLetterFastScrollerSetup = true
val states = arrayOf(intArrayOf(android.R.attr.state_enabled),
intArrayOf(-android.R.attr.state_enabled),
intArrayOf(-android.R.attr.state_checked),
intArrayOf(android.R.attr.state_pressed)
)
val textColor = config.textColor
val colors = intArrayOf(textColor, textColor, textColor, textColor)
val myList = ColorStateList(states, colors)
letter_fastscroller.textColor = myList
letter_fastscroller.setupWithRecyclerView(fragment_list, { position ->
try {
val name = contacts[position].getNameToDisplay()