diff --git a/app/src/main/java/de/grobox/transportr/ui/LineView.kt b/app/src/main/java/de/grobox/transportr/ui/LineView.kt index c511c308f..998d26246 100644 --- a/app/src/main/java/de/grobox/transportr/ui/LineView.kt +++ b/app/src/main/java/de/grobox/transportr/ui/LineView.kt @@ -47,13 +47,17 @@ class LineView(context: Context, attr: AttributeSet?) : AppCompatTextView(contex @Suppress("DEPRECATION") setBackgroundDrawable(backgroundDrawable) - // correct padding that gets lost when setting background - setPadding(0, dpToPx(context, 2), dpToPx(context, 4), dpToPx(context, 2)) - // product icon if (line.product != null) { + // correct padding that gets lost when setting background + setPadding(0, dpToPx(context, 2), dpToPx(context, 4), dpToPx(context, 2)) + setDrawable(getDrawableForProduct(line.product), foregroundColor) } + else{ + // correct padding that gets lost when setting background + setPadding(dpToPx(context, 4), dpToPx(context, 2), dpToPx(context, 4), dpToPx(context, 2)) + } // set colored label text = line.label