Panagiotis Triantafyllou

sm deals history fixes

......@@ -204,27 +204,22 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
countValue = 0.0f;
if (WarplyManagerHelper.getCouponRedeemedList().size() > 0) {
if (WarplyManagerHelper.getCouponsetsDeals().size() > 0) {
for (Couponset couset : WarplyManagerHelper.getCouponsetsDeals()) {
for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) {
if (cou.getCouponsetUuid().equals(couset.getUuid())) {
if (cou.getCouponsetDetails().getCouponsetType().equals("supermarket")) {
countValue += Float.parseFloat(cou.getDiscount());
cou.setDescription(couset.getShortDescription());
cou.setImage(couset.getImgPreview());
cou.setName(couset.getName());
cou.setMerchantUuid(couset.getMerchantUuid());
cou.setInnerText(couset.getInnerText());
cou.setDiscount_type(couset.getDiscount_type());
cou.setFinal_price(couset.getFinal_price());
break;
}
}
cou.setDescription(cou.getCouponsetDetails().getShortDescription());
cou.setImage(cou.getCouponsetDetails().getImgPreview());
cou.setName(cou.getCouponsetDetails().getName());
cou.setMerchantUuid(cou.getCouponsetDetails().getMerchantUuid());
cou.setInnerText(cou.getCouponsetDetails().getInnerText());
cou.setDiscount_type(cou.getCouponsetDetails().getDiscount_type());
cou.setFinal_price(cou.getCouponsetDetails().getFinal_price());
}
}
}
mFavValue += countValue;
String badgeValue = String.format(Locale.GERMAN,"%.02f", countValue);
String badgeValue = String.format(Locale.GERMAN, "%.02f", countValue);
mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
if (String.valueOf(countValue).length() >= 3) {
mTvMarketValue.setTextSize(12);
......@@ -237,7 +232,7 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
sBuilderThird.setSpan(typefaceBoldSpanThird, 24, 24 + badgeValue.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mTvMarketAll.setText(sBuilderThird, TextView.BufferType.SPANNABLE);
} else {
String badgeValue = String.format(Locale.GERMAN,"%.02f", 0.0f);
String badgeValue = String.format(Locale.GERMAN, "%.02f", 0.0f);
mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
SpannableStringBuilder sBuilderThird = new SpannableStringBuilder();
sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue));
......@@ -249,7 +244,7 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
/** Third Banner */
if (WarplyManagerHelper.getLoyaltyBadge() != null && (WarplyManagerHelper.getLoyaltyBadge().getCouponCount() > 0 || WarplyManagerHelper.getLoyaltyBadge().getCouponCount() == 0)) {
String badgeValue = String.format(Locale.GERMAN,"%.02f", WarplyManagerHelper.getLoyaltyBadge().getValue());
String badgeValue = String.format(Locale.GERMAN, "%.02f", WarplyManagerHelper.getLoyaltyBadge().getValue());
mTvGiftsValue.setText(String.format(getString(R.string.cos_value), badgeValue));
if (String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getValue()).length() >= 3) {
mTvGiftsValue.setTextSize(12);
......@@ -266,7 +261,7 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
/** Third Banner */
/** Sum Banner */
String allValue = String.format(Locale.GERMAN,"%.02f", mFavValue);
String allValue = String.format(Locale.GERMAN, "%.02f", mFavValue);
mTvFavValue.setText(String.format(getString(R.string.cos_value), allValue));
/** Sum Banner */
}
......
......@@ -104,15 +104,10 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl
// }
if (WarplyManagerHelper.getCouponRedeemedList().size() > 0) {
if (WarplyManagerHelper.getCouponsetsDeals().size() > 0) {
for (Couponset couset : WarplyManagerHelper.getCouponsetsDeals()) {
for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) {
if (cou.getCouponsetUuid().equals(couset.getUuid())) {
if (cou.getCouponsetDetails().getCouponsetType().equals("supermarket")) {
countValue += Float.valueOf(cou.getDiscount());
mExpiredMarketCoupons.add(cou);
break;
}
}
}
}
}
......