ContactsController: tint "public conversation" button

Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
This commit is contained in:
Álvaro Brey 2022-07-21 13:56:12 +02:00 committed by Andy Scherzinger
parent 5ec18780ff
commit 54d1ac9de7
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
2 changed files with 12 additions and 8 deletions

View File

@ -631,12 +631,7 @@ class ContactsController(args: Bundle) :
ResourcesCompat.getColor(resources!!, R.color.colorBackgroundDarker, null),
PorterDuff.Mode.SRC_IN
)
binding.conversationPrivacyToggle.publicCallLink
.background
.setColorFilter(
ResourcesCompat.getColor(resources!!, R.color.colorPrimary, null),
PorterDuff.Mode.SRC_IN
)
viewThemeUtils.colorImageViewButton(binding.conversationPrivacyToggle.publicCallLink)
disengageProgressBar()
}

View File

@ -24,6 +24,7 @@ package com.nextcloud.talk.ui.theme
import android.content.Context
import android.content.res.ColorStateList
import android.content.res.Configuration
import android.widget.ImageView
import android.widget.TextView
import com.google.android.material.floatingactionbutton.FloatingActionButton
import javax.inject.Inject
@ -48,7 +49,15 @@ class ViewThemeUtils @Inject constructor(val theme: ServerTheme) {
fab.imageTintList = ColorStateList.valueOf(theme.colorText)
}
fun colorTextView(titleTextView: TextView) {
titleTextView.setTextColor(getElementColor(titleTextView.context))
fun colorTextView(textView: TextView) {
textView.setTextColor(getElementColor(textView.context))
}
/**
* Colors the background as element color and the foreground as text color.
*/
fun colorImageViewButton(imageView: ImageView) {
imageView.imageTintList = ColorStateList.valueOf(theme.colorText)
imageView.backgroundTintList = ColorStateList.valueOf(getElementColor(imageView.context))
}
}