|
1 | 1 | package com.simplemobiletools.smsmessenger.adapters |
2 | 2 |
|
3 | 3 | import android.graphics.Typeface |
4 | | -import android.graphics.drawable.LayerDrawable |
5 | 4 | import android.view.Menu |
6 | 5 | import android.view.View |
7 | 6 | import android.view.ViewGroup |
8 | 7 | import android.widget.TextView |
9 | 8 | import com.bumptech.glide.Glide |
10 | 9 | import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter |
11 | 10 | import com.simplemobiletools.commons.dialogs.ConfirmationDialog |
12 | | -import com.simplemobiletools.commons.extensions.applyColorFilter |
13 | 11 | import com.simplemobiletools.commons.extensions.formatDateOrTime |
| 12 | +import com.simplemobiletools.commons.extensions.getColoredGroupIcon |
14 | 13 | import com.simplemobiletools.commons.helpers.ensureBackgroundThread |
15 | | -import com.simplemobiletools.commons.helpers.letterBackgroundColors |
16 | 14 | import com.simplemobiletools.commons.views.FastScroller |
17 | 15 | import com.simplemobiletools.commons.views.MyRecyclerView |
18 | 16 | import com.simplemobiletools.smsmessenger.R |
@@ -143,10 +141,7 @@ class ConversationsAdapter( |
143 | 141 |
|
144 | 142 | // at group conversations we use an icon as the placeholder, not any letter |
145 | 143 | val placeholder = if (conversation.isGroupConversation) { |
146 | | - val icon = activity.resources.getDrawable(R.drawable.group_conversation_icon) |
147 | | - val bgColor = letterBackgroundColors[Math.abs(conversation.title.hashCode()) % letterBackgroundColors.size].toInt() |
148 | | - (icon as LayerDrawable).findDrawableByLayerId(R.id.attendee_circular_background).applyColorFilter(bgColor) |
149 | | - icon |
| 144 | + activity.getColoredGroupIcon(conversation.title) |
150 | 145 | } else { |
151 | 146 | null |
152 | 147 | } |
|
0 commit comments