Panagiotis Triantafyllou

redesign supermarket part3

Showing 23 changed files with 920 additions and 109 deletions
...@@ -2,7 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
2 2
3 ext { 3 ext {
4 PUBLISH_GROUP_ID = 'ly.warp' 4 PUBLISH_GROUP_ID = 'ly.warp'
5 - PUBLISH_VERSION = '4.5.4.6rc51' 5 + PUBLISH_VERSION = '4.5.4.6rc52'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 7 }
8 8
......
...@@ -107,6 +107,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis ...@@ -107,6 +107,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
107 new Thread(() -> { 107 new Thread(() -> {
108 if (!Thread.currentThread().isInterrupted()) { 108 if (!Thread.currentThread().isInterrupted()) {
109 WarplyManager.getSharingHistory(new WarplySharingHistoryRequest() 109 WarplyManager.getSharingHistory(new WarplySharingHistoryRequest()
110 + .setExcludeFilter("supermarket")
110 , mSharingHistoryCallback); 111 , mSharingHistoryCallback);
111 } 112 }
112 Thread.currentThread().interrupt(); 113 Thread.currentThread().interrupt();
......
1 +package ly.warp.sdk.activities;
2 +
3 +import android.app.Activity;
4 +import android.content.Context;
5 +import android.os.Bundle;
6 +import android.os.Handler;
7 +import android.text.SpannableStringBuilder;
8 +import android.text.Spanned;
9 +import android.view.View;
10 +import android.widget.ImageView;
11 +import android.widget.LinearLayout;
12 +import android.widget.RelativeLayout;
13 +import android.widget.TextView;
14 +
15 +import androidx.core.content.ContextCompat;
16 +import androidx.recyclerview.widget.LinearLayoutManager;
17 +import androidx.recyclerview.widget.RecyclerView;
18 +
19 +import org.greenrobot.eventbus.EventBus;
20 +
21 +import java.util.ArrayList;
22 +
23 +import io.github.inflationx.calligraphy3.CalligraphyTypefaceSpan;
24 +import io.github.inflationx.calligraphy3.TypefaceUtils;
25 +import io.github.inflationx.viewpump.ViewPumpContextWrapper;
26 +import ly.warp.sdk.R;
27 +import ly.warp.sdk.io.callbacks.CallbackReceiver;
28 +import ly.warp.sdk.io.models.Coupon;
29 +import ly.warp.sdk.io.models.Couponset;
30 +import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
31 +import ly.warp.sdk.io.models.SharingCoupon;
32 +import ly.warp.sdk.io.models.SharingList;
33 +import ly.warp.sdk.io.models.UnifiedCoupon;
34 +import ly.warp.sdk.io.request.WarplySharingHistoryRequest;
35 +import ly.warp.sdk.utils.WarpUtils;
36 +import ly.warp.sdk.utils.WarplyManagerHelper;
37 +import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
38 +import ly.warp.sdk.utils.managers.WarplyEventBusManager;
39 +import ly.warp.sdk.utils.managers.WarplyManager;
40 +import ly.warp.sdk.views.adapters.ExpiredCouponAdapter;
41 +import ly.warp.sdk.views.adapters.SharedCouponAdapter;
42 +
43 +
44 +public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnClickListener {
45 +
46 + // ===========================================================
47 + // Constants
48 + // ===========================================================
49 +
50 + // ===========================================================
51 + // Fields
52 + // ===========================================================
53 +
54 + private ImageView mIvBack;
55 + private TextView mTvCouponsValueAll, mTvSharedEmpty, mTvExpiredEmpty;
56 + private RecyclerView mRvExpiredCoupons, mRvSharedCoupons;
57 + private ExpiredCouponAdapter mAdapterExpiredCoupons;
58 + private SharedCouponAdapter mAdapterSharedCoupons;
59 + private LinearLayout mLlExpiredTab, mLlSharedTab, mLlShowMoreExpired, mLlShowMoreShared;
60 + private RelativeLayout mRlExpiredView, mRlSharedView;
61 + private SharingList mSharedCoupons = new SharingList();
62 + private int mTimer = 0;
63 + private Handler mSecondsHandler;
64 + private ArrayList<Coupon> mExpiredMarketCoupons = new ArrayList<Coupon>();
65 + private float countValue = 0.0f;
66 +
67 + // ===========================================================
68 + // Methods for/from SuperClass/Interfaces
69 + // ===========================================================
70 +
71 + @Override
72 + public void onCreate(Bundle savedInstanceState) {
73 + super.onCreate(savedInstanceState);
74 + setContentView(R.layout.activity_loyalty_market_analysis);
75 + mSecondsHandler = new Handler();
76 +
77 + mIvBack = findViewById(R.id.iv_loyalty_analysis_close);
78 + mTvCouponsValueAll = findViewById(R.id.tv_expired_coupons_title);
79 + mRvExpiredCoupons = findViewById(R.id.rv_expired_coupons);
80 + mLlExpiredTab = findViewById(R.id.cl_tab_coupon_analysis).findViewById(R.id.ll_tab_expired);
81 + mLlSharedTab = findViewById(R.id.cl_tab_coupon_analysis).findViewById(R.id.ll_tab_shared);
82 + mRlExpiredView = findViewById(R.id.rl_expired_view);
83 + mRlSharedView = findViewById(R.id.rl_shared_view);
84 + mRvSharedCoupons = findViewById(R.id.rv_shared_coupons);
85 + mTvSharedEmpty = findViewById(R.id.tv_shared_empty);
86 + mTvExpiredEmpty = findViewById(R.id.tv_expired_empty);
87 + mLlShowMoreExpired = findViewById(R.id.ll_show_more_expired);
88 + mLlShowMoreShared = findViewById(R.id.ll_show_more_shared);
89 +
90 + if (WarplyManagerHelper.getMarketCoupons() != null && WarplyManagerHelper.getMarketCoupons().size() > 0) {
91 + for (UnifiedCoupon unicoupon : WarplyManagerHelper.getMarketCoupons()) {
92 + if (unicoupon.getCoupons() != null && unicoupon.getCoupons().size() > 0) {
93 + for (Coupon inncoupon : unicoupon.getCoupons()) {
94 + if (inncoupon.getStatus() == 0) {
95 + countValue += Float.valueOf(inncoupon.getDiscount());
96 + mExpiredMarketCoupons.add(inncoupon);
97 + }
98 + }
99 + }
100 + }
101 + }
102 +
103 + initViews();
104 + }
105 +
106 + @Override
107 + public void onResume() {
108 + super.onResume();
109 + WarplyAnalyticsManager.logTrackersEvent(this, "screen", "LoyaltyHistoryScreen");
110 + mTimer = 0;
111 + mSecondsHandler.post(new Runnable() {
112 + @Override
113 + public void run() {
114 + mTimer++;
115 + mSecondsHandler.postDelayed(this, 1000);
116 + }
117 + });
118 +
119 + mSharedCoupons.clear();
120 +
121 + new Thread(() -> {
122 + if (!Thread.currentThread().isInterrupted()) {
123 + WarplyManager.getSharingHistory(new WarplySharingHistoryRequest()
124 + .setType("supermarket")
125 + , mSharingHistoryCallback);
126 + }
127 + Thread.currentThread().interrupt();
128 + }).start();
129 + }
130 +
131 + @Override
132 + public void onDestroy() {
133 + super.onDestroy();
134 + }
135 +
136 + @Override
137 + public void onPause() {
138 + super.onPause();
139 + if (mSecondsHandler != null) {
140 + mSecondsHandler.removeCallbacksAndMessages(null);
141 +
142 + LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
143 + analyticsEvent.setEventName("time_spent_on_loyalty_sdk");
144 + analyticsEvent.setParameter("name", "GiftsCalculator");
145 + analyticsEvent.setParameter("seconds", String.valueOf(mTimer));
146 + EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
147 + }
148 + }
149 +
150 + @Override
151 + public void onClick(View view) {
152 + if (view.getId() == R.id.iv_loyalty_analysis_close) {
153 + onBackPressed();
154 + return;
155 + }
156 + if (view.getId() == R.id.ll_tab_expired) {
157 + WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyHistoryScreen")
158 + .concat(":")
159 + .concat("TabExpired"));
160 +
161 + mLlExpiredTab.setBackgroundResource(R.drawable.bottom_border_light_blue);
162 + TextView expiredTab = findViewById(R.id.tv_expired_tab);
163 + expiredTab.setTextColor(ContextCompat.getColor(this, R.color.cos_light_black));
164 + CalligraphyTypefaceSpan typefaceBoldSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
165 + SpannableStringBuilder sBuilderExpired = new SpannableStringBuilder();
166 + 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);
168 + expiredTab.setText(sBuilderExpired, TextView.BufferType.SPANNABLE);
169 +
170 + mLlSharedTab.setBackgroundResource(R.drawable.bottom_border_transparent);
171 + TextView sharedTab = findViewById(R.id.tv_shared_tab);
172 + sharedTab.setTextColor(ContextCompat.getColor(this, R.color.cos_gray2));
173 + CalligraphyTypefaceSpan typefaceRegularSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-SemiBold.ttf"));
174 + SpannableStringBuilder sBuilderShared = new SpannableStringBuilder();
175 + 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);
177 + sharedTab.setText(sBuilderShared, TextView.BufferType.SPANNABLE);
178 +
179 + mRlSharedView.setVisibility(View.GONE);
180 + mRlExpiredView.setVisibility(View.VISIBLE);
181 + return;
182 + }
183 + if (view.getId() == R.id.ll_tab_shared) {
184 + WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyHistoryScreen")
185 + .concat(":")
186 + .concat("TabShared"));
187 +
188 + mLlSharedTab.setBackgroundResource(R.drawable.bottom_border_light_blue);
189 + TextView sharedTab = findViewById(R.id.tv_shared_tab);
190 + sharedTab.setTextColor(ContextCompat.getColor(this, R.color.cos_light_black));
191 + CalligraphyTypefaceSpan typefaceBoldSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
192 + SpannableStringBuilder sBuilderShared = new SpannableStringBuilder();
193 + 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);
195 + sharedTab.setText(sBuilderShared, TextView.BufferType.SPANNABLE);
196 +
197 + mLlExpiredTab.setBackgroundResource(R.drawable.bottom_border_transparent);
198 + TextView expiredTab = findViewById(R.id.tv_expired_tab);
199 + expiredTab.setTextColor(ContextCompat.getColor(this, R.color.cos_gray2));
200 + CalligraphyTypefaceSpan typefaceRegularSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-SemiBold.ttf"));
201 + SpannableStringBuilder sBuilderExpired = new SpannableStringBuilder();
202 + 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);
204 + expiredTab.setText(sBuilderExpired, TextView.BufferType.SPANNABLE);
205 +
206 + mRlExpiredView.setVisibility(View.GONE);
207 + mRlSharedView.setVisibility(View.VISIBLE);
208 + return;
209 + }
210 + if (view.getId() == R.id.ll_show_more_expired) {
211 + mLlShowMoreExpired.setVisibility(View.GONE);
212 + mAdapterExpiredCoupons = new ExpiredCouponAdapter(this, mExpiredMarketCoupons, true);
213 + mRvExpiredCoupons.setAdapter(mAdapterExpiredCoupons);
214 + mAdapterExpiredCoupons.notifyDataSetChanged();
215 + return;
216 + }
217 + if (view.getId() == R.id.ll_show_more_shared) {
218 + mLlShowMoreShared.setVisibility(View.GONE);
219 + mAdapterSharedCoupons = new SharedCouponAdapter(LoyaltyMarketAnalysisActivity.this, mSharedCoupons);
220 + mRvSharedCoupons.setAdapter(mAdapterSharedCoupons);
221 + mAdapterSharedCoupons.notifyDataSetChanged();
222 + }
223 + }
224 +
225 + @Override
226 + protected void attachBaseContext(Context newBase) {
227 + super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase));
228 + }
229 +
230 + // ===========================================================
231 + // Methods
232 + // ===========================================================
233 +
234 + private void initViews() {
235 + mIvBack.setOnClickListener(this);
236 + mLlExpiredTab.setOnClickListener(this);
237 + mLlSharedTab.setOnClickListener(this);
238 + mLlShowMoreExpired.setOnClickListener(this);
239 + mLlShowMoreShared.setOnClickListener(this);
240 +
241 + mLlExpiredTab.setBackgroundResource(R.drawable.bottom_border_light_blue);
242 + TextView expiredTab = findViewById(R.id.tv_expired_tab);
243 + expiredTab.setTextColor(ContextCompat.getColor(this, R.color.cos_light_black));
244 + CalligraphyTypefaceSpan typefaceBoldExpiredSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-Bold.ttf"));
245 + SpannableStringBuilder sBuilderExpired = new SpannableStringBuilder();
246 + 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);
248 + expiredTab.setText(sBuilderExpired, TextView.BufferType.SPANNABLE);
249 +
250 + mLlSharedTab.setBackgroundResource(R.drawable.bottom_border_transparent);
251 + TextView sharedTab = findViewById(R.id.tv_shared_tab);
252 + sharedTab.setTextColor(ContextCompat.getColor(this, R.color.cos_gray2));
253 + CalligraphyTypefaceSpan typefaceRegularSharedSpan = new CalligraphyTypefaceSpan(TypefaceUtils.load(getAssets(), "fonts/PeridotPE-SemiBold.ttf"));
254 + SpannableStringBuilder sBuilderShared = new SpannableStringBuilder();
255 + 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);
257 + sharedTab.setText(sBuilderShared, TextView.BufferType.SPANNABLE);
258 +
259 + String badgeValue = String.format("%.02f", countValue);
260 +
261 + SpannableStringBuilder sBuilder = new SpannableStringBuilder();
262 + sBuilder
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"));
273 + 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);
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);
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);
281 +
282 + if (mExpiredMarketCoupons != null && mExpiredMarketCoupons.size() > 0) {
283 + if (mExpiredMarketCoupons.size() > 3) {
284 + ArrayList<Coupon> tempList = new ArrayList<>(mExpiredMarketCoupons.subList(0, 3));
285 +
286 + mRvExpiredCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
287 + mAdapterExpiredCoupons = new ExpiredCouponAdapter(this, tempList, true);
288 + mRvExpiredCoupons.setAdapter(mAdapterExpiredCoupons);
289 + mLlShowMoreExpired.setVisibility(View.VISIBLE);
290 + return;
291 + }
292 +
293 + mRvExpiredCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
294 + mAdapterExpiredCoupons = new ExpiredCouponAdapter(this, mExpiredMarketCoupons, true);
295 + mRvExpiredCoupons.setAdapter(mAdapterExpiredCoupons);
296 + } else {
297 + mTvExpiredEmpty.setVisibility(View.VISIBLE);
298 + }
299 + }
300 +
301 + // ===========================================================
302 + // Inner and Anonymous Classes
303 + // ===========================================================
304 +
305 + private CallbackReceiver<SharingList> mSharingHistoryCallback = new CallbackReceiver<SharingList>() {
306 + @Override
307 + public void onSuccess(SharingList result) {
308 + if (result != null && result.size() > 0) {
309 + if (WarplyManagerHelper.getCouponsets() != null && WarplyManagerHelper.getCouponsets().size() > 0) {
310 + for (SharingCoupon shCoupon : result) {
311 + for (Couponset cpnset : WarplyManagerHelper.getCouponsets()) {
312 + if (shCoupon.getCouponsetUuid().equals(cpnset.getUuid())) {
313 + SharingCoupon newShCoupon = new SharingCoupon();
314 + newShCoupon = shCoupon;
315 + newShCoupon.setName(cpnset.getName());
316 + newShCoupon.setFinal_price(cpnset.getFinal_price());
317 + mSharedCoupons.add(newShCoupon);
318 + break;
319 + }
320 + }
321 + }
322 + }
323 + }
324 +
325 + runOnUiThread(() -> {
326 + if (mSharedCoupons != null && mSharedCoupons.size() > 0) {
327 + if (mSharedCoupons.size() > 3) {
328 + ArrayList<SharingCoupon> tempList = new ArrayList<>(mSharedCoupons.subList(0, 3));
329 +
330 + mRvSharedCoupons.setLayoutManager(new LinearLayoutManager(LoyaltyMarketAnalysisActivity.this, LinearLayoutManager.VERTICAL, false));
331 + mAdapterSharedCoupons = new SharedCouponAdapter(LoyaltyMarketAnalysisActivity.this, tempList);
332 + mRvSharedCoupons.setAdapter(mAdapterSharedCoupons);
333 + mLlShowMoreShared.setVisibility(View.VISIBLE);
334 + return;
335 + }
336 +
337 + mRvSharedCoupons.setLayoutManager(new LinearLayoutManager(LoyaltyMarketAnalysisActivity.this, LinearLayoutManager.VERTICAL, false));
338 + mAdapterSharedCoupons = new SharedCouponAdapter(LoyaltyMarketAnalysisActivity.this, mSharedCoupons);
339 + mRvSharedCoupons.setAdapter(mAdapterSharedCoupons);
340 + } else {
341 + mTvSharedEmpty.setVisibility(View.VISIBLE);
342 + }
343 + });
344 + }
345 +
346 + @Override
347 + public void onFailure(int errorCode) {
348 + WarpUtils.log("SHARED_COUPONS_ERROR " + String.valueOf(errorCode));
349 + }
350 + };
351 +}
...@@ -282,8 +282,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -282,8 +282,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
282 analyticsEvent.setEventName("did_tap_market_badge"); 282 analyticsEvent.setEventName("did_tap_market_badge");
283 analyticsEvent.setParameter("screen", "Loyalty Wallet"); 283 analyticsEvent.setParameter("screen", "Loyalty Wallet");
284 EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); 284 EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
285 -// Intent intent = new Intent(LoyaltyWallet.this, LoyaltyMarketAnalysisActivity.class); //TODO: uncomment it 285 + Intent intent = new Intent(LoyaltyWallet.this, LoyaltyMarketAnalysisActivity.class);
286 -// startActivity(intent); 286 + startActivity(intent);
287 } 287 }
288 return; 288 return;
289 } 289 }
...@@ -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("E, dd MMM yyyy HH:mm:ss", Locale.US); 394 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
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());
...@@ -401,7 +401,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -401,7 +401,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
401 unicpn.setExpirationDate(newDate); 401 unicpn.setExpirationDate(newDate);
402 unilist.add(unicpn); 402 unilist.add(unicpn);
403 } 403 }
404 +
404 Collections.sort(unilist, (coupon1, coupon2) -> coupon2.getExpirationDate().compareTo(coupon1.getExpirationDate())); 405 Collections.sort(unilist, (coupon1, coupon2) -> coupon2.getExpirationDate().compareTo(coupon1.getExpirationDate()));
406 +
405 mAdapterMarketCoupons = new MarketCouponAdapter(this, unilist); 407 mAdapterMarketCoupons = new MarketCouponAdapter(this, unilist);
406 mRvMarketCoupons.setAdapter(mAdapterMarketCoupons); 408 mRvMarketCoupons.setAdapter(mAdapterMarketCoupons);
407 mAdapterMarketCoupons.getPositionClicks() 409 mAdapterMarketCoupons.getPositionClicks()
......
...@@ -46,6 +46,7 @@ import ly.warp.sdk.io.models.Merchant; ...@@ -46,6 +46,7 @@ import ly.warp.sdk.io.models.Merchant;
46 import ly.warp.sdk.io.models.MerchantList; 46 import ly.warp.sdk.io.models.MerchantList;
47 import ly.warp.sdk.io.request.WarplyMerchantsRequest; 47 import ly.warp.sdk.io.request.WarplyMerchantsRequest;
48 import ly.warp.sdk.utils.WarplyManagerHelper; 48 import ly.warp.sdk.utils.WarplyManagerHelper;
49 +import ly.warp.sdk.utils.WarplyProperty;
49 import ly.warp.sdk.utils.constants.WarpConstants; 50 import ly.warp.sdk.utils.constants.WarpConstants;
50 import ly.warp.sdk.utils.managers.WarplyAnalyticsManager; 51 import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
51 import ly.warp.sdk.utils.managers.WarplyManager; 52 import ly.warp.sdk.utils.managers.WarplyManager;
...@@ -84,12 +85,14 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe ...@@ -84,12 +85,14 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
84 setContentView(R.layout.activity_shops); 85 setContentView(R.layout.activity_shops);
85 86
86 mCouponset = (Couponset) getIntent().getSerializableExtra("couponset"); 87 mCouponset = (Couponset) getIntent().getSerializableExtra("couponset");
88 + if (mCouponset != null) {
87 for (Merchant merchant : WarplyManagerHelper.getMerchantList()) { 89 for (Merchant merchant : WarplyManagerHelper.getMerchantList()) {
88 if (merchant.getUuid().equals(mCouponset.getMerchantUuid())) { 90 if (merchant.getUuid().equals(mCouponset.getMerchantUuid())) {
89 mMerchant = merchant; 91 mMerchant = merchant;
90 break; 92 break;
91 } 93 }
92 } 94 }
95 + }
93 96
94 mIvBack = findViewById(R.id.iv_shops_back); 97 mIvBack = findViewById(R.id.iv_shops_back);
95 mMapView = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mv_shops); 98 mMapView = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mv_shops);
...@@ -189,6 +192,18 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe ...@@ -189,6 +192,18 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
189 } 192 }
190 Thread.currentThread().interrupt(); 193 Thread.currentThread().interrupt();
191 }).start(); 194 }).start();
195 + } else {
196 + ArrayList<String> catuuids = new ArrayList<>();
197 + catuuids.add(WarplyProperty.getAppUuid(this).equals("0086a2088301440792091b9f814c2267") ? "" : "adcace6cab6049c7b7271bc85bc2b26d"); //TODO: add live cat uuid
198 + new Thread(() -> {
199 + if (!Thread.currentThread().isInterrupted()) {
200 + WarplyManager.getMerchantsMultilingual(new WarplyMerchantsRequest()
201 + .setIsMultilingual(true)
202 + .setCategories(catuuids)
203 + , mMerchantsCallback);
204 + }
205 + Thread.currentThread().interrupt();
206 + }).start();
192 } 207 }
193 } 208 }
194 209
...@@ -287,7 +302,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe ...@@ -287,7 +302,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
287 private void openWebsite() { 302 private void openWebsite() {
288 WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShopWebsite"); 303 WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShopWebsite");
289 304
290 - if (!TextUtils.isEmpty(mMerchant.getWebsite())) { 305 + if (mMerchant != null && !TextUtils.isEmpty(mMerchant.getWebsite())) {
291 try { 306 try {
292 Intent intent = new Intent(Intent.ACTION_VIEW); 307 Intent intent = new Intent(Intent.ACTION_VIEW);
293 intent.setData(Uri.parse(mMerchant.getWebsite())); 308 intent.setData(Uri.parse(mMerchant.getWebsite()));
......
...@@ -45,6 +45,7 @@ import ly.warp.sdk.io.models.Merchant; ...@@ -45,6 +45,7 @@ import ly.warp.sdk.io.models.Merchant;
45 import ly.warp.sdk.io.models.MerchantList; 45 import ly.warp.sdk.io.models.MerchantList;
46 import ly.warp.sdk.io.request.WarplyMerchantsRequest; 46 import ly.warp.sdk.io.request.WarplyMerchantsRequest;
47 import ly.warp.sdk.utils.WarplyManagerHelper; 47 import ly.warp.sdk.utils.WarplyManagerHelper;
48 +import ly.warp.sdk.utils.WarplyProperty;
48 import ly.warp.sdk.utils.constants.WarpConstants; 49 import ly.warp.sdk.utils.constants.WarpConstants;
49 import ly.warp.sdk.utils.managers.WarplyAnalyticsManager; 50 import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
50 import ly.warp.sdk.utils.managers.WarplyManager; 51 import ly.warp.sdk.utils.managers.WarplyManager;
...@@ -83,12 +84,14 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic ...@@ -83,12 +84,14 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic
83 setContentView(R.layout.activity_shops_huawei); 84 setContentView(R.layout.activity_shops_huawei);
84 85
85 mCouponset = (Couponset) getIntent().getSerializableExtra("couponset"); 86 mCouponset = (Couponset) getIntent().getSerializableExtra("couponset");
87 + if (mCouponset != null) {
86 for (Merchant merchant : WarplyManagerHelper.getMerchantList()) { 88 for (Merchant merchant : WarplyManagerHelper.getMerchantList()) {
87 if (merchant.getUuid().equals(mCouponset.getMerchantUuid())) { 89 if (merchant.getUuid().equals(mCouponset.getMerchantUuid())) {
88 mMerchant = merchant; 90 mMerchant = merchant;
89 break; 91 break;
90 } 92 }
91 } 93 }
94 + }
92 95
93 mIvBack = findViewById(R.id.iv_shops_back); 96 mIvBack = findViewById(R.id.iv_shops_back);
94 mSupportMapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mv_shops_huawei); 97 mSupportMapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mv_shops_huawei);
...@@ -190,6 +193,18 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic ...@@ -190,6 +193,18 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic
190 } 193 }
191 Thread.currentThread().interrupt(); 194 Thread.currentThread().interrupt();
192 }).start(); 195 }).start();
196 + } else {
197 + ArrayList<String> catuuids = new ArrayList<>();
198 + catuuids.add(WarplyProperty.getAppUuid(this).equals("0086a2088301440792091b9f814c2267") ? "" : "adcace6cab6049c7b7271bc85bc2b26d"); //TODO: add live cat uuid
199 + new Thread(() -> {
200 + if (!Thread.currentThread().isInterrupted()) {
201 + WarplyManager.getMerchantsMultilingual(new WarplyMerchantsRequest()
202 + .setIsMultilingual(true)
203 + .setCategories(catuuids)
204 + , mMerchantsCallback);
205 + }
206 + Thread.currentThread().interrupt();
207 + }).start();
193 } 208 }
194 } 209 }
195 210
...@@ -304,7 +319,7 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic ...@@ -304,7 +319,7 @@ public class ShopsHuaweiActivity extends FragmentActivity implements View.OnClic
304 private void openWebsite() { 319 private void openWebsite() {
305 WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShopWebsite"); 320 WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShopWebsite");
306 321
307 - if (!TextUtils.isEmpty(mMerchant.getWebsite())) { 322 + if (mMerchant != null && !TextUtils.isEmpty(mMerchant.getWebsite())) {
308 try { 323 try {
309 Intent intent = new Intent(Intent.ACTION_VIEW); 324 Intent intent = new Intent(Intent.ACTION_VIEW);
310 intent.setData(Uri.parse(mMerchant.getWebsite())); 325 intent.setData(Uri.parse(mMerchant.getWebsite()));
......
1 package ly.warp.sdk.io.request; 1 package ly.warp.sdk.io.request;
2 2
3 +import android.text.TextUtils;
3 import android.util.Base64; 4 import android.util.Base64;
4 5
6 +import org.json.JSONArray;
5 import org.json.JSONException; 7 import org.json.JSONException;
6 import org.json.JSONObject; 8 import org.json.JSONObject;
7 9
...@@ -24,6 +26,10 @@ public class WarplySharingHistoryRequest { ...@@ -24,6 +26,10 @@ public class WarplySharingHistoryRequest {
24 26
25 private final String KEY_ACTION = "action"; 27 private final String KEY_ACTION = "action";
26 private final String KEY_ACTION_VALUE = "sharing_history"; 28 private final String KEY_ACTION_VALUE = "sharing_history";
29 + private final String KEY_EXCLUDE = "exclude";
30 + private final String KEY_FIELD = "field";
31 + private final String KEY_VALUE = "value";
32 + private final String KEY_TYPE = "couponset_types";
27 33
28 // =========================================================== 34 // ===========================================================
29 // Fields 35 // Fields
...@@ -31,6 +37,8 @@ public class WarplySharingHistoryRequest { ...@@ -31,6 +37,8 @@ public class WarplySharingHistoryRequest {
31 37
32 private HashMap<String, String> mFilters; 38 private HashMap<String, String> mFilters;
33 private long mCacheUpdateInterval = 0; 39 private long mCacheUpdateInterval = 0;
40 + private String mExcludeFilter = "";
41 + private String mType = "";
34 42
35 // =========================================================== 43 // ===========================================================
36 // Constructor 44 // Constructor
...@@ -128,6 +136,16 @@ public class WarplySharingHistoryRequest { ...@@ -128,6 +136,16 @@ public class WarplySharingHistoryRequest {
128 return this; 136 return this;
129 } 137 }
130 138
139 + public WarplySharingHistoryRequest setExcludeFilter(String excludeFilter) {
140 + mExcludeFilter = excludeFilter;
141 + return this;
142 + }
143 +
144 + public WarplySharingHistoryRequest setType(String type) {
145 + mType = type;
146 + return this;
147 + }
148 +
131 /** 149 /**
132 * Call this to build the offers Json object 150 * Call this to build the offers Json object
133 * 151 *
...@@ -137,6 +155,19 @@ public class WarplySharingHistoryRequest { ...@@ -137,6 +155,19 @@ public class WarplySharingHistoryRequest {
137 JSONObject bodyJsonObject = new JSONObject(); 155 JSONObject bodyJsonObject = new JSONObject();
138 try { 156 try {
139 bodyJsonObject.putOpt(KEY_ACTION, KEY_ACTION_VALUE); 157 bodyJsonObject.putOpt(KEY_ACTION, KEY_ACTION_VALUE);
158 + if (!TextUtils.isEmpty(mExcludeFilter)) {
159 + JSONObject excludesKey = new JSONObject();
160 + try {
161 + excludesKey.putOpt(KEY_FIELD, "couponset_type");
162 + excludesKey.putOpt(KEY_VALUE, new JSONArray().put(mExcludeFilter));
163 + } catch (JSONException e) {
164 + e.printStackTrace();
165 + }
166 + bodyJsonObject.put(KEY_EXCLUDE, new JSONArray().put(excludesKey));
167 + }
168 + if (!TextUtils.isEmpty(mType)) {
169 + bodyJsonObject.put(KEY_TYPE, new JSONArray().put(mType));
170 + }
140 } catch (JSONException e) { 171 } catch (JSONException e) {
141 if (WarpConstants.DEBUG) 172 if (WarpConstants.DEBUG)
142 e.printStackTrace(); 173 e.printStackTrace();
......
...@@ -1252,6 +1252,7 @@ public class WarplyManagerHelper { ...@@ -1252,6 +1252,7 @@ public class WarplyManagerHelper {
1252 public static ArrayList<UnifiedCoupon> getMarketCoupons() { 1252 public static ArrayList<UnifiedCoupon> getMarketCoupons() {
1253 return mMarketCoupons; 1253 return mMarketCoupons;
1254 } 1254 }
1255 +
1255 public static void setMarketCoupons( ArrayList<UnifiedCoupon> marketCoupons) { 1256 public static void setMarketCoupons( ArrayList<UnifiedCoupon> marketCoupons) {
1256 mMarketCoupons = marketCoupons; 1257 mMarketCoupons = marketCoupons;
1257 } 1258 }
......
...@@ -2286,6 +2286,14 @@ public class WarplyManager { ...@@ -2286,6 +2286,14 @@ public class WarplyManager {
2286 jsonParams.put("active", true); 2286 jsonParams.put("active", true);
2287 jsonParams.put("visible", true); 2287 jsonParams.put("visible", true);
2288 jsonParams.put("language", WarplyProperty.getLanguage(Warply.getWarplyContext())); 2288 jsonParams.put("language", WarplyProperty.getLanguage(Warply.getWarplyContext()));
2289 + JSONObject excludesKey = new JSONObject();
2290 + try {
2291 + excludesKey.putOpt("field", "couponset_type");
2292 + excludesKey.putOpt("value", new JSONArray().put("supermarket"));
2293 + } catch (JSONException e) {
2294 + e.printStackTrace();
2295 + }
2296 + jsonParams.put("exclude", new JSONArray().put(excludesKey));
2289 2297
2290 jsonParamsCouponsets.put("coupon", jsonParams); 2298 jsonParamsCouponsets.put("coupon", jsonParams);
2291 RequestBody couponsetsRequest = RequestBody.create(MediaType.get("application/json; charset=utf-8"), (new JSONObject(jsonParamsCouponsets)).toString()); 2299 RequestBody couponsetsRequest = RequestBody.create(MediaType.get("application/json; charset=utf-8"), (new JSONObject(jsonParamsCouponsets)).toString());
......
1 package ly.warp.sdk.views.adapters; 1 package ly.warp.sdk.views.adapters;
2 +
2 import android.content.Context; 3 import android.content.Context;
3 import android.os.Build; 4 import android.os.Build;
4 import android.text.Html; 5 import android.text.Html;
...@@ -9,16 +10,20 @@ import android.view.ViewGroup; ...@@ -9,16 +10,20 @@ import android.view.ViewGroup;
9 import android.widget.ImageView; 10 import android.widget.ImageView;
10 import android.widget.LinearLayout; 11 import android.widget.LinearLayout;
11 import android.widget.TextView; 12 import android.widget.TextView;
13 +
12 import androidx.constraintlayout.widget.ConstraintLayout; 14 import androidx.constraintlayout.widget.ConstraintLayout;
13 import androidx.core.content.ContextCompat; 15 import androidx.core.content.ContextCompat;
14 import androidx.recyclerview.widget.RecyclerView; 16 import androidx.recyclerview.widget.RecyclerView;
17 +
15 import com.bumptech.glide.Glide; 18 import com.bumptech.glide.Glide;
16 import com.bumptech.glide.load.engine.DiskCacheStrategy; 19 import com.bumptech.glide.load.engine.DiskCacheStrategy;
20 +
17 import java.text.ParseException; 21 import java.text.ParseException;
18 import java.text.SimpleDateFormat; 22 import java.text.SimpleDateFormat;
19 import java.util.Date; 23 import java.util.Date;
20 import java.util.Locale; 24 import java.util.Locale;
21 import java.util.concurrent.TimeUnit; 25 import java.util.concurrent.TimeUnit;
26 +
22 import io.reactivex.Observable; 27 import io.reactivex.Observable;
23 import io.reactivex.subjects.PublishSubject; 28 import io.reactivex.subjects.PublishSubject;
24 import ly.warp.sdk.R; 29 import ly.warp.sdk.R;
...@@ -26,33 +31,39 @@ import ly.warp.sdk.io.models.Coupon; ...@@ -26,33 +31,39 @@ import ly.warp.sdk.io.models.Coupon;
26 import ly.warp.sdk.io.models.CouponList; 31 import ly.warp.sdk.io.models.CouponList;
27 import ly.warp.sdk.io.models.Merchant; 32 import ly.warp.sdk.io.models.Merchant;
28 import ly.warp.sdk.utils.WarplyManagerHelper; 33 import ly.warp.sdk.utils.WarplyManagerHelper;
34 +
29 public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapter.ActiveCouponViewHolder> { 35 public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapter.ActiveCouponViewHolder> {
30 private Context mContext; 36 private Context mContext;
31 private CouponList mCoupons; 37 private CouponList mCoupons;
32 private final PublishSubject<Coupon> onClickSubject = PublishSubject.create(); 38 private final PublishSubject<Coupon> onClickSubject = PublishSubject.create();
33 private boolean mIsPast = false, mIsCustom = false; 39 private boolean mIsPast = false, mIsCustom = false;
40 +
34 public ActiveCouponAdapter(Context mContext, CouponList campaignList) { 41 public ActiveCouponAdapter(Context mContext, CouponList campaignList) {
35 this.mContext = mContext; 42 this.mContext = mContext;
36 this.mCoupons = campaignList; 43 this.mCoupons = campaignList;
37 this.mIsPast = false; 44 this.mIsPast = false;
38 } 45 }
46 +
39 public ActiveCouponAdapter(Context mContext, CouponList campaignList, boolean past) { 47 public ActiveCouponAdapter(Context mContext, CouponList campaignList, boolean past) {
40 this.mContext = mContext; 48 this.mContext = mContext;
41 this.mCoupons = campaignList; 49 this.mCoupons = campaignList;
42 this.mIsPast = past; 50 this.mIsPast = past;
43 } 51 }
52 +
44 public ActiveCouponAdapter(Context mContext, CouponList campaignList, boolean past, boolean custom) { 53 public ActiveCouponAdapter(Context mContext, CouponList campaignList, boolean past, boolean custom) {
45 this.mContext = mContext; 54 this.mContext = mContext;
46 this.mCoupons = campaignList; 55 this.mCoupons = campaignList;
47 this.mIsPast = past; 56 this.mIsPast = past;
48 this.mIsCustom = custom; 57 this.mIsCustom = custom;
49 } 58 }
59 +
50 public class ActiveCouponViewHolder extends RecyclerView.ViewHolder { 60 public class ActiveCouponViewHolder extends RecyclerView.ViewHolder {
51 private ImageView ivCouponLogo, ivCouponBackground; 61 private ImageView ivCouponLogo, ivCouponBackground;
52 private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvDateLimit, 62 private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvDateLimit,
53 tvCouponDescription, tvCouponDateExpired; 63 tvCouponDescription, tvCouponDateExpired;
54 private ConstraintLayout clCustomLayout; 64 private ConstraintLayout clCustomLayout;
55 private LinearLayout lLDateLimit; 65 private LinearLayout lLDateLimit;
66 +
56 public ActiveCouponViewHolder(View view) { 67 public ActiveCouponViewHolder(View view) {
57 super(view); 68 super(view);
58 ivCouponBackground = view.findViewById(R.id.iv_past_coupon_background); 69 ivCouponBackground = view.findViewById(R.id.iv_past_coupon_background);
...@@ -67,6 +78,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -67,6 +78,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
67 lLDateLimit = view.findViewById(R.id.ll_date_limit); 78 lLDateLimit = view.findViewById(R.id.ll_date_limit);
68 } 79 }
69 } 80 }
81 +
70 @Override 82 @Override
71 public int getItemCount() { 83 public int getItemCount() {
72 if (mCoupons == null) 84 if (mCoupons == null)
...@@ -74,14 +86,17 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -74,14 +86,17 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
74 else 86 else
75 return mCoupons.size(); 87 return mCoupons.size();
76 } 88 }
89 +
77 public Coupon getItem(int id) { 90 public Coupon getItem(int id) {
78 return mCoupons.get(id); 91 return mCoupons.get(id);
79 } 92 }
93 +
80 public void updateData(CouponList couponList) { 94 public void updateData(CouponList couponList) {
81 mCoupons.clear(); 95 mCoupons.clear();
82 mCoupons.addAll(couponList); 96 mCoupons.addAll(couponList);
83 notifyDataSetChanged(); 97 notifyDataSetChanged();
84 } 98 }
99 +
85 @Override 100 @Override
86 public ActiveCouponViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 101 public ActiveCouponViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
87 View itemView; 102 View itemView;
...@@ -93,6 +108,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -93,6 +108,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
93 itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.active_coupon_layout, parent, false); 108 itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.active_coupon_layout, parent, false);
94 return new ActiveCouponViewHolder(itemView); 109 return new ActiveCouponViewHolder(itemView);
95 } 110 }
111 +
96 @Override 112 @Override
97 public void onBindViewHolder(final ActiveCouponViewHolder holder, int position) { 113 public void onBindViewHolder(final ActiveCouponViewHolder holder, int position) {
98 Coupon couponItem = mCoupons.get(position); 114 Coupon couponItem = mCoupons.get(position);
...@@ -106,13 +122,13 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -106,13 +122,13 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
106 holder.tvCouponTitle.setAlpha(1.0f); 122 holder.tvCouponTitle.setAlpha(1.0f);
107 holder.tvCouponValue.setAlpha(1.0f); 123 holder.tvCouponValue.setAlpha(1.0f);
108 holder.tvCouponDescription.setAlpha(1.0f); 124 holder.tvCouponDescription.setAlpha(1.0f);
109 - holder.clCustomLayout.setBackgroundResource(R.drawable.ic_coupon_background); 125 + holder.clCustomLayout.setBackgroundResource(R.drawable.ic_coupon_background_new2);
110 } else { 126 } else {
111 - holder.ivCouponLogo.setAlpha(0.23f); 127 + holder.ivCouponLogo.setAlpha(0.29f);
112 - holder.tvCouponTitle.setAlpha(0.15f); 128 + holder.tvCouponTitle.setAlpha(0.29f);
113 - holder.tvCouponValue.setAlpha(0.15f); 129 + holder.tvCouponValue.setAlpha(0.29f);
114 - holder.tvCouponDescription.setAlpha(0.15f); 130 + holder.tvCouponDescription.setAlpha(0.29f);
115 - holder.clCustomLayout.setBackgroundResource(R.drawable.ic_coupon_background_gray); 131 + holder.clCustomLayout.setBackgroundResource(R.drawable.ic_coupon_background_new2);
116 } 132 }
117 if (WarplyManagerHelper.getMerchantList() != null && WarplyManagerHelper.getMerchantList().size() > 0) { 133 if (WarplyManagerHelper.getMerchantList() != null && WarplyManagerHelper.getMerchantList().size() > 0) {
118 for (Merchant mer : WarplyManagerHelper.getMerchantList()) { 134 for (Merchant mer : WarplyManagerHelper.getMerchantList()) {
...@@ -197,16 +213,16 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -197,16 +213,16 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
197 } 213 }
198 } 214 }
199 if (TextUtils.isEmpty(couponItem.getDiscount_type())) { 215 if (TextUtils.isEmpty(couponItem.getDiscount_type())) {
200 - holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro)); 216 + holder.tvCouponValue.setText(couponItem.getDiscount().replace(".", ",") + mContext.getResources().getString(R.string.euro));
201 } else { 217 } else {
202 if (couponItem.getDiscount_type().equals("value")) { 218 if (couponItem.getDiscount_type().equals("value")) {
203 - holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro)); 219 + holder.tvCouponValue.setText(couponItem.getDiscount().replace(".", ",") + mContext.getResources().getString(R.string.euro));
204 } else if (couponItem.getDiscount_type().equals("percentage")) { 220 } else if (couponItem.getDiscount_type().equals("percentage")) {
205 holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.percentage)); 221 holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.percentage));
206 } else if (couponItem.getDiscount_type().equals("plus_one")) { 222 } else if (couponItem.getDiscount_type().equals("plus_one")) {
207 holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.plus_one)); 223 holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.plus_one));
208 } else { 224 } else {
209 - holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro)); 225 + holder.tvCouponValue.setText(couponItem.getDiscount().replace(".", ",") + mContext.getResources().getString(R.string.euro));
210 } 226 }
211 } 227 }
212 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem)); 228 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
...@@ -295,6 +311,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -295,6 +311,7 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
295 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem)); 311 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
296 } 312 }
297 } 313 }
314 +
298 private long getDaysBetweenDates(String start, String end) { 315 private long getDaysBetweenDates(String start, String end) {
299 SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); 316 SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
300 Date startDate, endDate; 317 Date startDate, endDate;
...@@ -308,13 +325,16 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte ...@@ -308,13 +325,16 @@ public class ActiveCouponAdapter extends RecyclerView.Adapter<ActiveCouponAdapte
308 } 325 }
309 return numberOfDays; 326 return numberOfDays;
310 } 327 }
328 +
311 private long getUnitBetweenDates(Date startDate, Date endDate, TimeUnit unit) { 329 private long getUnitBetweenDates(Date startDate, Date endDate, TimeUnit unit) {
312 long timeDiff = endDate.getTime() - startDate.getTime(); 330 long timeDiff = endDate.getTime() - startDate.getTime();
313 return unit.convert(timeDiff, TimeUnit.MILLISECONDS); 331 return unit.convert(timeDiff, TimeUnit.MILLISECONDS);
314 } 332 }
333 +
315 public Observable<Coupon> getPositionClicks() { 334 public Observable<Coupon> getPositionClicks() {
316 return onClickSubject.cache(); 335 return onClickSubject.cache();
317 } 336 }
337 +
318 private long getDifferenceDays(Date d1, Date d2) { 338 private long getDifferenceDays(Date d1, Date d2) {
319 long diff = d2.getTime() - d1.getTime(); 339 long diff = d2.getTime() - d1.getTime();
320 return TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS); 340 return TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS);
......
...@@ -32,6 +32,7 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap ...@@ -32,6 +32,7 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap
32 private Context mContext; 32 private Context mContext;
33 private /*CouponList*/ ArrayList<Coupon> mCoupons; 33 private /*CouponList*/ ArrayList<Coupon> mCoupons;
34 private final PublishSubject<Coupon> onClickSubject = PublishSubject.create(); 34 private final PublishSubject<Coupon> onClickSubject = PublishSubject.create();
35 + private boolean mIsCustom = false;
35 36
36 public ExpiredCouponAdapter(Context mContext, CouponList campaignList) { 37 public ExpiredCouponAdapter(Context mContext, CouponList campaignList) {
37 this.mContext = mContext; 38 this.mContext = mContext;
...@@ -43,6 +44,12 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap ...@@ -43,6 +44,12 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap
43 this.mCoupons = /*(CouponList)*/ campaignList; 44 this.mCoupons = /*(CouponList)*/ campaignList;
44 } 45 }
45 46
47 + public ExpiredCouponAdapter(Context mContext, ArrayList<Coupon> campaignList, boolean custom) {
48 + this.mContext = mContext;
49 + this.mCoupons = /*(CouponList)*/ campaignList;
50 + this.mIsCustom = custom;
51 + }
52 +
46 public class ExpiredCouponViewHolder extends RecyclerView.ViewHolder { 53 public class ExpiredCouponViewHolder extends RecyclerView.ViewHolder {
47 private TextView tvCouponTitle, tvCouponValue, tvCouponDate; 54 private TextView tvCouponTitle, tvCouponValue, tvCouponDate;
48 private ImageView ivCouponLogo; 55 private ImageView ivCouponLogo;
...@@ -89,6 +96,7 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap ...@@ -89,6 +96,7 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap
89 Merchant merchant = new Merchant(); 96 Merchant merchant = new Merchant();
90 97
91 if (couponItem != null) { 98 if (couponItem != null) {
99 + if (mIsCustom) {
92 if (WarplyManagerHelper.getMerchantList() != null && WarplyManagerHelper.getMerchantList().size() > 0) { 100 if (WarplyManagerHelper.getMerchantList() != null && WarplyManagerHelper.getMerchantList().size() > 0) {
93 for (Merchant mer : WarplyManagerHelper.getMerchantList()) { 101 for (Merchant mer : WarplyManagerHelper.getMerchantList()) {
94 if (mer.getUuid().equals(couponItem.getMerchantUuid())) { 102 if (mer.getUuid().equals(couponItem.getMerchantUuid())) {
...@@ -100,6 +108,16 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap ...@@ -100,6 +108,16 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap
100 108
101 if (merchant == null) { 109 if (merchant == null) {
102 holder.tvCouponTitle.setText(couponItem.getName()); 110 holder.tvCouponTitle.setText(couponItem.getName());
111 + if (!TextUtils.isEmpty(couponItem.getImage())) {
112 + Glide.with(mContext)
113 +// .setDefaultRequestOptions(
114 +// RequestOptions
115 +// .placeholderOf(R.drawable.ic_default_contact_photo)
116 +// .error(R.drawable.ic_default_contact_photo))
117 + .load(couponItem.getImage())
118 + .diskCacheStrategy(DiskCacheStrategy.DATA)
119 + .into(holder.ivCouponLogo);
120 + }
103 } else { 121 } else {
104 holder.tvCouponTitle.setText(merchant.getAdminName()); 122 holder.tvCouponTitle.setText(merchant.getAdminName());
105 if (!TextUtils.isEmpty(merchant.getImgPreview())) { 123 if (!TextUtils.isEmpty(merchant.getImgPreview())) {
...@@ -124,6 +142,48 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap ...@@ -124,6 +142,48 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap
124 simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy"); 142 simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
125 holder.tvCouponDate.setText(simpleDateFormat.format(newDate != null ? newDate : "")); 143 holder.tvCouponDate.setText(simpleDateFormat.format(newDate != null ? newDate : ""));
126 144
145 + String itemValue = String.format("%.02f", Float.valueOf(couponItem.getDiscount()));
146 + holder.tvCouponValue.setText(itemValue + mContext.getResources().getString(R.string.euro));
147 + holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
148 + return;
149 + }
150 +
151 + if (WarplyManagerHelper.getMerchantList() != null && WarplyManagerHelper.getMerchantList().size() > 0) {
152 + for (Merchant mer : WarplyManagerHelper.getMerchantList()) {
153 + if (mer.getUuid().equals(couponItem.getMerchantUuid())) {
154 + merchant = mer;
155 + break;
156 + }
157 + }
158 + }
159 +
160 + if (merchant == null) {
161 + holder.tvCouponTitle.setText(couponItem.getName());
162 + } else {
163 + holder.tvCouponTitle.setText(merchant.getAdminName());
164 + if (!TextUtils.isEmpty(merchant.getImgPreview())) {
165 + Glide.with(mContext)
166 +// .setDefaultRequestOptions(
167 +// RequestOptions
168 +// .placeholderOf(R.drawable.ic_default_contact_photo)
169 +// .error(R.drawable.ic_default_contact_photo))
170 + .load(merchant.getImgPreview())
171 + .diskCacheStrategy(DiskCacheStrategy.DATA)
172 + .into(holder.ivCouponLogo);
173 + }
174 + }
175 +
176 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
177 + Date newDate = new Date();
178 + try {
179 + newDate = simpleDateFormat.parse(couponItem.getChangesDates().optString("redeemed"));
180 + simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
181 + holder.tvCouponDate.setText(simpleDateFormat.format(newDate != null ? newDate : ""));
182 + } catch (ParseException e) {
183 + e.printStackTrace();
184 + holder.tvCouponDate.setVisibility(View.GONE);
185 + }
186 +
127 String itemValue = String.format("%.02f", couponItem.getFinal_price()); 187 String itemValue = String.format("%.02f", couponItem.getFinal_price());
128 holder.tvCouponValue.setText(itemValue + mContext.getResources().getString(R.string.euro)); 188 holder.tvCouponValue.setText(itemValue + mContext.getResources().getString(R.string.euro));
129 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem)); 189 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
......
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <shape xmlns:android="http://schemas.android.com/apk/res/android"> 2 <shape xmlns:android="http://schemas.android.com/apk/res/android">
3 - <solid android:color="#F0E6E6"/> 3 + <solid android:color="@color/cos_skyblue4"/>
4 <corners android:radius="10dp"/> 4 <corners android:radius="10dp"/>
5 <padding android:left="4dp" android:top="2dp" android:right="4dp" android:bottom="2dp" /> 5 <padding android:left="4dp" android:top="2dp" android:right="4dp" android:bottom="2dp" />
6 </shape> 6 </shape>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
30 android:id="@+id/v_separator" 30 android:id="@+id/v_separator"
31 android:layout_width="1dp" 31 android:layout_width="1dp"
32 android:layout_height="0dp" 32 android:layout_height="0dp"
33 - android:layerType="software"
34 android:layout_marginVertical="16dp" 33 android:layout_marginVertical="16dp"
35 android:layout_marginStart="16dp" 34 android:layout_marginStart="16dp"
35 + android:layerType="software"
36 app:layout_constraintBottom_toBottomOf="parent" 36 app:layout_constraintBottom_toBottomOf="parent"
37 app:layout_constraintStart_toEndOf="@+id/iv_active_coupon" 37 app:layout_constraintStart_toEndOf="@+id/iv_active_coupon"
38 app:layout_constraintTop_toTopOf="parent" 38 app:layout_constraintTop_toTopOf="parent"
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
42 custom:dashThickness="1dp" 42 custom:dashThickness="1dp"
43 custom:orientation="vertical" /> 43 custom:orientation="vertical" />
44 44
45 -<!-- app:layout_constraintEnd_toStartOf="@+id/gl_vertical_72_percent"-->
46 <LinearLayout 45 <LinearLayout
47 android:id="@+id/ll_coupon_info" 46 android:id="@+id/ll_coupon_info"
48 android:layout_width="0dp" 47 android:layout_width="0dp"
...@@ -65,6 +64,17 @@ ...@@ -65,6 +64,17 @@
65 android:textSize="16sp" 64 android:textSize="16sp"
66 tools:text="Εκπτωτικο κουπονι 10$ για αγορες στα ΙΚΕΑ" /> 65 tools:text="Εκπτωτικο κουπονι 10$ για αγορες στα ΙΚΕΑ" />
67 66
67 + <androidx.constraintlayout.widget.ConstraintLayout
68 + android:layout_width="match_parent"
69 + android:layout_height="wrap_content">
70 +
71 + <androidx.constraintlayout.widget.Guideline
72 + android:id="@+id/gl_vertical_62_percent_inner"
73 + android:layout_width="wrap_content"
74 + android:layout_height="wrap_content"
75 + android:orientation="vertical"
76 + app:layout_constraintGuide_percent="0.62" />
77 +
68 <TextView 78 <TextView
69 android:id="@+id/tv_active_coupons_value" 79 android:id="@+id/tv_active_coupons_value"
70 fontPath="fonts/BTCosmo-Bold.ttf" 80 fontPath="fonts/BTCosmo-Bold.ttf"
...@@ -72,31 +82,33 @@ ...@@ -72,31 +82,33 @@
72 android:layout_height="wrap_content" 82 android:layout_height="wrap_content"
73 android:textColor="@color/cos_light_black" 83 android:textColor="@color/cos_light_black"
74 android:textSize="42sp" 84 android:textSize="42sp"
85 + app:layout_constraintBottom_toBottomOf="parent"
86 + app:layout_constraintStart_toStartOf="parent"
87 + app:layout_constraintTop_toTopOf="parent"
75 tools:text="10$" /> 88 tools:text="10$" />
76 89
77 <TextView 90 <TextView
78 - android:id="@+id/tv_active_coupons_date"
79 - fontPath="fonts/PeridotPE-Regular.ttf"
80 - android:layout_width="wrap_content"
81 - android:layout_height="wrap_content"
82 - android:textColor="@color/cos_gray"
83 - android:textSize="12sp"
84 - tools:text="@string/cos_active_coupon_date" />
85 - </LinearLayout>
86 -
87 - <TextView
88 android:id="@+id/tv_active_coupons_description" 91 android:id="@+id/tv_active_coupons_description"
89 fontPath="fonts/PeridotPE-Regular.ttf" 92 fontPath="fonts/PeridotPE-Regular.ttf"
90 android:layout_width="0dp" 93 android:layout_width="0dp"
91 android:layout_height="wrap_content" 94 android:layout_height="wrap_content"
92 - android:layout_marginStart="8dp"
93 - android:layout_marginEnd="32dp"
94 android:maxLines="3" 95 android:maxLines="3"
95 - android:textColor="@color/cos_gray" 96 + android:textColor="@color/cos_light_black"
96 android:textSize="12sp" 97 android:textSize="12sp"
97 app:layout_constraintBottom_toBottomOf="parent" 98 app:layout_constraintBottom_toBottomOf="parent"
98 app:layout_constraintEnd_toEndOf="parent" 99 app:layout_constraintEnd_toEndOf="parent"
99 - app:layout_constraintStart_toEndOf="@+id/gl_vertical_72_percent" 100 + app:layout_constraintStart_toEndOf="@+id/gl_vertical_62_percent_inner"
100 app:layout_constraintTop_toTopOf="parent" 101 app:layout_constraintTop_toTopOf="parent"
101 tools:text="Εκπτωση με ελάχιστες αγορές 100€" /> 102 tools:text="Εκπτωση με ελάχιστες αγορές 100€" />
103 + </androidx.constraintlayout.widget.ConstraintLayout>
104 +
105 + <TextView
106 + android:id="@+id/tv_active_coupons_date"
107 + fontPath="fonts/PeridotPE-Regular.ttf"
108 + android:layout_width="wrap_content"
109 + android:layout_height="wrap_content"
110 + android:textColor="@color/cos_light_black"
111 + android:textSize="12sp"
112 + tools:text="@string/cos_active_coupon_date" />
113 + </LinearLayout>
102 </androidx.constraintlayout.widget.ConstraintLayout> 114 </androidx.constraintlayout.widget.ConstraintLayout>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
115 android:layout_height="50dp" 115 android:layout_height="50dp"
116 android:layout_marginHorizontal="32dp" 116 android:layout_marginHorizontal="32dp"
117 android:layout_marginTop="12dp" 117 android:layout_marginTop="12dp"
118 + android:includeFontPadding="false"
118 android:background="@drawable/banner_border_light_grey" 119 android:background="@drawable/banner_border_light_grey"
119 android:gravity="center" 120 android:gravity="center"
120 android:textColor="@color/cos_light_black" 121 android:textColor="@color/cos_light_black"
...@@ -142,7 +143,8 @@ ...@@ -142,7 +143,8 @@
142 143
143 <View 144 <View
144 android:id="@+id/view5" 145 android:id="@+id/view5"
145 - android:layout_width="320dp" 146 + android:layout_width="match_parent"
147 + android:layout_marginHorizontal="32dp"
146 android:layout_height="0.8dp" 148 android:layout_height="0.8dp"
147 android:background="#E6E6E6" /> 149 android:background="#E6E6E6" />
148 150
...@@ -166,7 +168,8 @@ ...@@ -166,7 +168,8 @@
166 168
167 <View 169 <View
168 android:id="@+id/view4" 170 android:id="@+id/view4"
169 - android:layout_width="320dp" 171 + android:layout_width="match_parent"
172 + android:layout_marginHorizontal="32dp"
170 android:layout_height="0.8dp" 173 android:layout_height="0.8dp"
171 android:layout_marginTop="20dp" 174 android:layout_marginTop="20dp"
172 android:background="#E6E6E6" /> 175 android:background="#E6E6E6" />
...@@ -308,7 +311,7 @@ ...@@ -308,7 +311,7 @@
308 android:layout_height="wrap_content" 311 android:layout_height="wrap_content"
309 android:text="@string/cos_coupon_terms_title" 312 android:text="@string/cos_coupon_terms_title"
310 android:textColor="@color/cos_light_black" 313 android:textColor="@color/cos_light_black"
311 - android:textSize="16sp" /> 314 + android:textSize="15sp" />
312 315
313 <ImageView 316 <ImageView
314 android:id="@+id/iv_terms_arrow" 317 android:id="@+id/iv_terms_arrow"
......
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
125 android:layout_height="wrap_content" 125 android:layout_height="wrap_content"
126 android:text="@string/cos_coupon_terms_title" 126 android:text="@string/cos_coupon_terms_title"
127 android:textColor="@color/cos_light_black" 127 android:textColor="@color/cos_light_black"
128 - android:textSize="16sp" /> 128 + android:textSize="15sp" />
129 129
130 <ImageView 130 <ImageView
131 android:id="@+id/iv_terms_arrow" 131 android:id="@+id/iv_terms_arrow"
......
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 + xmlns:app="http://schemas.android.com/apk/res-auto"
4 + xmlns:tools="http://schemas.android.com/tools"
5 + android:id="@+id/rl_analysis_payment"
6 + android:layout_width="match_parent"
7 + android:layout_height="match_parent"
8 + android:background="@color/cos_light_grey3">
9 +
10 + <androidx.constraintlayout.widget.ConstraintLayout
11 + android:id="@+id/cl_loyalty_analysis_header"
12 + android:layout_width="match_parent"
13 + android:layout_height="64dp"
14 + android:background="@color/white">
15 +
16 + <ImageView
17 + android:id="@+id/iv_loyalty_analysis_close"
18 + android:layout_width="48dp"
19 + android:layout_height="48dp"
20 + android:layout_marginStart="16dp"
21 + android:scaleType="centerInside"
22 + android:src="@drawable/ic_back"
23 + app:layout_constraintBottom_toBottomOf="parent"
24 + app:layout_constraintStart_toStartOf="parent"
25 + app:layout_constraintTop_toTopOf="parent" />
26 +
27 + <TextView
28 + fontPath="fonts/BTCosmo-Bold.ttf"
29 + android:layout_width="wrap_content"
30 + android:layout_height="wrap_content"
31 + android:text="@string/cos_analysis"
32 + android:textColor="@color/cos_light_black"
33 + android:textSize="21sp"
34 + app:layout_constraintBottom_toBottomOf="parent"
35 + app:layout_constraintEnd_toEndOf="parent"
36 + app:layout_constraintStart_toStartOf="parent"
37 + app:layout_constraintTop_toTopOf="parent" />
38 + </androidx.constraintlayout.widget.ConstraintLayout>
39 +
40 + <LinearLayout
41 + android:id="@+id/ll_tab_coupon_analysis"
42 + android:layout_width="match_parent"
43 + android:layout_height="wrap_content"
44 + android:layout_below="@+id/cl_loyalty_analysis_header"
45 + android:background="@color/white"
46 + android:gravity="center_horizontal"
47 + android:paddingHorizontal="12dp"
48 + android:paddingTop="12dp"
49 + android:paddingBottom="8dp">
50 +
51 + <include
52 + android:id="@+id/cl_tab_coupon_analysis"
53 + layout="@layout/tab_coupon_analysis"
54 + android:layout_width="match_parent"
55 + android:layout_height="wrap_content" />
56 + </LinearLayout>
57 +
58 + <androidx.core.widget.NestedScrollView
59 + android:layout_width="match_parent"
60 + android:layout_height="wrap_content"
61 + android:layout_below="@+id/ll_tab_coupon_analysis"
62 + android:overScrollMode="never"
63 + android:scrollbars="none">
64 +
65 + <RelativeLayout
66 + android:layout_width="match_parent"
67 + android:layout_height="wrap_content"
68 + android:paddingVertical="24dp">
69 +
70 + <ImageView
71 + android:id="@+id/iv_gift_circle_logo"
72 + android:layout_width="120dp"
73 + android:layout_height="120dp"
74 + android:layout_centerHorizontal="true"
75 + android:src="@drawable/ic_market_circle" />
76 +
77 + <RelativeLayout
78 + android:id="@+id/rl_expired_view"
79 + android:layout_width="match_parent"
80 + android:layout_height="wrap_content"
81 + android:layout_below="@+id/iv_gift_circle_logo"
82 + android:layout_marginTop="32dp"
83 + tools:visibility="gone">
84 +
85 + <LinearLayout
86 + android:id="@+id/ll_expired_coupons_title"
87 + android:layout_width="match_parent"
88 + android:layout_height="wrap_content"
89 + android:layout_marginHorizontal="12dp"
90 + android:background="@drawable/shape_cos_white_border"
91 + android:paddingVertical="16dp">
92 +
93 + <TextView
94 + android:id="@+id/tv_expired_coupons_title"
95 + fontPath="fonts/PeridotPE-Regular.ttf"
96 + android:layout_width="wrap_content"
97 + android:layout_height="wrap_content"
98 + android:layout_marginHorizontal="32dp"
99 + android:layout_marginVertical="8dp"
100 + android:gravity="center"
101 + android:includeFontPadding="false"
102 + android:textColor="@color/cos_light_black"
103 + android:textSize="16sp"
104 + tools:text="@string/cos_deals_win_title" />
105 + </LinearLayout>
106 +
107 + <RelativeLayout
108 + android:layout_width="match_parent"
109 + android:layout_height="wrap_content"
110 + android:layout_below="@+id/ll_expired_coupons_title"
111 + android:layout_marginHorizontal="12dp"
112 + android:layout_marginTop="12dp"
113 + android:background="@drawable/shape_cos_white_border"
114 + android:orientation="vertical"
115 + android:paddingHorizontal="16dp"
116 + android:paddingVertical="16dp">
117 +
118 + <TextView
119 + android:id="@+id/tv_expired_title"
120 + fontPath="fonts/BTCosmo-Bold.ttf"
121 + android:layout_width="wrap_content"
122 + android:layout_height="wrap_content"
123 + android:text="@string/cos_analysis2"
124 + android:textColor="@color/cos_light_black"
125 + android:textSize="21sp" />
126 +
127 +
128 + <LinearLayout
129 + android:layout_width="match_parent"
130 + android:layout_height="wrap_content"
131 + android:layout_below="@+id/tv_expired_title"
132 + android:layout_marginTop="32dp"
133 + android:orientation="vertical">
134 +
135 + <androidx.recyclerview.widget.RecyclerView
136 + android:id="@+id/rv_expired_coupons"
137 + android:layout_width="match_parent"
138 + android:layout_height="wrap_content"
139 + android:orientation="vertical"
140 + android:overScrollMode="never" />
141 +
142 + <LinearLayout
143 + android:id="@+id/ll_show_more_expired"
144 + android:layout_width="wrap_content"
145 + android:layout_height="wrap_content"
146 + android:layout_gravity="center"
147 + android:gravity="center"
148 + android:orientation="horizontal"
149 + android:paddingBottom="8dp"
150 + android:visibility="gone"
151 + tools:visibility="visible">
152 +
153 + <TextView
154 + android:id="@+id/tv_expired_more"
155 + fontPath="fonts/PeridotPE-Bold.ttf"
156 + android:layout_width="wrap_content"
157 + android:layout_height="wrap_content"
158 + android:text="@string/cos_see_more"
159 + android:textColor="@color/cos_light_black"
160 + android:textSize="16sp" />
161 +
162 + <ImageView
163 + android:id="@+id/iv_expired_more_arrow"
164 + android:layout_width="14dp"
165 + android:layout_height="14dp"
166 + android:layout_marginStart="6dp"
167 + android:layout_marginTop="3dp"
168 + android:src="@drawable/ic_down_dark_new" />
169 + </LinearLayout>
170 + </LinearLayout>
171 + </RelativeLayout>
172 +
173 + <TextView
174 + android:id="@+id/tv_expired_empty"
175 + fontPath="fonts/PeridotPE-Regular.ttf"
176 + android:layout_width="wrap_content"
177 + android:layout_height="wrap_content"
178 + android:layout_below="@+id/tv_expired_title"
179 + android:layout_centerHorizontal="true"
180 + android:layout_marginTop="56dp"
181 + android:text="@string/cos_empty_expired_coupons"
182 + android:textColor="@color/cos_light_black"
183 + android:textSize="16sp"
184 + android:visibility="gone" />
185 + </RelativeLayout>
186 +
187 + <RelativeLayout
188 + android:id="@+id/rl_shared_view"
189 + android:layout_width="match_parent"
190 + android:layout_height="wrap_content"
191 + android:layout_below="@+id/iv_gift_circle_logo"
192 + android:layout_marginHorizontal="12dp"
193 + android:layout_marginTop="32dp"
194 + android:background="@drawable/shape_cos_white_border"
195 + android:paddingHorizontal="16dp"
196 + android:paddingVertical="16dp"
197 + android:visibility="gone">
198 +
199 + <TextView
200 + android:id="@+id/tv_shared_title"
201 + fontPath="fonts/BTCosmo-Bold.ttf"
202 + android:layout_width="wrap_content"
203 + android:layout_height="wrap_content"
204 + android:text="@string/cos_analysis2"
205 + android:textColor="@color/cos_light_black"
206 + android:textSize="21sp" />
207 +
208 +
209 + <LinearLayout
210 + android:layout_width="match_parent"
211 + android:layout_height="wrap_content"
212 + android:layout_below="@+id/tv_shared_title"
213 + android:layout_marginTop="24dp"
214 + android:orientation="vertical">
215 +
216 + <androidx.recyclerview.widget.RecyclerView
217 + android:id="@+id/rv_shared_coupons"
218 + android:layout_width="match_parent"
219 + android:layout_height="wrap_content"
220 + android:orientation="vertical"
221 + android:overScrollMode="never" />
222 +
223 + <LinearLayout
224 + android:id="@+id/ll_show_more_shared"
225 + android:layout_width="wrap_content"
226 + android:layout_height="wrap_content"
227 + android:layout_gravity="center"
228 + android:gravity="center"
229 + android:orientation="horizontal"
230 + android:paddingBottom="8dp"
231 + android:visibility="gone"
232 + tools:visibility="visible">
233 +
234 + <TextView
235 + android:id="@+id/tv_shared_more"
236 + fontPath="fonts/PeridotPE-Bold.ttf"
237 + android:layout_width="wrap_content"
238 + android:layout_height="wrap_content"
239 + android:text="@string/cos_see_more"
240 + android:textColor="@color/cos_light_black"
241 + android:textSize="16sp" />
242 +
243 + <ImageView
244 + android:id="@+id/iv_shared_more_arrow"
245 + android:layout_width="14dp"
246 + android:layout_height="14dp"
247 + android:layout_marginStart="6dp"
248 + android:layout_marginTop="3dp"
249 + android:src="@drawable/ic_down_dark_new" />
250 + </LinearLayout>
251 + </LinearLayout>
252 +
253 + <TextView
254 + android:id="@+id/tv_shared_empty"
255 + fontPath="fonts/pf_square_sans_pro_regular.ttf"
256 + android:layout_width="wrap_content"
257 + android:layout_height="wrap_content"
258 + android:layout_below="@+id/tv_shared_title"
259 + android:layout_centerHorizontal="true"
260 + android:layout_marginTop="56dp"
261 + android:text="@string/cos_empty_shared_coupons"
262 + android:textColor="@color/cos_light_grey2"
263 + android:textSize="16sp"
264 + android:visibility="gone" />
265 + </RelativeLayout>
266 + </RelativeLayout>
267 + </androidx.core.widget.NestedScrollView>
268 +</RelativeLayout>
...\ No newline at end of file ...\ No newline at end of file
...@@ -102,6 +102,7 @@ ...@@ -102,6 +102,7 @@
102 android:layout_height="50dp" 102 android:layout_height="50dp"
103 android:layout_marginHorizontal="32dp" 103 android:layout_marginHorizontal="32dp"
104 android:layout_marginTop="12dp" 104 android:layout_marginTop="12dp"
105 + android:includeFontPadding="false"
105 android:background="@drawable/banner_border_light_grey" 106 android:background="@drawable/banner_border_light_grey"
106 android:gravity="center" 107 android:gravity="center"
107 android:textColor="@color/cos_light_black" 108 android:textColor="@color/cos_light_black"
...@@ -127,7 +128,8 @@ ...@@ -127,7 +128,8 @@
127 128
128 <View 129 <View
129 android:id="@+id/view5" 130 android:id="@+id/view5"
130 - android:layout_width="320dp" 131 + android:layout_width="match_parent"
132 + android:layout_marginHorizontal="32dp"
131 android:layout_height="0.8dp" 133 android:layout_height="0.8dp"
132 android:background="#E6E6E6" /> 134 android:background="#E6E6E6" />
133 135
...@@ -152,7 +154,8 @@ ...@@ -152,7 +154,8 @@
152 154
153 <View 155 <View
154 android:id="@+id/view4" 156 android:id="@+id/view4"
155 - android:layout_width="320dp" 157 + android:layout_width="match_parent"
158 + android:layout_marginHorizontal="32dp"
156 android:layout_height="0.8dp" 159 android:layout_height="0.8dp"
157 android:layout_marginTop="20dp" 160 android:layout_marginTop="20dp"
158 android:background="#E6E6E6" /> 161 android:background="#E6E6E6" />
...@@ -175,7 +178,7 @@ ...@@ -175,7 +178,7 @@
175 android:layout_width="wrap_content" 178 android:layout_width="wrap_content"
176 android:layout_height="wrap_content" 179 android:layout_height="wrap_content"
177 android:layout_gravity="center_horizontal" 180 android:layout_gravity="center_horizontal"
178 - android:layout_marginTop="48dp" 181 + android:layout_marginTop="24dp"
179 android:gravity="center" 182 android:gravity="center"
180 android:orientation="horizontal"> 183 android:orientation="horizontal">
181 184
...@@ -201,7 +204,7 @@ ...@@ -201,7 +204,7 @@
201 android:id="@+id/ll_market_coupons" 204 android:id="@+id/ll_market_coupons"
202 android:layout_width="match_parent" 205 android:layout_width="match_parent"
203 android:layout_height="wrap_content" 206 android:layout_height="wrap_content"
204 - android:layout_marginTop="16dp" 207 + android:layout_marginTop="12dp"
205 android:background="@color/cos_light_grey3" 208 android:background="@color/cos_light_grey3"
206 android:orientation="vertical"> 209 android:orientation="vertical">
207 210
...@@ -209,6 +212,7 @@ ...@@ -209,6 +212,7 @@
209 android:id="@+id/rv_active_market_coupons" 212 android:id="@+id/rv_active_market_coupons"
210 android:layout_width="match_parent" 213 android:layout_width="match_parent"
211 android:layout_height="wrap_content" 214 android:layout_height="wrap_content"
215 + android:paddingVertical="8dp"
212 android:layout_marginHorizontal="2dp" 216 android:layout_marginHorizontal="2dp"
213 android:overScrollMode="never" /> 217 android:overScrollMode="never" />
214 </LinearLayout> 218 </LinearLayout>
...@@ -219,7 +223,7 @@ ...@@ -219,7 +223,7 @@
219 android:layout_height="55dp" 223 android:layout_height="55dp"
220 android:layout_gravity="center" 224 android:layout_gravity="center"
221 android:layout_marginHorizontal="32dp" 225 android:layout_marginHorizontal="32dp"
222 - android:layout_marginTop="24dp" 226 + android:layout_marginTop="20dp"
223 android:background="@drawable/selector_button_green" 227 android:background="@drawable/selector_button_green"
224 android:gravity="center" 228 android:gravity="center"
225 android:orientation="horizontal" 229 android:orientation="horizontal"
...@@ -241,7 +245,7 @@ ...@@ -241,7 +245,7 @@
241 android:layout_width="wrap_content" 245 android:layout_width="wrap_content"
242 android:layout_height="wrap_content" 246 android:layout_height="wrap_content"
243 android:layout_gravity="center" 247 android:layout_gravity="center"
244 - android:layout_marginTop="24dp" 248 + android:layout_marginTop="20dp"
245 android:gravity="center"> 249 android:gravity="center">
246 250
247 <LinearLayout 251 <LinearLayout
...@@ -259,7 +263,7 @@ ...@@ -259,7 +263,7 @@
259 android:layout_height="wrap_content" 263 android:layout_height="wrap_content"
260 android:text="@string/cos_coupon_terms_title" 264 android:text="@string/cos_coupon_terms_title"
261 android:textColor="@color/cos_light_black" 265 android:textColor="@color/cos_light_black"
262 - android:textSize="16sp" /> 266 + android:textSize="15sp" />
263 267
264 <ImageView 268 <ImageView
265 android:id="@+id/iv_terms_arrow" 269 android:id="@+id/iv_terms_arrow"
......
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto" 3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 + xmlns:custom="http://schemas.android.com/apk/res-auto"
4 xmlns:tools="http://schemas.android.com/tools" 5 xmlns:tools="http://schemas.android.com/tools"
5 android:id="@+id/cl_custom_layout" 6 android:id="@+id/cl_custom_layout"
6 android:layout_width="match_parent" 7 android:layout_width="match_parent"
7 android:layout_height="150dp" 8 android:layout_height="150dp"
8 android:layout_marginHorizontal="4dp" 9 android:layout_marginHorizontal="4dp"
9 android:layout_marginVertical="4dp" 10 android:layout_marginVertical="4dp"
10 - android:background="@drawable/ic_coupon_background"> 11 + android:background="@drawable/ic_coupon_background_new2">
11 -
12 - <androidx.constraintlayout.widget.Guideline
13 - android:id="@+id/gl_vertical_72_percent"
14 - android:layout_width="wrap_content"
15 - android:layout_height="wrap_content"
16 - android:orientation="vertical"
17 - app:layout_constraintGuide_percent="0.72" />
18 12
19 <ImageView 13 <ImageView
20 android:id="@+id/iv_active_coupon" 14 android:id="@+id/iv_active_coupon"
...@@ -26,68 +20,101 @@ ...@@ -26,68 +20,101 @@
26 app:layout_constraintTop_toTopOf="parent" 20 app:layout_constraintTop_toTopOf="parent"
27 tools:src="@drawable/ic_gifts_for_you" /> 21 tools:src="@drawable/ic_gifts_for_you" />
28 22
29 - <View 23 + <ly.warp.sdk.views.DividerView
30 android:id="@+id/v_separator" 24 android:id="@+id/v_separator"
31 android:layout_width="1dp" 25 android:layout_width="1dp"
32 - android:layout_height="match_parent" 26 + android:layout_height="0dp"
33 android:layout_marginVertical="16dp" 27 android:layout_marginVertical="16dp"
34 - android:layout_marginStart="8dp" 28 + android:layout_marginStart="16dp"
35 - android:background="@drawable/shape_dashed_vertical" 29 + android:layerType="software"
36 app:layout_constraintBottom_toBottomOf="parent" 30 app:layout_constraintBottom_toBottomOf="parent"
37 app:layout_constraintStart_toEndOf="@+id/iv_active_coupon" 31 app:layout_constraintStart_toEndOf="@+id/iv_active_coupon"
38 - app:layout_constraintTop_toTopOf="parent" /> 32 + app:layout_constraintTop_toTopOf="parent"
33 + custom:color="@color/cos_gray"
34 + custom:dashGap="10dp"
35 + custom:dashLength="10dp"
36 + custom:dashThickness="1dp"
37 + custom:orientation="vertical" />
39 38
40 <LinearLayout 39 <LinearLayout
41 android:id="@+id/ll_coupon_info" 40 android:id="@+id/ll_coupon_info"
42 android:layout_width="0dp" 41 android:layout_width="0dp"
43 android:layout_height="wrap_content" 42 android:layout_height="wrap_content"
44 - android:layout_marginStart="16dp" 43 + android:layout_marginHorizontal="16dp"
45 android:orientation="vertical" 44 android:orientation="vertical"
46 app:layout_constraintBottom_toBottomOf="parent" 45 app:layout_constraintBottom_toBottomOf="parent"
47 - app:layout_constraintEnd_toStartOf="@+id/gl_vertical_72_percent" 46 + app:layout_constraintEnd_toEndOf="parent"
48 app:layout_constraintStart_toEndOf="@+id/v_separator" 47 app:layout_constraintStart_toEndOf="@+id/v_separator"
49 app:layout_constraintTop_toTopOf="parent"> 48 app:layout_constraintTop_toTopOf="parent">
50 49
51 <TextView 50 <TextView
52 android:id="@+id/tv_active_coupons_title" 51 android:id="@+id/tv_active_coupons_title"
53 - fontPath="fonts/pf_square_sans_pro_medium.ttf" 52 + fontPath="fonts/BTCosmo-Bold.ttf"
54 android:layout_width="wrap_content" 53 android:layout_width="wrap_content"
55 android:layout_height="wrap_content" 54 android:layout_height="wrap_content"
56 android:ellipsize="end" 55 android:ellipsize="end"
57 android:maxLines="1" 56 android:maxLines="1"
58 - android:textColor="#3A5266" 57 + android:textColor="@color/cos_light_black"
59 android:textSize="16sp" 58 android:textSize="16sp"
60 tools:text="Εκπτωτικο κουπονι 10$ για αγορες στα ΙΚΕΑ" /> 59 tools:text="Εκπτωτικο κουπονι 10$ για αγορες στα ΙΚΕΑ" />
61 60
61 + <androidx.constraintlayout.widget.ConstraintLayout
62 + android:layout_width="match_parent"
63 + android:layout_height="wrap_content">
64 +
65 + <androidx.constraintlayout.widget.Guideline
66 + android:id="@+id/gl_vertical_62_percent_inner"
67 + android:layout_width="wrap_content"
68 + android:layout_height="wrap_content"
69 + android:orientation="vertical"
70 + app:layout_constraintGuide_percent="0.62" />
71 +
62 <TextView 72 <TextView
63 android:id="@+id/tv_active_coupons_value" 73 android:id="@+id/tv_active_coupons_value"
64 - fontPath="fonts/pf_square_sans_pro_bold.ttf" 74 + fontPath="fonts/BTCosmo-Bold.ttf"
65 android:layout_width="wrap_content" 75 android:layout_width="wrap_content"
66 android:layout_height="wrap_content" 76 android:layout_height="wrap_content"
67 - android:textColor="#3A5266" 77 + android:textColor="@color/cos_light_black"
68 android:textSize="42sp" 78 android:textSize="42sp"
79 + app:layout_constraintBottom_toBottomOf="parent"
80 + app:layout_constraintStart_toStartOf="parent"
81 + app:layout_constraintTop_toTopOf="parent"
69 tools:text="10$" /> 82 tools:text="10$" />
70 83
71 <TextView 84 <TextView
85 + android:id="@+id/tv_active_coupons_description"
86 + fontPath="fonts/PeridotPE-Regular.ttf"
87 + android:layout_width="0dp"
88 + android:layout_height="wrap_content"
89 + android:maxLines="3"
90 + android:textColor="@color/cos_light_black"
91 + android:textSize="12sp"
92 + app:layout_constraintBottom_toBottomOf="parent"
93 + app:layout_constraintEnd_toEndOf="parent"
94 + app:layout_constraintStart_toEndOf="@+id/gl_vertical_62_percent_inner"
95 + app:layout_constraintTop_toTopOf="parent"
96 + tools:text="Εκπτωση με ελάχιστες αγορές 100€" />
97 + </androidx.constraintlayout.widget.ConstraintLayout>
98 +
99 + <TextView
72 android:id="@+id/tv_active_coupons_date" 100 android:id="@+id/tv_active_coupons_date"
73 - fontPath="fonts/pf_square_sans_pro_medium.ttf" 101 + fontPath="fonts/PeridotPE-Regular.ttf"
74 android:layout_width="wrap_content" 102 android:layout_width="wrap_content"
75 android:layout_height="wrap_content" 103 android:layout_height="wrap_content"
76 - android:textColor="#617181" 104 + android:textColor="@color/cos_light_black"
77 android:textSize="12sp" 105 android:textSize="12sp"
78 android:visibility="gone" 106 android:visibility="gone"
79 tools:text="@string/cos_active_coupon_date" /> 107 tools:text="@string/cos_active_coupon_date" />
80 108
81 <TextView 109 <TextView
82 android:id="@+id/tv_active_coupons_date_expired" 110 android:id="@+id/tv_active_coupons_date_expired"
83 - fontPath="fonts/pf_square_sans_pro_bold.ttf" 111 + fontPath="fonts/PeridotPE-SemiBold.ttf"
84 android:layout_width="wrap_content" 112 android:layout_width="wrap_content"
85 android:layout_height="wrap_content" 113 android:layout_height="wrap_content"
86 - android:textColor="#617181" 114 + android:textColor="@color/cos_light_black"
87 android:textSize="12sp" 115 android:textSize="12sp"
88 android:visibility="gone" 116 android:visibility="gone"
89 tools:text="@string/cos_market_coupon_expired" /> 117 tools:text="@string/cos_market_coupon_expired" />
90 - </LinearLayout>
91 118
92 <LinearLayout 119 <LinearLayout
93 android:id="@+id/ll_date_limit" 120 android:id="@+id/ll_date_limit"
...@@ -97,51 +124,36 @@ ...@@ -97,51 +124,36 @@
97 android:gravity="center_vertical" 124 android:gravity="center_vertical"
98 android:orientation="horizontal" 125 android:orientation="horizontal"
99 android:visibility="gone" 126 android:visibility="gone"
100 - android:layout_marginBottom="36dp"
101 - android:layout_marginStart="8dp"
102 app:layout_constraintBottom_toBottomOf="parent" 127 app:layout_constraintBottom_toBottomOf="parent"
103 - app:layout_constraintTop_toBottomOf="@+id/ll_coupon_info"
104 app:layout_constraintStart_toEndOf="@+id/v_separator" 128 app:layout_constraintStart_toEndOf="@+id/v_separator"
129 + app:layout_constraintTop_toBottomOf="@+id/ll_coupon_info"
105 tools:visibility="visible"> 130 tools:visibility="visible">
106 131
107 -<!-- <ImageView--> 132 + <ImageView
108 -<!-- android:layout_width="14dp"--> 133 + android:layout_width="14dp"
109 -<!-- android:layout_height="14dp"--> 134 + android:layout_height="14dp"
110 -<!-- android:layout_marginEnd="4dp"--> 135 + android:layout_marginEnd="4dp"
111 -<!-- android:src="@drawable/timer_red" />--> 136 + android:src="@drawable/timer_blue" />
112 137
113 <TextView 138 <TextView
114 - fontPath="fonts/pf_square_sans_pro_medium.ttf" 139 + fontPath="fonts/PeridotPE-SemiBold.ttf"
115 android:layout_width="wrap_content" 140 android:layout_width="wrap_content"
116 android:layout_height="wrap_content" 141 android:layout_height="wrap_content"
117 android:text="@string/cos_coupon_date_limit" 142 android:text="@string/cos_coupon_date_limit"
118 - android:textColor="#617181" 143 + android:includeFontPadding="false"
144 + android:textColor="@color/cos_light_black"
119 android:textSize="12sp" /> 145 android:textSize="12sp" />
120 146
121 <TextView 147 <TextView
122 android:id="@+id/tv_active_coupons_date_limit" 148 android:id="@+id/tv_active_coupons_date_limit"
123 - fontPath="fonts/pf_square_sans_pro_medium.ttf" 149 + fontPath="fonts/PeridotPE-SemiBold.ttf"
124 android:layout_width="wrap_content" 150 android:layout_width="wrap_content"
125 android:layout_height="wrap_content" 151 android:layout_height="wrap_content"
126 android:text="@string/cos_coupon_date_limit" 152 android:text="@string/cos_coupon_date_limit"
127 - android:textColor="#FF6B6B" 153 + android:includeFontPadding="false"
154 + android:textColor="@color/cos_blue6"
128 android:textSize="12sp" 155 android:textSize="12sp"
129 tools:text="@string/cos_coupon_date_limit2" /> 156 tools:text="@string/cos_coupon_date_limit2" />
130 </LinearLayout> 157 </LinearLayout>
131 - 158 + </LinearLayout>
132 - <TextView
133 - android:id="@+id/tv_active_coupons_description"
134 - fontPath="fonts/pf_square_sans_pro_medium.ttf"
135 - android:layout_width="0dp"
136 - android:layout_height="wrap_content"
137 - android:layout_marginStart="8dp"
138 - android:layout_marginEnd="32dp"
139 - android:maxLines="4"
140 - android:textColor="#617181"
141 - android:textSize="12sp"
142 - app:layout_constraintBottom_toBottomOf="parent"
143 - app:layout_constraintEnd_toEndOf="parent"
144 - app:layout_constraintStart_toEndOf="@+id/gl_vertical_72_percent"
145 - app:layout_constraintTop_toTopOf="parent"
146 - tools:text="Εκπτωση με ελάχιστες αγορές 100€" />
147 </androidx.constraintlayout.widget.ConstraintLayout> 159 </androidx.constraintlayout.widget.ConstraintLayout>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
4 xmlns:tools="http://schemas.android.com/tools" 4 xmlns:tools="http://schemas.android.com/tools"
5 android:layout_width="match_parent" 5 android:layout_width="match_parent"
6 android:layout_height="150dp" 6 android:layout_height="150dp"
7 - android:layout_marginBottom="24dp"> 7 + android:layout_marginBottom="12dp">
8 8
9 <androidx.cardview.widget.CardView 9 <androidx.cardview.widget.CardView
10 android:layout_width="match_parent" 10 android:layout_width="match_parent"
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
43 android:layout_marginHorizontal="12dp" 43 android:layout_marginHorizontal="12dp"
44 android:gravity="center" 44 android:gravity="center"
45 android:maxLines="4" 45 android:maxLines="4"
46 - android:textColor="@color/grey" 46 + android:textColor="@color/cos_light_black"
47 fontPath="fonts/PeridotPE-Regular.ttf" 47 fontPath="fonts/PeridotPE-Regular.ttf"
48 app:layout_constraintBottom_toBottomOf="parent" 48 app:layout_constraintBottom_toBottomOf="parent"
49 app:layout_constraintLeft_toRightOf="@+id/gl_vertical_60_percent" 49 app:layout_constraintLeft_toRightOf="@+id/gl_vertical_60_percent"
......
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto" 3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 + xmlns:custom="http://schemas.android.com/apk/res-auto"
4 xmlns:tools="http://schemas.android.com/tools" 5 xmlns:tools="http://schemas.android.com/tools"
5 android:layout_width="match_parent" 6 android:layout_width="match_parent"
6 android:layout_height="150dp" 7 android:layout_height="150dp"
...@@ -26,25 +27,30 @@ ...@@ -26,25 +27,30 @@
26 app:layout_constraintStart_toStartOf="parent" 27 app:layout_constraintStart_toStartOf="parent"
27 app:layout_constraintTop_toTopOf="parent" /> 28 app:layout_constraintTop_toTopOf="parent" />
28 29
29 - <View 30 + <ly.warp.sdk.views.DividerView
30 android:id="@+id/v_separator" 31 android:id="@+id/v_separator"
31 android:layout_width="1dp" 32 android:layout_width="1dp"
32 android:layout_height="match_parent" 33 android:layout_height="match_parent"
33 android:layout_marginVertical="16dp" 34 android:layout_marginVertical="16dp"
34 - android:layout_marginStart="8dp" 35 + android:layout_marginStart="16dp"
35 - android:background="@drawable/shape_dashed_vertical" 36 + android:layerType="software"
36 app:layout_constraintBottom_toBottomOf="parent" 37 app:layout_constraintBottom_toBottomOf="parent"
37 app:layout_constraintStart_toEndOf="@+id/iv_market_coupon" 38 app:layout_constraintStart_toEndOf="@+id/iv_market_coupon"
38 - app:layout_constraintTop_toTopOf="parent" /> 39 + app:layout_constraintTop_toTopOf="parent"
40 + custom:color="@color/cos_gray"
41 + custom:dashGap="10dp"
42 + custom:dashLength="10dp"
43 + custom:dashThickness="1dp"
44 + custom:orientation="vertical" />
39 45
40 <LinearLayout 46 <LinearLayout
41 android:id="@+id/ll_coupon_info" 47 android:id="@+id/ll_coupon_info"
42 android:layout_width="0dp" 48 android:layout_width="0dp"
43 android:layout_height="wrap_content" 49 android:layout_height="wrap_content"
44 - android:layout_marginStart="16dp" 50 + android:layout_marginHorizontal="16dp"
45 android:orientation="vertical" 51 android:orientation="vertical"
46 app:layout_constraintBottom_toBottomOf="parent" 52 app:layout_constraintBottom_toBottomOf="parent"
47 - app:layout_constraintEnd_toStartOf="@+id/gl_vertical_72_percent" 53 + app:layout_constraintEnd_toEndOf="parent"
48 app:layout_constraintStart_toEndOf="@+id/v_separator" 54 app:layout_constraintStart_toEndOf="@+id/v_separator"
49 app:layout_constraintTop_toTopOf="parent"> 55 app:layout_constraintTop_toTopOf="parent">
50 56
...@@ -55,17 +61,17 @@ ...@@ -55,17 +61,17 @@
55 android:layout_height="wrap_content" 61 android:layout_height="wrap_content"
56 android:ellipsize="end" 62 android:ellipsize="end"
57 android:maxLines="3" 63 android:maxLines="3"
64 + android:text="@string/cos_market_item_title"
58 android:textColor="@color/cos_light_black" 65 android:textColor="@color/cos_light_black"
59 - android:textSize="16sp" 66 + android:textSize="16sp" />
60 - android:text="@string/cos_market_item_title" />
61 67
62 <TextView 68 <TextView
63 fontPath="fonts/pf_square_sans_pro_bold.ttf" 69 fontPath="fonts/pf_square_sans_pro_bold.ttf"
64 android:layout_width="wrap_content" 70 android:layout_width="wrap_content"
65 android:layout_height="wrap_content" 71 android:layout_height="wrap_content"
72 + android:text=""
66 android:textColor="#3A5266" 73 android:textColor="#3A5266"
67 - android:textSize="22sp" 74 + android:textSize="22sp" />
68 - android:text="" />
69 75
70 <TextView 76 <TextView
71 android:id="@+id/tv_market_coupons_date" 77 android:id="@+id/tv_market_coupons_date"
...@@ -83,8 +89,8 @@ ...@@ -83,8 +89,8 @@
83 android:layout_width="0dp" 89 android:layout_width="0dp"
84 android:layout_height="wrap_content" 90 android:layout_height="wrap_content"
85 android:layout_marginStart="8dp" 91 android:layout_marginStart="8dp"
86 - android:layout_marginEnd="32dp" 92 + android:layout_marginEnd="16dp"
87 - android:maxLines="4" 93 + android:maxLines="3"
88 android:textColor="@color/cos_light_black" 94 android:textColor="@color/cos_light_black"
89 android:textSize="12sp" 95 android:textSize="12sp"
90 app:layout_constraintBottom_toBottomOf="parent" 96 app:layout_constraintBottom_toBottomOf="parent"
......
...@@ -72,4 +72,6 @@ ...@@ -72,4 +72,6 @@
72 <color name="cos_gray2">#848484</color> 72 <color name="cos_gray2">#848484</color>
73 <color name="cos_light_blue">#00A5E3</color> 73 <color name="cos_light_blue">#00A5E3</color>
74 <color name="cos_grey_dark2">#32485A</color> 74 <color name="cos_grey_dark2">#32485A</color>
75 + <color name="cos_blue6">#004B87</color>
76 + <color name="cos_skyblue4">#B8E0EF</color>
75 </resources> 77 </resources>
...\ No newline at end of file ...\ No newline at end of file
......