unneeded coloring

This commit is contained in:
leca 2024-10-15 13:47:31 +03:00
parent e8e2a50cad
commit b1030ac8c1
1 changed files with 8 additions and 4 deletions

View File

@ -6,7 +6,6 @@ import android.graphics.Color
import android.graphics.drawable.GradientDrawable import android.graphics.drawable.GradientDrawable
import android.os.Build import android.os.Build
import android.util.AttributeSet import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater import android.view.LayoutInflater
import android.widget.ImageView import android.widget.ImageView
import android.widget.LinearLayout import android.widget.LinearLayout
@ -93,9 +92,14 @@ class ProductView: LinearLayout {
if (isProductSelected) { if (isProductSelected) {
this.background = ContextCompat.getDrawable(context, R.drawable.outline_selected) this.background = ContextCompat.getDrawable(context, R.drawable.outline_selected)
} else { } else {
this.background = ContextCompat.getDrawable(context, R.drawable.outline) if (product.id != 0) {
val color = evaluateColor() val color = evaluateColor()
(this.background.current as GradientDrawable).setStroke(3, color) val outline = GradientDrawable()
this.background = outline
(this.background.current as GradientDrawable).setStroke(3, color)
} else {
this.background = ContextCompat.getDrawable(context, R.drawable.outline)
}
} }
} }