updating commons and target SDK to 31

This commit is contained in:
tibbi 2022-04-12 09:45:18 +02:00
parent 7ed5c667ef
commit 45874d13d4
18 changed files with 101 additions and 49 deletions

View file

@ -9,6 +9,7 @@ import android.widget.RelativeLayout
import android.widget.TextView
import com.simplemobiletools.commons.extensions.darkenColor
import com.simplemobiletools.commons.extensions.getContrastColor
import com.simplemobiletools.commons.extensions.getProperBackgroundColor
import com.simplemobiletools.commons.extensions.normalizeString
import com.simplemobiletools.commons.helpers.SimpleContactsHelper
import com.simplemobiletools.commons.models.SimpleContact
@ -34,7 +35,7 @@ class AutoCompleteTextViewAdapter(val activity: SimpleActivity, val contacts: Ar
isFocusable = false
}
val backgroundColor = activity.config.backgroundColor
val backgroundColor = activity.getProperBackgroundColor()
findViewById<RelativeLayout>(R.id.item_contact_holder).setBackgroundColor(backgroundColor.darkenColor())
findViewById<TextView>(R.id.item_contact_name).setTextColor(backgroundColor.getContrastColor())

View file

@ -298,7 +298,7 @@ class ConversationsAdapter(
view.apply {
val smsDraft = drafts[conversation.threadId]
draft_indicator.beVisibleIf(smsDraft != null)
draft_indicator.setTextColor(adjustedPrimaryColor)
draft_indicator.setTextColor(properPrimaryColor)
pin_indicator.beVisibleIf(activity.config.pinnedConversations.contains(conversation.threadId.toString()))

View file

@ -67,13 +67,13 @@ class SearchResultsAdapter(
private fun setupView(view: View, searchResult: SearchResult) {
view.apply {
search_result_title.apply {
text = searchResult.title.highlightTextPart(textToHighlight, adjustedPrimaryColor)
text = searchResult.title.highlightTextPart(textToHighlight, properPrimaryColor)
setTextColor(textColor)
setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize * 1.2f)
}
search_result_snippet.apply {
text = searchResult.snippet.highlightTextPart(textToHighlight, adjustedPrimaryColor)
text = searchResult.snippet.highlightTextPart(textToHighlight, properPrimaryColor)
setTextColor(textColor)
setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize * 0.9f)
}

View file

@ -262,14 +262,14 @@ class ThreadAdapter(
}
}
thread_message_body.setTextColor(textColor)
thread_message_body.setLinkTextColor(context.getAdjustedPrimaryColor())
thread_message_body.setLinkTextColor(context.getProperPrimaryColor())
if (!activity.isFinishing && !activity.isDestroyed) {
SimpleContactsHelper(context).loadContactImage(message.senderPhotoUri, thread_message_sender_photo, message.senderName)
}
} else {
thread_message_sender_photo?.beGone()
val background = context.getAdjustedPrimaryColor()
val background = context.getProperPrimaryColor()
thread_message_body.background.applyColorFilter(background)
val contrastColor = background.getContrastColor()
@ -359,7 +359,7 @@ class ThreadAdapter(
}
thread_mesage_attachments_holder.addView(attachmentView)
} else {
val background = context.getAdjustedPrimaryColor()
val background = context.getProperPrimaryColor()
val attachmentView = layoutInflater.inflate(R.layout.item_sent_unknown_attachment, null).apply {
thread_sent_attachment_label.apply {
this.background.applyColorFilter(background)