[Fix] AmountView styled when discount is applied from code
@@ -197,6 +197,16 @@ public class AmountView extends LinearLayoutCompat {
.amount(totalAmount)
.normalDecimals()
.into(amountBeforeDiscount);
+
+ final RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) amountContainer.getLayoutParams();
+ params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, 0);
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
+ params.removeRule(RelativeLayout.ALIGN_PARENT_RIGHT);
+ params.removeRule(RelativeLayout.ALIGN_PARENT_END);
+ }
+
+ amountContainer.setLayoutParams(params);
}
private void configureDiscountAmountDescription(final Discount discount, final Campaign campaign) {
