Skip to content

Commit 4f16dc5

Browse files
committed
make sure the top tab icons are colored properly
1 parent 9158f52 commit 4f16dc5

File tree

1 file changed

+11
-6
lines changed
  • app/src/main/kotlin/com/simplemobiletools/contacts/activities

1 file changed

+11
-6
lines changed

app/src/main/kotlin/com/simplemobiletools/contacts/activities/MainActivity.kt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.app.SearchManager
44
import android.content.Context
55
import android.content.Intent
66
import android.graphics.drawable.ColorDrawable
7+
import android.graphics.drawable.Drawable
78
import android.net.Uri
89
import android.os.Bundle
910
import android.os.Handler
@@ -369,12 +370,16 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
369370
invalidateOptionsMenu()
370371
}
371372

372-
private fun getTabIcon(position: Int) = resources.getDrawable(when (position) {
373-
LOCATION_CONTACTS_TAB -> R.drawable.ic_person
374-
LOCATION_FAVORITES_TAB -> R.drawable.ic_star_on
375-
LOCATION_RECENTS_TAB -> R.drawable.ic_clock
376-
else -> R.drawable.ic_group
377-
})
373+
private fun getTabIcon(position: Int): Drawable {
374+
val drawableId = when (position) {
375+
LOCATION_CONTACTS_TAB -> R.drawable.ic_person
376+
LOCATION_FAVORITES_TAB -> R.drawable.ic_star_on
377+
LOCATION_RECENTS_TAB -> R.drawable.ic_clock
378+
else -> R.drawable.ic_group
379+
}
380+
381+
return resources.getColoredDrawableWithColor(drawableId, config.textColor)
382+
}
378383

379384
private fun showSortingDialog() {
380385
ChangeSortingDialog(this) {

0 commit comments

Comments
 (0)