Panagiotis Triantafyllou

ui fixes

...@@ -464,6 +464,11 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -464,6 +464,11 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
464 // First Expandable Banner 464 // First Expandable Banner
465 String badgeValueFirst = String.format("%.02f", WarplyManagerHelper.getDealsCouponsSum()); 465 String badgeValueFirst = String.format("%.02f", WarplyManagerHelper.getDealsCouponsSum());
466 mTvDealsValue.setText(String.format(getString(R.string.cos_value), badgeValueFirst)); 466 mTvDealsValue.setText(String.format(getString(R.string.cos_value), badgeValueFirst));
467 + if (String.valueOf(WarplyManagerHelper.getDealsCouponsSum()).length() >= 3) {
468 + mTvDealsValue.setTextSize(12);
469 + } else {
470 + mTvDealsValue.setTextSize(14);
471 + }
467 SpannableStringBuilder sBuilder = new SpannableStringBuilder(); 472 SpannableStringBuilder sBuilder = new SpannableStringBuilder();
468 sBuilder.append(String.format(getString(R.string.cos_deals_win_title_cos), badgeValueFirst)); 473 sBuilder.append(String.format(getString(R.string.cos_deals_win_title_cos), badgeValueFirst));
469 CalligraphyTypefaceSpan typefaceBoldSpanFirst = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf")); 474 CalligraphyTypefaceSpan typefaceBoldSpanFirst = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
...@@ -475,6 +480,11 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -475,6 +480,11 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
475 if (WarplyManagerHelper.getLoyaltyBadge() != null && (WarplyManagerHelper.getLoyaltyBadge().getCouponCount() > 0 || WarplyManagerHelper.getLoyaltyBadge().getCouponCount() == 0)) { 480 if (WarplyManagerHelper.getLoyaltyBadge() != null && (WarplyManagerHelper.getLoyaltyBadge().getCouponCount() > 0 || WarplyManagerHelper.getLoyaltyBadge().getCouponCount() == 0)) {
476 String badgeValue = String.format("%.02f", WarplyManagerHelper.getLoyaltyBadge().getValue()); 481 String badgeValue = String.format("%.02f", WarplyManagerHelper.getLoyaltyBadge().getValue());
477 mTvGiftsValue.setText(String.format(getString(R.string.cos_value), badgeValue)); 482 mTvGiftsValue.setText(String.format(getString(R.string.cos_value), badgeValue));
483 + if (String.valueOf(WarplyManagerHelper.getLoyaltyBadge().getValue()).length() >= 3) {
484 + mTvGiftsValue.setTextSize(12);
485 + } else {
486 + mTvGiftsValue.setTextSize(14);
487 + }
478 SpannableStringBuilder sBuilderSecond = new SpannableStringBuilder(); 488 SpannableStringBuilder sBuilderSecond = new SpannableStringBuilder();
479 sBuilderSecond.append(String.format(getString(R.string.cos_deals_win_title), badgeValue)); 489 sBuilderSecond.append(String.format(getString(R.string.cos_deals_win_title), badgeValue));
480 CalligraphyTypefaceSpan typefaceBoldSpanSecond = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf")); 490 CalligraphyTypefaceSpan typefaceBoldSpanSecond = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
...@@ -498,6 +508,11 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -498,6 +508,11 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
498 mFavValue += countValue; 508 mFavValue += countValue;
499 String badgeValue = String.format("%.02f", countValue); 509 String badgeValue = String.format("%.02f", countValue);
500 mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue)); 510 mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
511 + if (String.valueOf(countValue).length() >= 3) {
512 + mTvMarketValue.setTextSize(12);
513 + } else {
514 + mTvMarketValue.setTextSize(14);
515 + }
501 SpannableStringBuilder sBuilderThird = new SpannableStringBuilder(); 516 SpannableStringBuilder sBuilderThird = new SpannableStringBuilder();
502 sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue)); 517 sBuilderThird.append(String.format(getString(R.string.cos_supermarket_win), badgeValue));
503 CalligraphyTypefaceSpan typefaceBoldSpanThird = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf")); 518 CalligraphyTypefaceSpan typefaceBoldSpanThird = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
...@@ -511,6 +526,11 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -511,6 +526,11 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
511 // Sum Expandable Banner 526 // Sum Expandable Banner
512 String allValue = String.format("%.02f", mFavValue); 527 String allValue = String.format("%.02f", mFavValue);
513 mTvFavValue.setText(String.format(getString(R.string.cos_value), allValue)); 528 mTvFavValue.setText(String.format(getString(R.string.cos_value), allValue));
529 + if (String.valueOf(mFavValue).length() >= 3) {
530 + mTvFavValue.setTextSize(12);
531 + } else {
532 + mTvFavValue.setTextSize(14);
533 + }
514 SpannableStringBuilder sBuilderExp = new SpannableStringBuilder(); 534 SpannableStringBuilder sBuilderExp = new SpannableStringBuilder();
515 sBuilderExp.append(String.format(getString(R.string.cos_for_you_all), allValue)); 535 sBuilderExp.append(String.format(getString(R.string.cos_for_you_all), allValue));
516 CalligraphyTypefaceSpan typefaceBoldExp = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf")); 536 CalligraphyTypefaceSpan typefaceBoldExp = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
......