Skip to content

Commit

Permalink
Make AppBar to use setBackground() instead of backgroundTintList
Browse files Browse the repository at this point in the history
MOB 3619
  • Loading branch information
DavDo committed Oct 7, 2024
1 parent 8926344 commit 3c499a6
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.glia.widgets.view.header

import android.content.Context
import android.content.res.ColorStateList
import android.util.AttributeSet
import android.view.MenuItem
import android.widget.TextView
Expand All @@ -22,7 +21,6 @@ import com.glia.widgets.helper.applyIconColorTheme
import com.glia.widgets.helper.applyImageColorTheme
import com.glia.widgets.helper.applyTextTheme
import com.glia.widgets.helper.getColorCompat
import com.glia.widgets.helper.getColorStateListCompat
import com.glia.widgets.helper.getFontCompat
import com.glia.widgets.helper.getTypedArrayResId
import com.glia.widgets.helper.layoutInflater
Expand Down Expand Up @@ -93,7 +91,8 @@ internal class AppBarView @JvmOverloads constructor(
R.styleable.AppBarView_android_backgroundTint,
R.attr.gliaBrandPrimaryColor
)
this@AppBarView.backgroundTintList = getColorStateListCompat(backgroundTintList)

setBackgroundColor(getColorCompat(backgroundTintList))

Utils.getTypedArrayStringValue(this, R.styleable.AppBarView_titleText)?.also {
binding.title.text = it
Expand Down Expand Up @@ -130,7 +129,7 @@ internal class AppBarView @JvmOverloads constructor(
val textFont = uiTheme.fontRes?.let(::getFontCompat)

chatHeaderHomeButtonColor?.also { binding.toolbar.setNavigationIconTint(it) }
brandPrimaryColor?.also { backgroundTintList = ColorStateList.valueOf(it) }
brandPrimaryColor?.also { setBackgroundColor(it) }

leaveQueueIcon.applyIconColorTheme(exitQueueButtonColor)
endScreenShareButton.applyImageColorTheme(endScreenShareButtonColor)
Expand Down

0 comments on commit 3c499a6

Please sign in to comment.