Showing
7 changed files
with
24 additions
and
62 deletions
| ... | @@ -40,17 +40,13 @@ import ly.warp.sdk.utils.managers.WarplyManager; | ... | @@ -40,17 +40,13 @@ import ly.warp.sdk.utils.managers.WarplyManager; | 
| 40 | import ly.warp.sdk.views.adapters.ExpiredCouponAdapter; | 40 | import ly.warp.sdk.views.adapters.ExpiredCouponAdapter; | 
| 41 | import ly.warp.sdk.views.adapters.SharedCouponAdapter; | 41 | import ly.warp.sdk.views.adapters.SharedCouponAdapter; | 
| 42 | 42 | ||
| 43 | - | ||
| 44 | public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnClickListener { | 43 | public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnClickListener { | 
| 45 | - | ||
| 46 | // =========================================================== | 44 | // =========================================================== | 
| 47 | // Constants | 45 | // Constants | 
| 48 | // =========================================================== | 46 | // =========================================================== | 
| 49 | - | ||
| 50 | // =========================================================== | 47 | // =========================================================== | 
| 51 | // Fields | 48 | // Fields | 
| 52 | // =========================================================== | 49 | // =========================================================== | 
| 53 | - | ||
| 54 | private ImageView mIvBack; | 50 | private ImageView mIvBack; | 
| 55 | private TextView mTvCouponsValueAll, mTvSharedEmpty, mTvExpiredEmpty; | 51 | private TextView mTvCouponsValueAll, mTvSharedEmpty, mTvExpiredEmpty; | 
| 56 | private RecyclerView mRvExpiredCoupons, mRvSharedCoupons; | 52 | private RecyclerView mRvExpiredCoupons, mRvSharedCoupons; | 
| ... | @@ -67,13 +63,11 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | ... | @@ -67,13 +63,11 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | 
| 67 | // =========================================================== | 63 | // =========================================================== | 
| 68 | // Methods for/from SuperClass/Interfaces | 64 | // Methods for/from SuperClass/Interfaces | 
| 69 | // =========================================================== | 65 | // =========================================================== | 
| 70 | - | ||
| 71 | @Override | 66 | @Override | 
| 72 | public void onCreate(Bundle savedInstanceState) { | 67 | public void onCreate(Bundle savedInstanceState) { | 
| 73 | super.onCreate(savedInstanceState); | 68 | super.onCreate(savedInstanceState); | 
| 74 | setContentView(R.layout.activity_loyalty_market_analysis); | 69 | setContentView(R.layout.activity_loyalty_market_analysis); | 
| 75 | mSecondsHandler = new Handler(); | 70 | mSecondsHandler = new Handler(); | 
| 76 | - | ||
| 77 | mIvBack = findViewById(R.id.iv_loyalty_analysis_close); | 71 | mIvBack = findViewById(R.id.iv_loyalty_analysis_close); | 
| 78 | mTvCouponsValueAll = findViewById(R.id.tv_expired_coupons_title); | 72 | mTvCouponsValueAll = findViewById(R.id.tv_expired_coupons_title); | 
| 79 | mRvExpiredCoupons = findViewById(R.id.rv_expired_coupons); | 73 | mRvExpiredCoupons = findViewById(R.id.rv_expired_coupons); | 
| ... | @@ -86,7 +80,6 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | ... | @@ -86,7 +80,6 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | 
| 86 | mTvExpiredEmpty = findViewById(R.id.tv_expired_empty); | 80 | mTvExpiredEmpty = findViewById(R.id.tv_expired_empty); | 
| 87 | mLlShowMoreExpired = findViewById(R.id.ll_show_more_expired); | 81 | mLlShowMoreExpired = findViewById(R.id.ll_show_more_expired); | 
| 88 | mLlShowMoreShared = findViewById(R.id.ll_show_more_shared); | 82 | mLlShowMoreShared = findViewById(R.id.ll_show_more_shared); | 
| 89 | - | ||
| 90 | if (WarplyManagerHelper.getMarketCoupons() != null && WarplyManagerHelper.getMarketCoupons().size() > 0) { | 83 | if (WarplyManagerHelper.getMarketCoupons() != null && WarplyManagerHelper.getMarketCoupons().size() > 0) { | 
| 91 | for (UnifiedCoupon unicoupon : WarplyManagerHelper.getMarketCoupons()) { | 84 | for (UnifiedCoupon unicoupon : WarplyManagerHelper.getMarketCoupons()) { | 
| 92 | if (unicoupon.getCoupons() != null && unicoupon.getCoupons().size() > 0) { | 85 | if (unicoupon.getCoupons() != null && unicoupon.getCoupons().size() > 0) { | 
| ... | @@ -99,14 +92,13 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | ... | @@ -99,14 +92,13 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | 
| 99 | } | 92 | } | 
| 100 | } | 93 | } | 
| 101 | } | 94 | } | 
| 102 | - | ||
| 103 | initViews(); | 95 | initViews(); | 
| 104 | } | 96 | } | 
| 105 | 97 | ||
| 106 | @Override | 98 | @Override | 
| 107 | public void onResume() { | 99 | public void onResume() { | 
| 108 | super.onResume(); | 100 | super.onResume(); | 
| 109 | - WarplyAnalyticsManager.logTrackersEvent(this, "screen", "LoyaltyHistoryScreen"); | 101 | + WarplyAnalyticsManager.logTrackersEvent(this, "screen", "LoyaltyMarketHistoryScreen"); | 
| 110 | mTimer = 0; | 102 | mTimer = 0; | 
| 111 | mSecondsHandler.post(new Runnable() { | 103 | mSecondsHandler.post(new Runnable() { | 
| 112 | @Override | 104 | @Override | 
| ... | @@ -115,9 +107,7 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | ... | @@ -115,9 +107,7 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | 
| 115 | mSecondsHandler.postDelayed(this, 1000); | 107 | mSecondsHandler.postDelayed(this, 1000); | 
| 116 | } | 108 | } | 
| 117 | }); | 109 | }); | 
| 118 | - | ||
| 119 | mSharedCoupons.clear(); | 110 | mSharedCoupons.clear(); | 
| 120 | - | ||
| 121 | new Thread(() -> { | 111 | new Thread(() -> { | 
| 122 | if (!Thread.currentThread().isInterrupted()) { | 112 | if (!Thread.currentThread().isInterrupted()) { | 
| 123 | WarplyManager.getSharingHistory(new WarplySharingHistoryRequest() | 113 | WarplyManager.getSharingHistory(new WarplySharingHistoryRequest() | 
| ... | @@ -138,7 +128,6 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | ... | @@ -138,7 +128,6 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | 
| 138 | super.onPause(); | 128 | super.onPause(); | 
| 139 | if (mSecondsHandler != null) { | 129 | if (mSecondsHandler != null) { | 
| 140 | mSecondsHandler.removeCallbacksAndMessages(null); | 130 | mSecondsHandler.removeCallbacksAndMessages(null); | 
| 141 | - | ||
| 142 | LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel(); | 131 | LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel(); | 
| 143 | analyticsEvent.setEventName("time_spent_on_loyalty_sdk"); | 132 | analyticsEvent.setEventName("time_spent_on_loyalty_sdk"); | 
| 144 | analyticsEvent.setParameter("name", "GiftsCalculator"); | 133 | analyticsEvent.setParameter("name", "GiftsCalculator"); | 
| ... | @@ -157,25 +146,22 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | ... | @@ -157,25 +146,22 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | 
| 157 | WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyHistoryScreen") | 146 | WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyHistoryScreen") | 
| 158 | .concat(":") | 147 | .concat(":") | 
| 159 | .concat("TabExpired")); | 148 | .concat("TabExpired")); | 
| 160 | - | 149 | + mLlExpiredTab.setBackgroundResource(R.drawable.bottom_border_gradient2); | 
| 161 | - mLlExpiredTab.setBackgroundResource(R.drawable.bottom_border_light_blue); | ||
| 162 | TextView expiredTab = findViewById(R.id.tv_expired_tab); | 150 | TextView expiredTab = findViewById(R.id.tv_expired_tab); | 
| 163 | - expiredTab.setTextColor(ContextCompat.getColor(this, R.color.cos_light_black)); | 151 | + expiredTab.setTextColor(ContextCompat.getColor(this, R.color.cos_cyan4)); | 
| 164 | CalligraphyTypefaceSpan typefaceBoldSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf")); | 152 | CalligraphyTypefaceSpan typefaceBoldSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf")); | 
| 165 | SpannableStringBuilder sBuilderExpired = new SpannableStringBuilder(); | 153 | SpannableStringBuilder sBuilderExpired = new SpannableStringBuilder(); | 
| 166 | sBuilderExpired.append(getString(R.string.cos_redeemed_coupons_tab)); | 154 | sBuilderExpired.append(getString(R.string.cos_redeemed_coupons_tab)); | 
| 167 | sBuilderExpired.setSpan(typefaceBoldSpan, 0, getString(R.string.cos_redeemed_coupons_tab).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 155 | sBuilderExpired.setSpan(typefaceBoldSpan, 0, getString(R.string.cos_redeemed_coupons_tab).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 
| 168 | expiredTab.setText(sBuilderExpired, TextView.BufferType.SPANNABLE); | 156 | expiredTab.setText(sBuilderExpired, TextView.BufferType.SPANNABLE); | 
| 169 | - | ||
| 170 | mLlSharedTab.setBackgroundResource(R.drawable.bottom_border_transparent); | 157 | mLlSharedTab.setBackgroundResource(R.drawable.bottom_border_transparent); | 
| 171 | TextView sharedTab = findViewById(R.id.tv_shared_tab); | 158 | TextView sharedTab = findViewById(R.id.tv_shared_tab); | 
| 172 | - sharedTab.setTextColor(ContextCompat.getColor(this, R.color.cos_gray2)); | 159 | + sharedTab.setTextColor(ContextCompat.getColor(this, R.color.cos_dark_grey)); | 
| 173 | CalligraphyTypefaceSpan typefaceRegularSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-SemiBold.ttf")); | 160 | CalligraphyTypefaceSpan typefaceRegularSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-SemiBold.ttf")); | 
| 174 | SpannableStringBuilder sBuilderShared = new SpannableStringBuilder(); | 161 | SpannableStringBuilder sBuilderShared = new SpannableStringBuilder(); | 
| 175 | sBuilderShared.append(getString(R.string.cos_shared_gifts_tab)); | 162 | sBuilderShared.append(getString(R.string.cos_shared_gifts_tab)); | 
| 176 | sBuilderShared.setSpan(typefaceRegularSpan, 0, getString(R.string.cos_shared_gifts_tab).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 163 | sBuilderShared.setSpan(typefaceRegularSpan, 0, getString(R.string.cos_shared_gifts_tab).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 
| 177 | sharedTab.setText(sBuilderShared, TextView.BufferType.SPANNABLE); | 164 | sharedTab.setText(sBuilderShared, TextView.BufferType.SPANNABLE); | 
| 178 | - | ||
| 179 | mRlSharedView.setVisibility(View.GONE); | 165 | mRlSharedView.setVisibility(View.GONE); | 
| 180 | mRlExpiredView.setVisibility(View.VISIBLE); | 166 | mRlExpiredView.setVisibility(View.VISIBLE); | 
| 181 | return; | 167 | return; | 
| ... | @@ -184,25 +170,22 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | ... | @@ -184,25 +170,22 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | 
| 184 | WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyHistoryScreen") | 170 | WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyHistoryScreen") | 
| 185 | .concat(":") | 171 | .concat(":") | 
| 186 | .concat("TabShared")); | 172 | .concat("TabShared")); | 
| 187 | - | 173 | + mLlSharedTab.setBackgroundResource(R.drawable.bottom_border_gradient2); | 
| 188 | - mLlSharedTab.setBackgroundResource(R.drawable.bottom_border_light_blue); | ||
| 189 | TextView sharedTab = findViewById(R.id.tv_shared_tab); | 174 | TextView sharedTab = findViewById(R.id.tv_shared_tab); | 
| 190 | - sharedTab.setTextColor(ContextCompat.getColor(this, R.color.cos_light_black)); | 175 | + sharedTab.setTextColor(ContextCompat.getColor(this, R.color.cos_cyan4)); | 
| 191 | CalligraphyTypefaceSpan typefaceBoldSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf")); | 176 | CalligraphyTypefaceSpan typefaceBoldSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf")); | 
| 192 | SpannableStringBuilder sBuilderShared = new SpannableStringBuilder(); | 177 | SpannableStringBuilder sBuilderShared = new SpannableStringBuilder(); | 
| 193 | sBuilderShared.append(getString(R.string.cos_shared_gifts_tab)); | 178 | sBuilderShared.append(getString(R.string.cos_shared_gifts_tab)); | 
| 194 | sBuilderShared.setSpan(typefaceBoldSpan, 0, getString(R.string.cos_shared_gifts_tab).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 179 | sBuilderShared.setSpan(typefaceBoldSpan, 0, getString(R.string.cos_shared_gifts_tab).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 
| 195 | sharedTab.setText(sBuilderShared, TextView.BufferType.SPANNABLE); | 180 | sharedTab.setText(sBuilderShared, TextView.BufferType.SPANNABLE); | 
| 196 | - | ||
| 197 | mLlExpiredTab.setBackgroundResource(R.drawable.bottom_border_transparent); | 181 | mLlExpiredTab.setBackgroundResource(R.drawable.bottom_border_transparent); | 
| 198 | TextView expiredTab = findViewById(R.id.tv_expired_tab); | 182 | TextView expiredTab = findViewById(R.id.tv_expired_tab); | 
| 199 | - expiredTab.setTextColor(ContextCompat.getColor(this, R.color.cos_gray2)); | 183 | + expiredTab.setTextColor(ContextCompat.getColor(this, R.color.cos_dark_grey)); | 
| 200 | CalligraphyTypefaceSpan typefaceRegularSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-SemiBold.ttf")); | 184 | CalligraphyTypefaceSpan typefaceRegularSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-SemiBold.ttf")); | 
| 201 | SpannableStringBuilder sBuilderExpired = new SpannableStringBuilder(); | 185 | SpannableStringBuilder sBuilderExpired = new SpannableStringBuilder(); | 
| 202 | sBuilderExpired.append(getString(R.string.cos_redeemed_coupons_tab)); | 186 | sBuilderExpired.append(getString(R.string.cos_redeemed_coupons_tab)); | 
| 203 | sBuilderExpired.setSpan(typefaceRegularSpan, 0, getString(R.string.cos_redeemed_coupons_tab).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 187 | sBuilderExpired.setSpan(typefaceRegularSpan, 0, getString(R.string.cos_redeemed_coupons_tab).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 
| 204 | expiredTab.setText(sBuilderExpired, TextView.BufferType.SPANNABLE); | 188 | expiredTab.setText(sBuilderExpired, TextView.BufferType.SPANNABLE); | 
| 205 | - | ||
| 206 | mRlExpiredView.setVisibility(View.GONE); | 189 | mRlExpiredView.setVisibility(View.GONE); | 
| 207 | mRlSharedView.setVisibility(View.VISIBLE); | 190 | mRlSharedView.setVisibility(View.VISIBLE); | 
| 208 | return; | 191 | return; | 
| ... | @@ -230,66 +213,45 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | ... | @@ -230,66 +213,45 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | 
| 230 | // =========================================================== | 213 | // =========================================================== | 
| 231 | // Methods | 214 | // Methods | 
| 232 | // =========================================================== | 215 | // =========================================================== | 
| 233 | - | ||
| 234 | private void initViews() { | 216 | private void initViews() { | 
| 235 | mIvBack.setOnClickListener(this); | 217 | mIvBack.setOnClickListener(this); | 
| 236 | mLlExpiredTab.setOnClickListener(this); | 218 | mLlExpiredTab.setOnClickListener(this); | 
| 237 | mLlSharedTab.setOnClickListener(this); | 219 | mLlSharedTab.setOnClickListener(this); | 
| 238 | mLlShowMoreExpired.setOnClickListener(this); | 220 | mLlShowMoreExpired.setOnClickListener(this); | 
| 239 | mLlShowMoreShared.setOnClickListener(this); | 221 | mLlShowMoreShared.setOnClickListener(this); | 
| 240 | - | 222 | + mLlExpiredTab.setBackgroundResource(R.drawable.bottom_border_gradient2); | 
| 241 | - mLlExpiredTab.setBackgroundResource(R.drawable.bottom_border_light_blue); | ||
| 242 | TextView expiredTab = findViewById(R.id.tv_expired_tab); | 223 | TextView expiredTab = findViewById(R.id.tv_expired_tab); | 
| 243 | - expiredTab.setTextColor(ContextCompat.getColor(this, R.color.cos_light_black)); | 224 | + expiredTab.setTextColor(ContextCompat.getColor(this, R.color.cos_cyan4)); | 
| 244 | CalligraphyTypefaceSpan typefaceBoldExpiredSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf")); | 225 | CalligraphyTypefaceSpan typefaceBoldExpiredSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf")); | 
| 245 | SpannableStringBuilder sBuilderExpired = new SpannableStringBuilder(); | 226 | SpannableStringBuilder sBuilderExpired = new SpannableStringBuilder(); | 
| 246 | sBuilderExpired.append(getString(R.string.cos_redeemed_coupons_tab)); | 227 | sBuilderExpired.append(getString(R.string.cos_redeemed_coupons_tab)); | 
| 247 | sBuilderExpired.setSpan(typefaceBoldExpiredSpan, 0, getString(R.string.cos_redeemed_coupons_tab).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 228 | sBuilderExpired.setSpan(typefaceBoldExpiredSpan, 0, getString(R.string.cos_redeemed_coupons_tab).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 
| 248 | expiredTab.setText(sBuilderExpired, TextView.BufferType.SPANNABLE); | 229 | expiredTab.setText(sBuilderExpired, TextView.BufferType.SPANNABLE); | 
| 249 | - | ||
| 250 | mLlSharedTab.setBackgroundResource(R.drawable.bottom_border_transparent); | 230 | mLlSharedTab.setBackgroundResource(R.drawable.bottom_border_transparent); | 
| 251 | TextView sharedTab = findViewById(R.id.tv_shared_tab); | 231 | TextView sharedTab = findViewById(R.id.tv_shared_tab); | 
| 252 | - sharedTab.setTextColor(ContextCompat.getColor(this, R.color.cos_gray2)); | 232 | + sharedTab.setTextColor(ContextCompat.getColor(this, R.color.cos_dark_grey)); | 
| 253 | CalligraphyTypefaceSpan typefaceRegularSharedSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-SemiBold.ttf")); | 233 | CalligraphyTypefaceSpan typefaceRegularSharedSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-SemiBold.ttf")); | 
| 254 | SpannableStringBuilder sBuilderShared = new SpannableStringBuilder(); | 234 | SpannableStringBuilder sBuilderShared = new SpannableStringBuilder(); | 
| 255 | sBuilderShared.append(getString(R.string.cos_shared_gifts_tab)); | 235 | sBuilderShared.append(getString(R.string.cos_shared_gifts_tab)); | 
| 256 | sBuilderShared.setSpan(typefaceRegularSharedSpan, 0, getString(R.string.cos_shared_gifts_tab).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 236 | sBuilderShared.setSpan(typefaceRegularSharedSpan, 0, getString(R.string.cos_shared_gifts_tab).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 
| 257 | sharedTab.setText(sBuilderShared, TextView.BufferType.SPANNABLE); | 237 | sharedTab.setText(sBuilderShared, TextView.BufferType.SPANNABLE); | 
| 258 | - | ||
| 259 | String badgeValue = String.format("%.02f", countValue); | 238 | String badgeValue = String.format("%.02f", countValue); | 
| 260 | - | ||
| 261 | SpannableStringBuilder sBuilder = new SpannableStringBuilder(); | 239 | SpannableStringBuilder sBuilder = new SpannableStringBuilder(); | 
| 262 | - sBuilder | 240 | + sBuilder.append(String.format(getString(R.string.cos_supermarket_history), badgeValue, String.valueOf(mExpiredMarketCoupons.size()))); | 
| 263 | - .append(getString(R.string.cos_wallet_text3)) | ||
| 264 | - .append(String.format(getString(R.string.cos_value), badgeValue)) | ||
| 265 | - .append(getString(R.string.cos_wallet_text4)) | ||
| 266 | - .append(String.format(getString(R.string.cos_value2), String.valueOf(mExpiredMarketCoupons.size()))) | ||
| 267 | - .append(getString(R.string.cos_wallet_text5)); | ||
| 268 | - | ||
| 269 | - CalligraphyTypefaceSpan typefaceRegularSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Regular.ttf")); | ||
| 270 | - CalligraphyTypefaceSpan typefaceRegularSpan2 = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Regular.ttf")); | ||
| 271 | - CalligraphyTypefaceSpan typefaceRegularSpan3 = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Regular.ttf")); | ||
| 272 | CalligraphyTypefaceSpan typefaceBoldSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf")); | 241 | CalligraphyTypefaceSpan typefaceBoldSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf")); | 
| 273 | CalligraphyTypefaceSpan typefaceBoldSpan2 = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf")); | 242 | CalligraphyTypefaceSpan typefaceBoldSpan2 = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf")); | 
| 274 | - sBuilder.setSpan(typefaceRegularSpan, 0, getString(R.string.cos_wallet_text3).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 243 | + sBuilder.setSpan(typefaceBoldSpan, 26, 26 + badgeValue.length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 
| 275 | - sBuilder.setSpan(typefaceBoldSpan, getString(R.string.cos_wallet_text3).length(), getString(R.string.cos_wallet_text3).length() + String.valueOf(countValue).length() + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 244 | + sBuilder.setSpan(typefaceBoldSpan2, 26 + badgeValue.length() + 1 + 18, 26 + badgeValue.length() + 1 + 18 + String.valueOf(mExpiredMarketCoupons.size()).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | 
| 276 | - sBuilder.setSpan(typefaceRegularSpan2, getString(R.string.cos_wallet_text3).length() + String.valueOf(countValue).length() + 1, getString(R.string.cos_wallet_text3).length() + String.valueOf(countValue).length() + 1 + getString(R.string.cos_wallet_text4).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | ||
| 277 | - sBuilder.setSpan(typefaceBoldSpan2, getString(R.string.cos_wallet_text3).length() + String.valueOf(countValue).length() + 1 + getString(R.string.cos_wallet_text4).length(), getString(R.string.cos_wallet_text3).length() + String.valueOf(countValue).length() + 1 + getString(R.string.cos_wallet_text4).length() + String.valueOf(mExpiredMarketCoupons.size()).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | ||
| 278 | - sBuilder.setSpan(typefaceRegularSpan3, getString(R.string.cos_wallet_text3).length() + String.valueOf(countValue).length() + 1 + getString(R.string.cos_wallet_text4).length() + String.valueOf(mExpiredMarketCoupons.size()).length(), getString(R.string.cos_wallet_text3).length() + String.valueOf(countValue).length() + 1 + getString(R.string.cos_wallet_text4).length() + String.valueOf(mExpiredMarketCoupons.size()).length() + getString(R.string.cos_wallet_text5).length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | ||
| 279 | - | ||
| 280 | mTvCouponsValueAll.setText(sBuilder, TextView.BufferType.SPANNABLE); | 245 | mTvCouponsValueAll.setText(sBuilder, TextView.BufferType.SPANNABLE); | 
| 281 | - | ||
| 282 | if (mExpiredMarketCoupons != null && mExpiredMarketCoupons.size() > 0) { | 246 | if (mExpiredMarketCoupons != null && mExpiredMarketCoupons.size() > 0) { | 
| 283 | if (mExpiredMarketCoupons.size() > 3) { | 247 | if (mExpiredMarketCoupons.size() > 3) { | 
| 284 | ArrayList<Coupon> tempList = new ArrayList<>(mExpiredMarketCoupons.subList(0, 3)); | 248 | ArrayList<Coupon> tempList = new ArrayList<>(mExpiredMarketCoupons.subList(0, 3)); | 
| 285 | - | ||
| 286 | mRvExpiredCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); | 249 | mRvExpiredCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); | 
| 287 | mAdapterExpiredCoupons = new ExpiredCouponAdapter(this, tempList, true); | 250 | mAdapterExpiredCoupons = new ExpiredCouponAdapter(this, tempList, true); | 
| 288 | mRvExpiredCoupons.setAdapter(mAdapterExpiredCoupons); | 251 | mRvExpiredCoupons.setAdapter(mAdapterExpiredCoupons); | 
| 289 | mLlShowMoreExpired.setVisibility(View.VISIBLE); | 252 | mLlShowMoreExpired.setVisibility(View.VISIBLE); | 
| 290 | return; | 253 | return; | 
| 291 | } | 254 | } | 
| 292 | - | ||
| 293 | mRvExpiredCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); | 255 | mRvExpiredCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); | 
| 294 | mAdapterExpiredCoupons = new ExpiredCouponAdapter(this, mExpiredMarketCoupons, true); | 256 | mAdapterExpiredCoupons = new ExpiredCouponAdapter(this, mExpiredMarketCoupons, true); | 
| 295 | mRvExpiredCoupons.setAdapter(mAdapterExpiredCoupons); | 257 | mRvExpiredCoupons.setAdapter(mAdapterExpiredCoupons); | 
| ... | @@ -301,7 +263,6 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | ... | @@ -301,7 +263,6 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | 
| 301 | // =========================================================== | 263 | // =========================================================== | 
| 302 | // Inner and Anonymous Classes | 264 | // Inner and Anonymous Classes | 
| 303 | // =========================================================== | 265 | // =========================================================== | 
| 304 | - | ||
| 305 | private CallbackReceiver<SharingList> mSharingHistoryCallback = new CallbackReceiver<SharingList>() { | 266 | private CallbackReceiver<SharingList> mSharingHistoryCallback = new CallbackReceiver<SharingList>() { | 
| 306 | @Override | 267 | @Override | 
| 307 | public void onSuccess(SharingList result) { | 268 | public void onSuccess(SharingList result) { | 
| ... | @@ -321,19 +282,16 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | ... | @@ -321,19 +282,16 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | 
| 321 | } | 282 | } | 
| 322 | } | 283 | } | 
| 323 | } | 284 | } | 
| 324 | - | ||
| 325 | runOnUiThread(() -> { | 285 | runOnUiThread(() -> { | 
| 326 | if (mSharedCoupons != null && mSharedCoupons.size() > 0) { | 286 | if (mSharedCoupons != null && mSharedCoupons.size() > 0) { | 
| 327 | if (mSharedCoupons.size() > 3) { | 287 | if (mSharedCoupons.size() > 3) { | 
| 328 | ArrayList<SharingCoupon> tempList = new ArrayList<>(mSharedCoupons.subList(0, 3)); | 288 | ArrayList<SharingCoupon> tempList = new ArrayList<>(mSharedCoupons.subList(0, 3)); | 
| 329 | - | ||
| 330 | mRvSharedCoupons.setLayoutManager(new LinearLayoutManager(LoyaltyMarketAnalysisActivity.this, LinearLayoutManager.VERTICAL, false)); | 289 | mRvSharedCoupons.setLayoutManager(new LinearLayoutManager(LoyaltyMarketAnalysisActivity.this, LinearLayoutManager.VERTICAL, false)); | 
| 331 | mAdapterSharedCoupons = new SharedCouponAdapter(LoyaltyMarketAnalysisActivity.this, tempList); | 290 | mAdapterSharedCoupons = new SharedCouponAdapter(LoyaltyMarketAnalysisActivity.this, tempList); | 
| 332 | mRvSharedCoupons.setAdapter(mAdapterSharedCoupons); | 291 | mRvSharedCoupons.setAdapter(mAdapterSharedCoupons); | 
| 333 | mLlShowMoreShared.setVisibility(View.VISIBLE); | 292 | mLlShowMoreShared.setVisibility(View.VISIBLE); | 
| 334 | return; | 293 | return; | 
| 335 | } | 294 | } | 
| 336 | - | ||
| 337 | mRvSharedCoupons.setLayoutManager(new LinearLayoutManager(LoyaltyMarketAnalysisActivity.this, LinearLayoutManager.VERTICAL, false)); | 295 | mRvSharedCoupons.setLayoutManager(new LinearLayoutManager(LoyaltyMarketAnalysisActivity.this, LinearLayoutManager.VERTICAL, false)); | 
| 338 | mAdapterSharedCoupons = new SharedCouponAdapter(LoyaltyMarketAnalysisActivity.this, mSharedCoupons); | 296 | mAdapterSharedCoupons = new SharedCouponAdapter(LoyaltyMarketAnalysisActivity.this, mSharedCoupons); | 
| 339 | mRvSharedCoupons.setAdapter(mAdapterSharedCoupons); | 297 | mRvSharedCoupons.setAdapter(mAdapterSharedCoupons); | 
| ... | @@ -348,4 +306,4 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | ... | @@ -348,4 +306,4 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl | 
| 348 | WarpUtils.log("SHARED_COUPONS_ERROR " + String.valueOf(errorCode)); | 306 | WarpUtils.log("SHARED_COUPONS_ERROR " + String.valueOf(errorCode)); | 
| 349 | } | 307 | } | 
| 350 | }; | 308 | }; | 
| 351 | -} | 309 | +} | 
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... | 
| ... | @@ -274,7 +274,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie | ... | @@ -274,7 +274,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie | 
| 274 | return; | 274 | return; | 
| 275 | } | 275 | } | 
| 276 | if (view.getId() == R.id.cl_market_inner) { | 276 | if (view.getId() == R.id.cl_market_inner) { | 
| 277 | - if (countValue > 0) { | 277 | +// if (countValue > 0) { | 
| 278 | WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen") | 278 | WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen") | 
| 279 | .concat(":") | 279 | .concat(":") | 
| 280 | .concat("MarketBanner")); | 280 | .concat("MarketBanner")); | 
| ... | @@ -284,7 +284,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie | ... | @@ -284,7 +284,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie | 
| 284 | EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); | 284 | EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); | 
| 285 | Intent intent = new Intent(LoyaltyWallet.this, LoyaltyMarketAnalysisActivity.class); | 285 | Intent intent = new Intent(LoyaltyWallet.this, LoyaltyMarketAnalysisActivity.class); | 
| 286 | startActivity(intent); | 286 | startActivity(intent); | 
| 287 | - } | 287 | +// } | 
| 288 | return; | 288 | return; | 
| 289 | } | 289 | } | 
| 290 | if (view.getId() == R.id.cl_mygifts) { | 290 | if (view.getId() == R.id.cl_mygifts) { | 
| ... | @@ -391,7 +391,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie | ... | @@ -391,7 +391,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie | 
| 391 | if (mUnifiedCoupons != null && mUnifiedCoupons.size() > 0) { | 391 | if (mUnifiedCoupons != null && mUnifiedCoupons.size() > 0) { | 
| 392 | ArrayList<UnifiedCoupon> unilist = new ArrayList<UnifiedCoupon>(); | 392 | ArrayList<UnifiedCoupon> unilist = new ArrayList<UnifiedCoupon>(); | 
| 393 | for (UnifiedCoupon unicpn : mUnifiedCoupons) { | 393 | for (UnifiedCoupon unicpn : mUnifiedCoupons) { | 
| 394 | - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); | 394 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); | 
| 395 | Date newDate = new Date(); | 395 | Date newDate = new Date(); | 
| 396 | try { | 396 | try { | 
| 397 | newDate = simpleDateFormat.parse(unicpn.getCreated()); | 397 | newDate = simpleDateFormat.parse(unicpn.getCreated()); | 
| ... | @@ -644,7 +644,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie | ... | @@ -644,7 +644,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie | 
| 644 | mUnifiedCouponsAll = result; | 644 | mUnifiedCouponsAll = result; | 
| 645 | ArrayList<UnifiedCoupon> cpnlist = new ArrayList<UnifiedCoupon>(); | 645 | ArrayList<UnifiedCoupon> cpnlist = new ArrayList<UnifiedCoupon>(); | 
| 646 | for (UnifiedCoupon cpn : result) { | 646 | for (UnifiedCoupon cpn : result) { | 
| 647 | - if (cpn.getStatus().equals("active")) { | 647 | + if (cpn.getStatus().trim().equals("active")) { | 
| 648 | cpnlist.add(cpn); | 648 | cpnlist.add(cpn); | 
| 649 | } | 649 | } | 
| 650 | } | 650 | } | ... | ... | 
| ... | @@ -95,7 +95,7 @@ public class MarketCouponAdapter extends RecyclerView.Adapter<MarketCouponAdapte | ... | @@ -95,7 +95,7 @@ public class MarketCouponAdapter extends RecyclerView.Adapter<MarketCouponAdapte | 
| 95 | for (Coupon item : couponItem.getCoupons()) { | 95 | for (Coupon item : couponItem.getCoupons()) { | 
| 96 | if (item.getStatus() == 1) { | 96 | if (item.getStatus() == 1) { | 
| 97 | count++; | 97 | count++; | 
| 98 | - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); | 98 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); | 
| 99 | Date newDate = new Date(); | 99 | Date newDate = new Date(); | 
| 100 | try { | 100 | try { | 
| 101 | newDate = simpleDateFormat.parse(item.getExpiration()); | 101 | newDate = simpleDateFormat.parse(item.getExpiration()); | 
| ... | @@ -110,7 +110,7 @@ public class MarketCouponAdapter extends RecyclerView.Adapter<MarketCouponAdapte | ... | @@ -110,7 +110,7 @@ public class MarketCouponAdapter extends RecyclerView.Adapter<MarketCouponAdapte | 
| 110 | Collections.sort(couponList, (coupon1, coupon2) -> coupon1.getExpirationDate().compareTo(coupon2.getExpirationDate())); | 110 | Collections.sort(couponList, (coupon1, coupon2) -> coupon1.getExpirationDate().compareTo(coupon2.getExpirationDate())); | 
| 111 | 111 | ||
| 112 | if (couponList != null && couponList.size() > 0) { | 112 | if (couponList != null && couponList.size() > 0) { | 
| 113 | - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); | 113 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); | 
| 114 | Date newDate = new Date(); | 114 | Date newDate = new Date(); | 
| 115 | try { | 115 | try { | 
| 116 | newDate = simpleDateFormat.parse(couponList.get(0).getExpiration()); | 116 | newDate = simpleDateFormat.parse(couponList.get(0).getExpiration()); | ... | ... | 
| ... | @@ -93,6 +93,7 @@ | ... | @@ -93,6 +93,7 @@ | 
| 93 | android:layout_width="0dp" | 93 | android:layout_width="0dp" | 
| 94 | android:layout_height="wrap_content" | 94 | android:layout_height="wrap_content" | 
| 95 | android:maxLines="3" | 95 | android:maxLines="3" | 
| 96 | + android:ellipsize="end" | ||
| 96 | android:textColor="@color/cos_light_black" | 97 | android:textColor="@color/cos_light_black" | 
| 97 | android:textSize="12sp" | 98 | android:textSize="12sp" | 
| 98 | app:layout_constraintBottom_toBottomOf="parent" | 99 | app:layout_constraintBottom_toBottomOf="parent" | ... | ... | 
| ... | @@ -87,6 +87,7 @@ | ... | @@ -87,6 +87,7 @@ | 
| 87 | android:layout_width="0dp" | 87 | android:layout_width="0dp" | 
| 88 | android:layout_height="wrap_content" | 88 | android:layout_height="wrap_content" | 
| 89 | android:maxLines="3" | 89 | android:maxLines="3" | 
| 90 | + android:ellipsize="end" | ||
| 90 | android:textColor="@color/cos_light_black" | 91 | android:textColor="@color/cos_light_black" | 
| 91 | android:textSize="12sp" | 92 | android:textSize="12sp" | 
| 92 | app:layout_constraintBottom_toBottomOf="parent" | 93 | app:layout_constraintBottom_toBottomOf="parent" | ... | ... | 
| ... | @@ -91,6 +91,7 @@ | ... | @@ -91,6 +91,7 @@ | 
| 91 | android:layout_marginStart="8dp" | 91 | android:layout_marginStart="8dp" | 
| 92 | android:layout_marginEnd="16dp" | 92 | android:layout_marginEnd="16dp" | 
| 93 | android:maxLines="3" | 93 | android:maxLines="3" | 
| 94 | + android:ellipsize="end" | ||
| 94 | android:textColor="@color/cos_light_black" | 95 | android:textColor="@color/cos_light_black" | 
| 95 | android:textSize="12sp" | 96 | android:textSize="12sp" | 
| 96 | app:layout_constraintBottom_toBottomOf="parent" | 97 | app:layout_constraintBottom_toBottomOf="parent" | ... | ... | 
| ... | @@ -169,6 +169,7 @@ | ... | @@ -169,6 +169,7 @@ | 
| 169 | <string name="cos_coupon_date_limit2">%1$s</string> | 169 | <string name="cos_coupon_date_limit2">%1$s</string> | 
| 170 | <string name="cos_for_you_all">Μέχρι τώρα έχεις κερδίσει %1$s€ στο For You!</string> | 170 | <string name="cos_for_you_all">Μέχρι τώρα έχεις κερδίσει %1$s€ στο For You!</string> | 
| 171 | <string name="cos_supermarket_win">Έχεις κερδίσει %1$s€ με τα\nSuperMarket Deals!</string> | 171 | <string name="cos_supermarket_win">Έχεις κερδίσει %1$s€ με τα\nSuperMarket Deals!</string> | 
| 172 | + <string name="cos_supermarket_history">Μέχρι τώρα έχεις κερδίσει %1$s€ σε προσφορές από %2$s κουπόνια!</string> | ||
| 172 | 173 | ||
| 173 | <string-array name="coupons_array"> | 174 | <string-array name="coupons_array"> | 
| 174 | <item>Κουπόνια</item> | 175 | <item>Κουπόνια</item> | ... | ... | 
- 
Please register or login to post a comment
