Address search fab color issue

This commit is contained in:
Rahul Patel
2024-08-13 03:08:36 +05:30
committed by Aayush Gupta
parent 8cfec71259
commit c8d701feb4
6 changed files with 29 additions and 11 deletions

View File

@@ -20,8 +20,10 @@
package com.aurora.extensions
import android.content.Context
import android.content.res.ColorStateList
import android.view.View
import android.view.inputmethod.InputMethodManager
import com.google.android.material.floatingactionbutton.FloatingActionButton
fun View.isVisible() = visibility == View.VISIBLE
@@ -83,3 +85,9 @@ fun View.getString(resourceId: Int): String {
return context.getString(resourceId)
}
fun FloatingActionButton.applyColors() {
val accentColor = context.accentColor()
backgroundTintList = ColorStateList.valueOf(accentColor)
imageTintList = ColorStateList.valueOf(contrastingColor(accentColor))
}