Panagiotis Triantafyllou

new version

...@@ -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-cosbeta20' 5 + PUBLISH_VERSION = '4.5.4-cosbeta21'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 7 }
8 8
......
...@@ -17,6 +17,7 @@ import com.google.zxing.BarcodeFormat; ...@@ -17,6 +17,7 @@ import com.google.zxing.BarcodeFormat;
17 import com.google.zxing.common.BitMatrix; 17 import com.google.zxing.common.BitMatrix;
18 import com.google.zxing.oned.EAN13Writer; 18 import com.google.zxing.oned.EAN13Writer;
19 19
20 +import java.io.Serializable;
20 import java.text.ParseException; 21 import java.text.ParseException;
21 import java.text.SimpleDateFormat; 22 import java.text.SimpleDateFormat;
22 import java.util.Date; 23 import java.util.Date;
...@@ -37,7 +38,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener ...@@ -37,7 +38,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
37 38
38 private ImageView mIvBack, mIvCouponPhoto, mIvBarcode; 39 private ImageView mIvBack, mIvCouponPhoto, mIvBarcode;
39 private TextView mTvTerms, mTvCouponCode, mTvCouponTitle, mTvCouponSubtitle, mTvCouponDate, mTvBarcodeCode; 40 private TextView mTvTerms, mTvCouponCode, mTvCouponTitle, mTvCouponSubtitle, mTvCouponDate, mTvBarcodeCode;
40 - private LinearLayout mLlGiftIt; 41 + private LinearLayout mLlGiftIt, mLlShops;
41 private Coupon mCoupon; 42 private Coupon mCoupon;
42 43
43 // =========================================================== 44 // ===========================================================
...@@ -60,6 +61,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener ...@@ -60,6 +61,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
60 mTvCouponDate = findViewById(R.id.textView17); 61 mTvCouponDate = findViewById(R.id.textView17);
61 mIvCouponPhoto = findViewById(R.id.imageView6); 62 mIvCouponPhoto = findViewById(R.id.imageView6);
62 mIvBarcode = findViewById(R.id.iv_barcode); 63 mIvBarcode = findViewById(R.id.iv_barcode);
64 + mLlShops = findViewById(R.id.ll_shops);
63 65
64 initViews(); 66 initViews();
65 } 67 }
...@@ -80,6 +82,12 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener ...@@ -80,6 +82,12 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
80 intent.setType("text/plain"); 82 intent.setType("text/plain");
81 intent.putExtra(android.content.Intent.EXTRA_TEXT, "Link: https://cosmote.page.link /referal\n\nΧρησιμοποίησε τον κωδικό " + mTvCouponCode.getText().toString() + " για εκπτωτικό κουπόνι 4€ στο BOX: XMAS4"); 83 intent.putExtra(android.content.Intent.EXTRA_TEXT, "Link: https://cosmote.page.link /referal\n\nΧρησιμοποίησε τον κωδικό " + mTvCouponCode.getText().toString() + " για εκπτωτικό κουπόνι 4€ στο BOX: XMAS4");
82 startActivity(Intent.createChooser(intent, "Άνοιγμα με")); 84 startActivity(Intent.createChooser(intent, "Άνοιγμα με"));
85 + return;
86 + }
87 + if (view.getId() == R.id.ll_shops) {
88 +// Intent intent = new Intent(ActiveCouponsActivity.this, CouponInfoActivity.class);
89 +// intent.putExtra("coupon", (Serializable) mCoupon);
90 +// startActivity(intent);
83 } 91 }
84 } 92 }
85 93
...@@ -119,6 +127,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener ...@@ -119,6 +127,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
119 mIvBack.setOnClickListener(this); 127 mIvBack.setOnClickListener(this);
120 // mTvTerms.setPaintFlags(mTvTerms.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG); 128 // mTvTerms.setPaintFlags(mTvTerms.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
121 mLlGiftIt.setOnClickListener(this); 129 mLlGiftIt.setOnClickListener(this);
130 + mLlShops.setOnClickListener(this);
122 131
123 String tempCoupon = mCoupon.getCoupon(); 132 String tempCoupon = mCoupon.getCoupon();
124 for (int i = 0; i < (12 - mCoupon.getCoupon().length()); i++) { 133 for (int i = 0; i < (12 - mCoupon.getCoupon().length()); i++) {
...@@ -143,6 +152,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener ...@@ -143,6 +152,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
143 152
144 } catch (Exception e) { 153 } catch (Exception e) {
145 e.printStackTrace(); 154 e.printStackTrace();
155 + mIvBarcode.setVisibility(View.GONE);
146 } 156 }
147 } 157 }
148 158
......
...@@ -27,6 +27,7 @@ import java.util.Date; ...@@ -27,6 +27,7 @@ import java.util.Date;
27 import java.util.concurrent.TimeUnit; 27 import java.util.concurrent.TimeUnit;
28 28
29 import ly.warp.sdk.R; 29 import ly.warp.sdk.R;
30 +import ly.warp.sdk.io.models.ActiveDFYCouponEventModel;
30 import ly.warp.sdk.io.models.ActiveDFYCouponModel; 31 import ly.warp.sdk.io.models.ActiveDFYCouponModel;
31 import ly.warp.sdk.io.models.Coupon; 32 import ly.warp.sdk.io.models.Coupon;
32 import ly.warp.sdk.io.models.CouponList; 33 import ly.warp.sdk.io.models.CouponList;
...@@ -48,7 +49,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { ...@@ -48,7 +49,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
48 49
49 private ImageView mIvBack, mIvDealsLogo, mIvProfilePhoto; 50 private ImageView mIvBack, mIvDealsLogo, mIvProfilePhoto;
50 private TextView mTvUsername, mTvDealsValue, mTvDealsValueAll, 51 private TextView mTvUsername, mTvDealsValue, mTvDealsValueAll,
51 - mTvUserBadge, mTvGiftsValue, mTvGiftsValueAll, mTvActiveCode, mTvActiveDate; 52 + mTvUserBadge, mTvGiftsValue, mTvGiftsValueAll, mTvActiveCode, mTvActiveDate,
53 + mTvActiveTitle;
52 private ConstraintLayout mClDealsBanner, mClDealsView, 54 private ConstraintLayout mClDealsBanner, mClDealsView,
53 mClGiftsBanner; 55 mClGiftsBanner;
54 private LinearLayout mLlQuestionnaire, mLlUserBadge; 56 private LinearLayout mLlQuestionnaire, mLlUserBadge;
...@@ -77,10 +79,11 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { ...@@ -77,10 +79,11 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
77 mTvDealsValue = findViewById(R.id.tv_deals_value); 79 mTvDealsValue = findViewById(R.id.tv_deals_value);
78 mTvDealsValueAll = findViewById(R.id.tv_deals_value_all); 80 mTvDealsValueAll = findViewById(R.id.tv_deals_value_all);
79 mTvActiveCode = findViewById(R.id.tv_active_deals_text); 81 mTvActiveCode = findViewById(R.id.tv_active_deals_text);
80 - mTvActiveDate = findViewById(R.id.tv_active_deals_date_text); 82 +// mTvActiveDate = findViewById(R.id.tv_active_deals_date_text);
81 mIvDealsLogo = findViewById(R.id.dfy_logo); 83 mIvDealsLogo = findViewById(R.id.dfy_logo);
82 mClDealsView = findViewById(R.id.cl_mygifts); 84 mClDealsView = findViewById(R.id.cl_mygifts);
83 mIvProfilePhoto = findViewById(R.id.iv_profile_photo); 85 mIvProfilePhoto = findViewById(R.id.iv_profile_photo);
86 + mTvActiveTitle = findViewById(R.id.tv_active_gifts);
84 87
85 if (WarplyManagerHelper.getActiveDFYCoupons() != null) { 88 if (WarplyManagerHelper.getActiveDFYCoupons() != null) {
86 Collections.sort(WarplyManagerHelper.getActiveDFYCoupons(), new Comparator<ActiveDFYCouponModel>() { 89 Collections.sort(WarplyManagerHelper.getActiveDFYCoupons(), new Comparator<ActiveDFYCouponModel>() {
...@@ -117,7 +120,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { ...@@ -117,7 +120,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
117 return; 120 return;
118 } 121 }
119 if (view.getId() == R.id.ll_user_questionnaire || view.getId() == R.id.ll_user_badge) { 122 if (view.getId() == R.id.ll_user_questionnaire || view.getId() == R.id.ll_user_badge) {
120 - startActivity(WarpViewActivity.createIntentFromURL(LoyaltyWallet.this, WarplyManagerHelper.openQuestionnaire())); 123 + startActivityForResult(WarpViewActivity.createIntentFromURL(LoyaltyWallet.this, WarplyManagerHelper.openQuestionnaire()), 1000);
121 return; 124 return;
122 } 125 }
123 if (view.getId() == R.id.cl_deals_cos) { 126 if (view.getId() == R.id.cl_deals_cos) {
...@@ -128,6 +131,29 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { ...@@ -128,6 +131,29 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
128 } 131 }
129 if (view.getId() == R.id.cl_deals_win) { 132 if (view.getId() == R.id.cl_deals_win) {
130 //TODO: Loyalty history 133 //TODO: Loyalty history
134 +
135 + return;
136 + }
137 + if (view.getId() == R.id.cl_mygifts) {
138 + ActiveDFYCouponEventModel activeCouponEventModel = new ActiveDFYCouponEventModel();
139 + activeCouponEventModel.setPressed(true);
140 + EventBus.getDefault().post(new WarplyEventBusManager(activeCouponEventModel));
141 + }
142 + }
143 +
144 + @Override
145 + protected void onActivityResult(int requestCode, int resultCode, Intent data) {
146 + if (requestCode == 1000) {
147 + if (resultCode == RESULT_OK) {
148 + if (!TextUtils.isEmpty(WarplyManagerHelper.getUserTag())) {
149 + mTvUserBadge.setText(WarplyManagerHelper.getUserTag());
150 + mLlQuestionnaire.setVisibility(View.GONE);
151 + mLlUserBadge.setVisibility(View.VISIBLE);
152 + } else {
153 + mLlUserBadge.setVisibility(View.GONE);
154 + mLlQuestionnaire.setVisibility(View.VISIBLE);
155 + }
156 + }
131 } 157 }
132 } 158 }
133 159
...@@ -155,20 +181,32 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { ...@@ -155,20 +181,32 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
155 mTvDealsValue.setText(String.format(getString(R.string.cos_value), String.valueOf(/*couponDfyValue*/ WarplyManagerHelper.getDealsCouponsSum()))); 181 mTvDealsValue.setText(String.format(getString(R.string.cos_value), String.valueOf(/*couponDfyValue*/ WarplyManagerHelper.getDealsCouponsSum())));
156 mTvDealsValueAll.setText(String.format(getString(R.string.cos_deals_win_title_cos), String.valueOf(/*couponDfyValue*/WarplyManagerHelper.getDealsCouponsSum()))); 182 mTvDealsValueAll.setText(String.format(getString(R.string.cos_deals_win_title_cos), String.valueOf(/*couponDfyValue*/WarplyManagerHelper.getDealsCouponsSum())));
157 if (WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() > 0) { 183 if (WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() > 0) {
158 - mTvActiveCode.setText(WarplyManagerHelper.getActiveDFYCoupons().get(0).getCode()); 184 + String codes = "";
159 - 185 + if (WarplyManagerHelper.getActiveDFYCoupons().size() == 1) {
160 - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm"); 186 + codes = WarplyManagerHelper.getActiveDFYCoupons().get(0).getCode();
161 - String date1 = WarplyManagerHelper.getActiveDFYCoupons().get(0).getDate(); 187 + mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals), String.valueOf(1)));
162 - String date2 = dateFormat.format(new Date()); 188 + } else {
163 - 189 + for (ActiveDFYCouponModel coupon : WarplyManagerHelper.getActiveDFYCoupons()) {
164 - try { 190 + codes = codes + coupon.getCode() + ",";
165 - Date toDate = dateFormat.parse(date2); 191 + }
166 - Date fromDate = dateFormat.parse(date1); 192 + codes = codes.substring(0, codes.length() - 1);
167 - long diff = TimeUnit.MILLISECONDS.toDays(fromDate.getTime() - toDate.getTime()); 193 +
168 - mTvActiveDate.setText(String.format(getString(R.string.cos_active_coupon_date), String.valueOf(diff))); 194 + mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals_plural), String.valueOf(WarplyManagerHelper.getActiveDFYCoupons().size())));
169 - } catch (ParseException e) {
170 - e.printStackTrace();
171 } 195 }
196 + mTvActiveCode.setText(codes);
197 +
198 +// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
199 +// String date1 = WarplyManagerHelper.getActiveDFYCoupons().get(0).getDate();
200 +// String date2 = dateFormat.format(new Date());
201 +//
202 +// try {
203 +// Date toDate = dateFormat.parse(date2);
204 +// Date fromDate = dateFormat.parse(date1);
205 +// long diff = TimeUnit.MILLISECONDS.toDays(fromDate.getTime() - toDate.getTime());
206 +// mTvActiveDate.setText(String.format(getString(R.string.cos_active_coupon_date), String.valueOf(diff)));
207 +// } catch (ParseException e) {
208 +// e.printStackTrace();
209 +// }
172 } else { 210 } else {
173 mIvDealsLogo.setVisibility(View.GONE); 211 mIvDealsLogo.setVisibility(View.GONE);
174 mClDealsView.setVisibility(View.GONE); 212 mClDealsView.setVisibility(View.GONE);
...@@ -204,6 +242,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { ...@@ -204,6 +242,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
204 mLlUserBadge.setOnClickListener(this); 242 mLlUserBadge.setOnClickListener(this);
205 mClDealsBanner.setOnClickListener(this); 243 mClDealsBanner.setOnClickListener(this);
206 mClGiftsBanner.setOnClickListener(this); 244 mClGiftsBanner.setOnClickListener(this);
245 + mClDealsView.setOnClickListener(this);
207 } 246 }
208 247
209 // =========================================================== 248 // ===========================================================
......
...@@ -123,8 +123,10 @@ public class WarpViewActivity extends WarpBaseActivity { ...@@ -123,8 +123,10 @@ public class WarpViewActivity extends WarpBaseActivity {
123 @Subscribe() 123 @Subscribe()
124 public void onMessageEvent(WarplyEventBusManager event) { 124 public void onMessageEvent(WarplyEventBusManager event) {
125 EventBus.getDefault().unregister(this); 125 EventBus.getDefault().unregister(this);
126 - if (event.getQuestionnaire() != null) 126 + if (event.getQuestionnaire() != null) {
127 EventBus.getDefault().post(new WarplyEventBusManager(event.getQuestionnaire())); 127 EventBus.getDefault().post(new WarplyEventBusManager(event.getQuestionnaire()));
128 + setResult(RESULT_OK,new Intent());
129 + }
128 if (event.getCoupon() != null) 130 if (event.getCoupon() != null)
129 EventBus.getDefault().post(new WarplyEventBusManager(event.getCoupon())); 131 EventBus.getDefault().post(new WarplyEventBusManager(event.getCoupon()));
130 if (event.getPacingCard() != null) 132 if (event.getPacingCard() != null)
......
...@@ -121,24 +121,24 @@ public class VolleyTransformer implements Listener<JSONObject>, ErrorListener { ...@@ -121,24 +121,24 @@ public class VolleyTransformer implements Listener<JSONObject>, ErrorListener {
121 // WarpUtils.log("[WARP Trace] Request: " + response.toString(2)); 121 // WarpUtils.log("[WARP Trace] Request: " + response.toString(2));
122 122
123 WarpUtils.log("[WARP Trace] Response: "); 123 WarpUtils.log("[WARP Trace] Response: ");
124 -// if (response.toString().length() > 4000) { 124 + if (response.toString().length() > 1000) {
125 -// for (int i = 0; i < response.toString().length(); i += 4000) { 125 + for (int i = 0; i < response.toString().length(); i += 1000) {
126 -// if (i + 4000 < response.toString().length()) 126 + if (i + 1000 < response.toString().length())
127 -// WarpUtils.log(response.toString().substring(i, i + 4000)); 127 + WarpUtils.log(response.toString().substring(i, i + 1000));
128 -// else 128 + else
129 -// WarpUtils.log(response.toString().substring(i, response.toString().length())); 129 + WarpUtils.log(response.toString().substring(i, response.toString().length()));
130 -// } 130 + }
131 - for (int i = 0, length = response.toString().length(); i < length; i++) { 131 +// for (int i = 0, length = response.toString().length(); i < length; i++) {
132 - int newline = response.toString().indexOf('\n', i); 132 +// int newline = response.toString().indexOf('\n', i);
133 - newline = newline != -1 ? newline : length; 133 +// newline = newline != -1 ? newline : length;
134 - do { 134 +// do {
135 - int end = Math.min(newline, i + 4000); 135 +// int end = Math.min(newline, i + 4000);
136 - WarpUtils.log(response.toString().substring(i, end)); 136 +// WarpUtils.log(response.toString().substring(i, end));
137 - i = end; 137 +// i = end;
138 - } while (i < newline); 138 +// } while (i < newline);
139 - } 139 +// }
140 -// } else 140 + } else
141 -// WarpUtils.log("[WARP Trace] Request: " + response.toString(2)); 141 + WarpUtils.log("[WARP Trace] Request: " + response.toString(2));
142 } catch (/*JSONException*/ Exception e) { 142 } catch (/*JSONException*/ Exception e) {
143 WarpUtils.warn( 143 WarpUtils.warn(
144 "[WARP Trace] Failed conversting JSON to string", e); 144 "[WARP Trace] Failed conversting JSON to string", e);
......
1 +/*
2 + * Copyright 2010-2013 Warply Ltd. All rights reserved.
3 + *
4 + * Redistribution and use in source and binary forms, without modification, are
5 + * permitted provided that the following conditions are met:
6 + *
7 + * 1. Redistributions of source code must retain the above copyright notice,
8 + * this list of conditions and the following disclaimer.
9 + *
10 + * 2. Redistributions in binary form must reproduce the above copyright notice,
11 + * this list of conditions and the following disclaimer in the documentation
12 + * and/or other materials provided with the distribution.
13 + *
14 + * THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
15 + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 + * EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
18 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
20 + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
22 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23 + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 + */
25 +
26 +package ly.warp.sdk.io.models;
27 +
28 +
29 +/**
30 + * Created by Panagiotis Triantafyllou on 29-June-22.
31 + */
32 +
33 +public class ActiveDFYCouponEventModel {
34 + private boolean pressed;
35 +
36 + public ActiveDFYCouponEventModel() {
37 + this.pressed = true;
38 + }
39 +
40 + public boolean isPressed() {
41 + return pressed;
42 + }
43 +
44 + public void setPressed(boolean pressed) {
45 + this.pressed = pressed;
46 + }
47 +}
...@@ -298,7 +298,7 @@ public class WarplyManagerHelper { ...@@ -298,7 +298,7 @@ public class WarplyManagerHelper {
298 /** 298 /**
299 * Open CCMS campaign 299 * Open CCMS campaign
300 */ 300 */
301 - public static String constructCcmsUrl(LoyaltyContextualOfferModel item, String sessionId) { 301 + public static String constructCcmsUrl(LoyaltyContextualOfferModel item) {
302 String url = ""; 302 String url = "";
303 if (item != null) { 303 if (item != null) {
304 if (mUniqueCampaignList != null && mUniqueCampaignList.get("gifts_for_you") != null && mUniqueCampaignList.get("gifts_for_you").size() > 0) { 304 if (mUniqueCampaignList != null && mUniqueCampaignList.get("gifts_for_you") != null && mUniqueCampaignList.get("gifts_for_you").size() > 0) {
...@@ -320,7 +320,7 @@ public class WarplyManagerHelper { ...@@ -320,7 +320,7 @@ public class WarplyManagerHelper {
320 + "&refresh_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token") 320 + "&refresh_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token")
321 + "&client_id=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id") 321 + "&client_id=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id")
322 + "&client_secret=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret") 322 + "&client_secret=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret")
323 - + "&Session_ID=" + sessionId //item.getSessionId() 323 + + "&Session_ID=" + item.getSessionId()
324 + "&businessService=" + item.getBusinessService() 324 + "&businessService=" + item.getBusinessService()
325 + "&offerName=" + item.getOfferName() 325 + "&offerName=" + item.getOfferName()
326 + "&productType=" + item.getProductType() 326 + "&productType=" + item.getProductType()
...@@ -382,11 +382,11 @@ public class WarplyManagerHelper { ...@@ -382,11 +382,11 @@ public class WarplyManagerHelper {
382 } 382 }
383 } 383 }
384 384
385 - Log.v("Got L:{" + String.valueOf(tempGifts.size()) + "}", " LOYALTY campaigns"); 385 + Log.v("Got L:{" + String.valueOf(mCampaignList.size()) + "}", " LOYALTY campaigns");
386 Log.v("Got C:{0}", " CCMS campaigns"); 386 Log.v("Got C:{0}", " CCMS campaigns");
387 Log.v("Matched M:{0}", " CCMS campaigns"); 387 Log.v("Matched M:{0}", " CCMS campaigns");
388 Log.v("=====================================", ""); 388 Log.v("=====================================", "");
389 - Log.v("TOTAL: Campaigns Sum=" + String.valueOf(tempGifts.size()), " campaigns to display"); 389 + Log.v("TOTAL: Campaigns Sum=" + String.valueOf(mCampaignList.size()), " campaigns to display");
390 mUniqueCampaignList.get("gifts_for_you").removeAll(tempGifts); 390 mUniqueCampaignList.get("gifts_for_you").removeAll(tempGifts);
391 } 391 }
392 return; 392 return;
...@@ -423,11 +423,11 @@ public class WarplyManagerHelper { ...@@ -423,11 +423,11 @@ public class WarplyManagerHelper {
423 } 423 }
424 } 424 }
425 425
426 - Log.v("Got L:{" + String.valueOf(loyaltyCount) + "}", " LOYALTY campaigns"); 426 + Log.v("Got L:{" + String.valueOf(mCampaignList.size()) + "}", " LOYALTY campaigns");
427 Log.v("Got C:{" + String.valueOf(list.size()) + "}", " CCMS campaigns"); 427 Log.v("Got C:{" + String.valueOf(list.size()) + "}", " CCMS campaigns");
428 Log.v("Matched M:{" + String.valueOf(ccmsCount) + "}", " CCMS campaigns"); 428 Log.v("Matched M:{" + String.valueOf(ccmsCount) + "}", " CCMS campaigns");
429 Log.v("=====================================", ""); 429 Log.v("=====================================", "");
430 - Log.v("TOTAL: Campaigns Sum=" + String.valueOf(loyaltyCount + ccmsCount), " campaigns to display"); 430 + Log.v("TOTAL: Campaigns Sum=" + String.valueOf(mCampaignList.size() - loyaltyCount + ccmsCount), " campaigns to display");
431 mUniqueCampaignList.get("gifts_for_you").retainAll(tempGifts); 431 mUniqueCampaignList.get("gifts_for_you").retainAll(tempGifts);
432 } 432 }
433 } 433 }
......
...@@ -2,6 +2,7 @@ package ly.warp.sdk.utils.managers; ...@@ -2,6 +2,7 @@ package ly.warp.sdk.utils.managers;
2 2
3 import java.util.HashMap; 3 import java.util.HashMap;
4 4
5 +import ly.warp.sdk.io.models.ActiveDFYCouponEventModel;
5 import ly.warp.sdk.io.models.CouponEventModel; 6 import ly.warp.sdk.io.models.CouponEventModel;
6 import ly.warp.sdk.io.models.LoyaltyContextualOfferModel; 7 import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
7 import ly.warp.sdk.io.models.LoyaltyGiftsForYouOfferClickEvent; 8 import ly.warp.sdk.io.models.LoyaltyGiftsForYouOfferClickEvent;
...@@ -27,6 +28,7 @@ public class WarplyEventBusManager { ...@@ -27,6 +28,7 @@ public class WarplyEventBusManager {
27 private LoyaltyGiftsForYouOfferClickEvent giftsYou; 28 private LoyaltyGiftsForYouOfferClickEvent giftsYou;
28 private QuestionnaireEventModel questionnaire; 29 private QuestionnaireEventModel questionnaire;
29 private CouponEventModel coupon; 30 private CouponEventModel coupon;
31 + private ActiveDFYCouponEventModel activeCoupon;
30 32
31 public WarplyEventBusManager() { 33 public WarplyEventBusManager() {
32 34
...@@ -44,6 +46,10 @@ public class WarplyEventBusManager { ...@@ -44,6 +46,10 @@ public class WarplyEventBusManager {
44 this.coupon = coupon; 46 this.coupon = coupon;
45 } 47 }
46 48
49 + public WarplyEventBusManager(ActiveDFYCouponEventModel activeCoupon) {
50 + this.activeCoupon = activeCoupon;
51 + }
52 +
47 public WarplyEventBusManager(LoyaltySDKFirebaseEventModel fireEvent) { 53 public WarplyEventBusManager(LoyaltySDKFirebaseEventModel fireEvent) {
48 this.fireEvent = fireEvent; 54 this.fireEvent = fireEvent;
49 } 55 }
...@@ -137,4 +143,8 @@ public class WarplyEventBusManager { ...@@ -137,4 +143,8 @@ public class WarplyEventBusManager {
137 public CouponEventModel getCoupon() { 143 public CouponEventModel getCoupon() {
138 return coupon; 144 return coupon;
139 } 145 }
146 +
147 + public ActiveDFYCouponEventModel getActiveCoupon() {
148 + return activeCoupon;
149 + }
140 } 150 }
......
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 android:shape="rectangle"> 3 android:shape="rectangle">
4 - <corners android:radius="7dp" /> 4 + <corners android:radius="12dp" />
5 5
6 <solid 6 <solid
7 android:width="2dp" 7 android:width="2dp"
......
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 android:shape="rectangle"> 3 android:shape="rectangle">
4 - <corners android:radius="7dp" /> 4 + <corners android:radius="12dp" />
5 5
6 <solid 6 <solid
7 android:width="2dp" 7 android:width="2dp"
......
...@@ -170,13 +170,6 @@ ...@@ -170,13 +170,6 @@
170 app:layout_constraintStart_toStartOf="parent" 170 app:layout_constraintStart_toStartOf="parent"
171 app:layout_constraintTop_toBottomOf="@+id/textView17"> 171 app:layout_constraintTop_toBottomOf="@+id/textView17">
172 172
173 - <!-- <ImageView-->
174 - <!-- android:layout_width="34dp"-->
175 - <!-- android:layout_height="25dp"-->
176 - <!-- android:layout_marginRight="15dp"-->
177 - <!-- android:adjustViewBounds="true"-->
178 - <!-- android:src="@drawable/gift_icon" />-->
179 -
180 <TextView 173 <TextView
181 android:layout_width="wrap_content" 174 android:layout_width="wrap_content"
182 android:layout_height="wrap_content" 175 android:layout_height="wrap_content"
...@@ -184,32 +177,32 @@ ...@@ -184,32 +177,32 @@
184 android:text="@string/cos_gift_it" 177 android:text="@string/cos_gift_it"
185 android:textColor="@color/white" 178 android:textColor="@color/white"
186 android:textSize="17dp" 179 android:textSize="17dp"
187 - android:textStyle="bold" /> 180 + android:textFontWeight="600" />
188 </LinearLayout> 181 </LinearLayout>
189 182
190 - <!-- <LinearLayout--> 183 + <LinearLayout
191 - <!-- android:id="@+id/ll_get_gift"--> 184 + android:id="@+id/ll_shops"
192 - <!-- android:layout_width="match_parent"--> 185 + android:layout_width="240dp"
193 - <!-- android:layout_height="50dp"--> 186 + android:layout_height="50dp"
194 - <!-- android:layout_marginHorizontal="32dp"--> 187 + android:layout_marginHorizontal="32dp"
195 - <!-- android:layout_marginTop="24dp"--> 188 + android:layout_marginTop="24dp"
196 - <!-- android:background="@drawable/shape_cos_gradient2"--> 189 + android:background="@drawable/selector_button_grey"
197 - <!-- android:gravity="center"--> 190 + android:gravity="center"
198 - <!-- android:orientation="horizontal"--> 191 + android:orientation="horizontal"
199 - <!-- app:layout_constraintEnd_toEndOf="parent"--> 192 + android:visibility="gone"
200 - <!-- app:layout_constraintHorizontal_bias="0.516"--> 193 + app:layout_constraintEnd_toEndOf="parent"
201 - <!-- app:layout_constraintStart_toStartOf="parent"--> 194 + app:layout_constraintStart_toStartOf="parent"
202 - <!-- app:layout_constraintTop_toBottomOf="@+id/ll_gift_it">--> 195 + app:layout_constraintTop_toBottomOf="@+id/ll_gift_it">
203 196
204 - <!-- <TextView--> 197 + <TextView
205 - <!-- android:layout_width="wrap_content"--> 198 + android:layout_width="wrap_content"
206 - <!-- android:layout_height="wrap_content"--> 199 + android:layout_height="wrap_content"
207 - <!-- android:gravity="center"--> 200 + android:gravity="center"
208 - <!-- android:text="Πάρε το δώρο σου"--> 201 + android:text="@string/cos_shops"
209 - <!-- android:textColor="@color/white"--> 202 + android:textColor="@color/cos_green6"
210 - <!-- android:textSize="17dp"--> 203 + android:textSize="17dp"
211 - <!-- android:textStyle="bold" />--> 204 + android:textFontWeight="600" />
212 - <!-- </LinearLayout>--> 205 + </LinearLayout>
213 206
214 <RelativeLayout 207 <RelativeLayout
215 android:id="@+id/rl_terms" 208 android:id="@+id/rl_terms"
...@@ -219,7 +212,7 @@ ...@@ -219,7 +212,7 @@
219 android:gravity="center" 212 android:gravity="center"
220 app:layout_constraintEnd_toEndOf="parent" 213 app:layout_constraintEnd_toEndOf="parent"
221 app:layout_constraintStart_toStartOf="parent" 214 app:layout_constraintStart_toStartOf="parent"
222 - app:layout_constraintTop_toBottomOf="@+id/ll_gift_it"> 215 + app:layout_constraintTop_toBottomOf="@+id/ll_shops">
223 216
224 <LinearLayout 217 <LinearLayout
225 android:id="@+id/ll_terms_inner" 218 android:id="@+id/ll_terms_inner"
...@@ -234,8 +227,7 @@ ...@@ -234,8 +227,7 @@
234 android:layout_width="wrap_content" 227 android:layout_width="wrap_content"
235 android:layout_height="wrap_content" 228 android:layout_height="wrap_content"
236 android:text="Όροι χρήσης" 229 android:text="Όροι χρήσης"
237 - android:textColor="#415564" 230 + android:textColor="@color/grey"
238 - android:textFontWeight="600"
239 android:textSize="15sp" /> 231 android:textSize="15sp" />
240 232
241 <ImageView 233 <ImageView
......
...@@ -336,10 +336,11 @@ ...@@ -336,10 +336,11 @@
336 android:paddingVertical="10dp"> 336 android:paddingVertical="10dp">
337 337
338 <LinearLayout 338 <LinearLayout
339 - android:layout_width="wrap_content" 339 + android:layout_width="0dp"
340 android:layout_height="wrap_content" 340 android:layout_height="wrap_content"
341 - android:layout_marginStart="24dp" 341 + android:layout_marginHorizontal="24dp"
342 android:orientation="vertical" 342 android:orientation="vertical"
343 + app:layout_constraintEnd_toStartOf="@+id/iv_deals_circle"
343 app:layout_constraintBottom_toBottomOf="parent" 344 app:layout_constraintBottom_toBottomOf="parent"
344 app:layout_constraintStart_toStartOf="parent" 345 app:layout_constraintStart_toStartOf="parent"
345 app:layout_constraintTop_toTopOf="parent"> 346 app:layout_constraintTop_toTopOf="parent">
...@@ -348,7 +349,7 @@ ...@@ -348,7 +349,7 @@
348 android:id="@+id/tv_active_gifts" 349 android:id="@+id/tv_active_gifts"
349 android:layout_width="wrap_content" 350 android:layout_width="wrap_content"
350 android:layout_height="wrap_content" 351 android:layout_height="wrap_content"
351 - android:text="@string/cos_active_deals" 352 + tools:text="@string/cos_active_deals"
352 android:textColor="@color/blue_dark" 353 android:textColor="@color/blue_dark"
353 android:textFontWeight="600" 354 android:textFontWeight="600"
354 android:textSize="18sp" /> 355 android:textSize="18sp" />
...@@ -359,18 +360,21 @@ ...@@ -359,18 +360,21 @@
359 android:layout_height="wrap_content" 360 android:layout_height="wrap_content"
360 android:textColor="@color/blue_dark" 361 android:textColor="@color/blue_dark"
361 android:textSize="18sp" 362 android:textSize="18sp"
363 + android:maxLines="2"
364 + android:ellipsize="end"
362 android:textStyle="bold" 365 android:textStyle="bold"
363 tools:text="961544809" /> 366 tools:text="961544809" />
364 367
365 - <TextView 368 +<!-- <TextView-->
366 - android:id="@+id/tv_active_deals_date_text" 369 +<!-- android:id="@+id/tv_active_deals_date_text"-->
367 - android:layout_width="wrap_content" 370 +<!-- android:layout_width="wrap_content"-->
368 - android:layout_height="wrap_content" 371 +<!-- android:layout_height="wrap_content"-->
369 - tools:text="@string/cos_active_coupon_date" 372 +<!-- tools:text="@string/cos_active_coupon_date"-->
370 - android:textColor="@color/blue_dark" /> 373 +<!-- android:textColor="@color/blue_dark" />-->
371 </LinearLayout> 374 </LinearLayout>
372 375
373 <ImageView 376 <ImageView
377 + android:id="@+id/iv_deals_circle"
374 android:layout_width="86dp" 378 android:layout_width="86dp"
375 android:layout_height="86dp" 379 android:layout_height="86dp"
376 android:layout_marginVertical="4dp" 380 android:layout_marginVertical="4dp"
......
...@@ -47,7 +47,8 @@ ...@@ -47,7 +47,8 @@
47 <string name="cos_see_all">Δες τα όλα -></string> 47 <string name="cos_see_all">Δες τα όλα -></string>
48 <string name="cos_active_rewards">Έχεις %1$s ενεργά δώρα</string> 48 <string name="cos_active_rewards">Έχεις %1$s ενεργά δώρα</string>
49 <string name="cos_analysis">Ανάλυση</string> 49 <string name="cos_analysis">Ανάλυση</string>
50 - <string name="cos_active_deals">Ενεργός κωδικός:</string> 50 + <string name="cos_active_deals">%1$s Ενεργός κωδικός:</string>
51 + <string name="cos_active_deals_plural">%1$s Ενεργοί κωδικοί:</string>
51 <string name="cos_monthly">Μηνιαία</string> 52 <string name="cos_monthly">Μηνιαία</string>
52 <string name="cos_six_months">6Μηνο</string> 53 <string name="cos_six_months">6Μηνο</string>
53 <string name="cos_annual">12Μηνο</string> 54 <string name="cos_annual">12Μηνο</string>
...@@ -85,6 +86,7 @@ ...@@ -85,6 +86,7 @@
85 <string name="cos_dlg_return_text">Έλαβες πίσω το δώρο σου, κουπόνι αξίας 100€ για τα Intersport</string> 86 <string name="cos_dlg_return_text">Έλαβες πίσω το δώρο σου, κουπόνι αξίας 100€ για τα Intersport</string>
86 <string name="cos_dlg_negative_button2">Άκυρο</string> 87 <string name="cos_dlg_negative_button2">Άκυρο</string>
87 <string name="cos_profile_preferences">+Προτιμήσεις</string> 88 <string name="cos_profile_preferences">+Προτιμήσεις</string>
89 + <string name="cos_shops">Δες τα καταστήματα</string>
88 90
89 <string-array name="coupons_array"> 91 <string-array name="coupons_array">
90 <item>Κουπόνια</item> 92 <item>Κουπόνια</item>
......