mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
use proper text color at fastscroller letters
This commit is contained in:
@ -2,6 +2,7 @@ package com.simplemobiletools.contacts.pro.fragments
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.content.res.ColorStateList
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
@ -153,6 +154,19 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
|||||||
|
|
||||||
if (!wasLetterFastScrollerSetup) {
|
if (!wasLetterFastScrollerSetup) {
|
||||||
wasLetterFastScrollerSetup = true
|
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 ->
|
letter_fastscroller.setupWithRecyclerView(fragment_list, { position ->
|
||||||
try {
|
try {
|
||||||
val name = contacts[position].getNameToDisplay()
|
val name = contacts[position].getNameToDisplay()
|
||||||
|
Reference in New Issue
Block a user