File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
omegatypes/src/main/java/com/omega_r/libs/omegatypes Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,11 @@ package com.omega_r.libs.omegatypes
33import android.content.Context
44import android.content.res.ColorStateList
55import android.content.res.Resources
6+ import android.graphics.drawable.ColorDrawable
67import android.os.Build
78import android.util.SparseIntArray
89import android.util.TypedValue
10+ import android.view.View
911import android.widget.TextView
1012import java.io.Serializable
1113import java.util.*
@@ -179,4 +181,11 @@ var TextView.linkTextColor: Color
179181 get() = Color .fromColorList(linkTextColors)
180182 set(value) {
181183 setLinkTextColor(value.getColorStateList(context))
184+ }
185+
186+ var View .backgroundColor: Color ?
187+ get() = (background as ? ColorDrawable )?.color?.let { Color .fromInt(it) }
188+ set(value) {
189+ value?.let { setBackgroundColor(it.getColorInt(context)) }
190+ ? : setBackgroundDrawable(null )
182191 }
You can’t perform that action at this time.
0 commit comments