From 9ac56c9f6fe9ba3152b6382ab852166d986d3465 Mon Sep 17 00:00:00 2001 From: Sungjun Date: Tue, 4 May 2021 07:18:04 +0900 Subject: [PATCH] Remove a horizontal line of was old price (#45) Co-authored-by: sungjun --- .../pixlee/pixleesdk/ui/viewholder/ProductViewHolder.kt | 6 ++++-- pixleesdk/src/main/res/layout/item_product.xml | 7 ++++--- pixleesdk/src/main/res/values-ru/strings.xml | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pixleesdk/src/main/java/com/pixlee/pixleesdk/ui/viewholder/ProductViewHolder.kt b/pixleesdk/src/main/java/com/pixlee/pixleesdk/ui/viewholder/ProductViewHolder.kt index 69ad46fe..5613379e 100644 --- a/pixleesdk/src/main/java/com/pixlee/pixleesdk/ui/viewholder/ProductViewHolder.kt +++ b/pixleesdk/src/main/java/com/pixlee/pixleesdk/ui/viewholder/ProductViewHolder.kt @@ -310,8 +310,10 @@ fun SpannableString.applyDisabledTextStyle(discountLayout: ProductViewHolder.Dis val fontSize = (TypedValue.applyDimension(it.sizeUnit, it.size, metrics) * disabledTextSizeRatio).toInt() setSpan(AbsoluteSizeSpan(fontSize), startIndex, endIndex, 0) // font size setSpan(ForegroundColorSpan(lighten(it.color, lightenFriction)), startIndex, endIndex, 0) // font color - setSpan(StrikethroughSpan(), startIndex, endIndex, 0) // font size - + if (discountLayout == null || + (discountLayout == ProductViewHolder.DiscountLayout.WITH_DISCOUNT_LABEL || discountLayout == ProductViewHolder.DiscountLayout.CROSS_THROUGH) ) { + setSpan(StrikethroughSpan(), startIndex, endIndex, 0) // font size + } } } diff --git a/pixleesdk/src/main/res/layout/item_product.xml b/pixleesdk/src/main/res/layout/item_product.xml index 7388c78e..2be2ffe0 100644 --- a/pixleesdk/src/main/res/layout/item_product.xml +++ b/pixleesdk/src/main/res/layout/item_product.xml @@ -31,7 +31,7 @@ Pixlee SDK был %s - %s%% выключенный + \n%s%% выключенный