Skip to content

Commit

Permalink
Remove a horizontal line of was old price (#45)
Browse files Browse the repository at this point in the history
Co-authored-by: sungjun <[email protected]>
  • Loading branch information
SungjunApp and sungjun authored May 3, 2021
1 parent 1e808b2 commit 9ac56c9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down
7 changes: 4 additions & 3 deletions pixleesdk/src/main/res/layout/item_product.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<TextView
android:id="@+id/tvMain"
android:layout_width="200dp"
android:layout_width="220dp"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingLeft="@dimen/product_center"
Expand All @@ -46,7 +46,7 @@
/>
<TextView
android:id="@+id/tvSub"
android:layout_width="200dp"
android:layout_width="220dp"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/product_center"
android:maxLines="2"
Expand All @@ -64,8 +64,9 @@

<TextView
android:id="@+id/tvPrice"
android:layout_width="match_parent"
android:layout_width="220dp"
android:layout_height="wrap_content"
android:includeFontPadding="false"
tools:text="100"
tools:textSize="30sp"
android:paddingTop="5dp"
Expand Down
2 changes: 1 addition & 1 deletion pixleesdk/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">Pixlee SDK</string>
<string name="was_old_price">был %s</string>
<string name="percent_off">%s%% выключенный</string>
<string name="percent_off">\n%s%% выключенный</string>
</resources>

0 comments on commit 9ac56c9

Please sign in to comment.