@@ -57,25 +57,24 @@ public void bindDiscountCode(DiscountCode discountCode) {
57
57
int maxQuantity = discountCode .getMax_quantity ();
58
58
float value = discountCode .getValue ();
59
59
60
- setStringField (discountCodeTextView , code , "" );
61
- setStringField (discountCodeValue , "Value : " +value , "" );
62
- setStringField (discountMinQuantity , "Minimum Quantity : " +minQuantity , "" );
63
- setStringField (discountMaxQuantity , "Maximum Quantity :" +maxQuantity , "" );
64
- setStringField (discountTicket , tickets , "Tickets : " );
65
- setStringField (discountUsedFor , usedFor , "Used For : " );
66
- setStringField (this .discountUrl , discountUrl , "Discount URL : " );
60
+ setStringFieldWithPrefix (discountCodeTextView , code , "" );
61
+ setStringFieldWithPrefix (discountCodeValue , "Value : " +value , "" );
62
+ setStringFieldWithPrefix (discountMinQuantity , "Minimum Quantity : " +minQuantity , "" );
63
+ setStringFieldWithPrefix (discountMaxQuantity , "Maximum Quantity :" +maxQuantity , "" );
64
+ setStringFieldWithPrefix (discountTicket , tickets , "Tickets : " );
65
+ setStringFieldWithPrefix (discountUsedFor , usedFor , "Used For : " );
66
+ setStringFieldWithPrefix (this .discountUrl , discountUrl , "Discount URL : " );
67
67
68
68
}
69
69
70
70
71
- private void setStringField (TextView textView , String field , String prefix ) {
71
+ private void setStringFieldWithPrefix (TextView textView , String field , String prefix ) {
72
72
if (textView == null )
73
73
return ;
74
74
75
75
if (!TextUtils .isEmpty (field .trim ())) {
76
76
textView .setVisibility (View .VISIBLE );
77
- field = prefix + field ;
78
- textView .setText (field );
77
+ textView .setText (prefix + field );
79
78
} else {
80
79
textView .setVisibility (View .GONE );
81
80
}
0 commit comments