Panagiotis Triantafyllou

new keys

...@@ -96,9 +96,9 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene ...@@ -96,9 +96,9 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
96 } 96 }
97 97
98 mergeDatasets( 98 mergeDatasets(
99 - mValuesList,
100 mSeasonalList, 99 mSeasonalList,
101 - mContextualList 100 + mContextualList,
101 + mValuesList
102 ); 102 );
103 103
104 mIvBack = findViewById(R.id.iv_list_close); 104 mIvBack = findViewById(R.id.iv_list_close);
...@@ -167,9 +167,9 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene ...@@ -167,9 +167,9 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
167 } 167 }
168 168
169 mergeDatasets( 169 mergeDatasets(
170 - mValuesList,
171 mSeasonalList, 170 mSeasonalList,
172 - mContextualList 171 + mContextualList,
172 + mValuesList
173 ); 173 );
174 174
175 runOnUiThread(() -> { 175 runOnUiThread(() -> {
...@@ -429,21 +429,10 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene ...@@ -429,21 +429,10 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
429 } 429 }
430 } 430 }
431 431
432 - private void mergeDatasets(ArrayList<Campaign> campaignList, 432 + private void mergeDatasets(ArrayList<LoyaltyGiftsForYouPackage> seasonalList,
433 - ArrayList<LoyaltyGiftsForYouPackage> seasonalList, 433 + ArrayList<LoyaltyContextualOfferModel> ccmsList,
434 - ArrayList<LoyaltyContextualOfferModel> ccmsList) { 434 + ArrayList<Campaign> campaignList) {
435 mData.clear(); 435 mData.clear();
436 - if (campaignList != null && campaignList.size() > 0) {
437 - Log.v("GIFTS_FOR_YOU", String.valueOf(campaignList.size()));
438 - for (Campaign campaign : campaignList) {
439 - MergedGifts data = new MergedGifts();
440 - data.setCampaign(campaign);
441 - data.setSeasonalList(null);
442 - data.setDataType(1);
443 - mData.add(data);
444 - }
445 - }
446 -
447 if (seasonalList != null && seasonalList.size() > 0) { 436 if (seasonalList != null && seasonalList.size() > 0) {
448 Log.v("SEASONAL", String.valueOf(seasonalList.size())); 437 Log.v("SEASONAL", String.valueOf(seasonalList.size()));
449 for (LoyaltyGiftsForYouPackage seasonal : seasonalList) { 438 for (LoyaltyGiftsForYouPackage seasonal : seasonalList) {
...@@ -466,6 +455,17 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene ...@@ -466,6 +455,17 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
466 mData.add(data); 455 mData.add(data);
467 } 456 }
468 } 457 }
458 +
459 + if (campaignList != null && campaignList.size() > 0) {
460 + Log.v("GIFTS_FOR_YOU", String.valueOf(campaignList.size()));
461 + for (Campaign campaign : campaignList) {
462 + MergedGifts data = new MergedGifts();
463 + data.setCampaign(campaign);
464 + data.setSeasonalList(null);
465 + data.setDataType(1);
466 + mData.add(data);
467 + }
468 + }
469 } 469 }
470 470
471 private void filterItems() { 471 private void filterItems() {
......
...@@ -103,43 +103,43 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { ...@@ -103,43 +103,43 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
103 mLlEmptyWallet = findViewById(R.id.ll_empty_wallet); 103 mLlEmptyWallet = findViewById(R.id.ll_empty_wallet);
104 mLlActiveCodesView = findViewById(R.id.ll_active_deals_codes_view); 104 mLlActiveCodesView = findViewById(R.id.ll_active_deals_codes_view);
105 105
106 - ArrayList<ActiveDFYCouponModel> dlist = new ArrayList<>(); 106 +// ArrayList<ActiveDFYCouponModel> dlist = new ArrayList<>();
107 - ActiveDFYCouponModel model = new ActiveDFYCouponModel(); 107 +// ActiveDFYCouponModel model = new ActiveDFYCouponModel();
108 - model.setCode("123456789"); 108 +// model.setCode("123456789");
109 - model.setValue("10"); 109 +// model.setValue("10");
110 - model.setDate("2022-09-14 20:20"); 110 +// model.setDate("2022-09-14 20:20");
111 - dlist.add(model); 111 +// dlist.add(model);
112 - model = new ActiveDFYCouponModel(); 112 +// model = new ActiveDFYCouponModel();
113 - model.setCode("123456780"); 113 +// model.setCode("123456780");
114 - model.setValue("10"); 114 +// model.setValue("10");
115 - model.setDate("2022-09-14 20:20"); 115 +// model.setDate("2022-09-14 20:20");
116 - dlist.add(model); 116 +// dlist.add(model);
117 - model = new ActiveDFYCouponModel(); 117 +// model = new ActiveDFYCouponModel();
118 - model.setCode("123456781"); 118 +// model.setCode("123456781");
119 - model.setValue("10"); 119 +// model.setValue("10");
120 - model.setDate("2022-09-14 20:20"); 120 +// model.setDate("2022-09-14 20:20");
121 - dlist.add(model); 121 +// dlist.add(model);
122 - model = new ActiveDFYCouponModel(); 122 +// model = new ActiveDFYCouponModel();
123 - model.setCode("123456782"); 123 +// model.setCode("123456782");
124 - model.setValue("10"); 124 +// model.setValue("10");
125 - model.setDate("2022-09-14 20:20"); 125 +// model.setDate("2022-09-14 20:20");
126 - dlist.add(model); 126 +// dlist.add(model);
127 - model = new ActiveDFYCouponModel(); 127 +// model = new ActiveDFYCouponModel();
128 - model.setCode("123456783"); 128 +// model.setCode("123456783");
129 - model.setValue("10"); 129 +// model.setValue("10");
130 - model.setDate("2022-09-14 20:20"); 130 +// model.setDate("2022-09-14 20:20");
131 - dlist.add(model); 131 +// dlist.add(model);
132 - model = new ActiveDFYCouponModel(); 132 +// model = new ActiveDFYCouponModel();
133 - model.setCode("123456784"); 133 +// model.setCode("123456784");
134 - model.setValue("10"); 134 +// model.setValue("10");
135 - model.setDate("2022-09-14 20:20"); 135 +// model.setDate("2022-09-14 20:20");
136 - dlist.add(model); 136 +// dlist.add(model);
137 - model = new ActiveDFYCouponModel(); 137 +// model = new ActiveDFYCouponModel();
138 - model.setCode("123456785"); 138 +// model.setCode("123456785");
139 - model.setValue("10"); 139 +// model.setValue("10");
140 - model.setDate("2022-09-14 20:20"); 140 +// model.setDate("2022-09-14 20:20");
141 - dlist.add(model); 141 +// dlist.add(model);
142 - WarplyManagerHelper.setActiveDFYCoupons(dlist); 142 +// WarplyManagerHelper.setActiveDFYCoupons(dlist);
143 143
144 if (WarplyManagerHelper.getActiveDFYCoupons() != null) { 144 if (WarplyManagerHelper.getActiveDFYCoupons() != null) {
145 Collections.sort(WarplyManagerHelper.getActiveDFYCoupons(), new Comparator<ActiveDFYCouponModel>() { 145 Collections.sort(WarplyManagerHelper.getActiveDFYCoupons(), new Comparator<ActiveDFYCouponModel>() {
...@@ -402,7 +402,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { ...@@ -402,7 +402,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
402 mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals_plural), String.valueOf(WarplyManagerHelper.getActiveDFYCoupons().size()))); 402 mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals_plural), String.valueOf(WarplyManagerHelper.getActiveDFYCoupons().size())));
403 mTvActiveCode.setVisibility(View.GONE); 403 mTvActiveCode.setVisibility(View.GONE);
404 404
405 - for (ActiveDFYCouponModel dealsItem : WarplyManagerHelper.getActiveDFYCoupons()) { 405 + //TODO fix logic
406 + for (ActiveDFYCouponModel dealsItem : WarplyManagerHelper.getActiveDFYCoupons().subList(0, 4)) {
406 LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); 407 LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
407 LinearLayout v = (LinearLayout) vi.inflate(R.layout.item_selectable, null); 408 LinearLayout v = (LinearLayout) vi.inflate(R.layout.item_selectable, null);
408 TextView textView = (TextView) v.findViewById(R.id.tv_code_copy); 409 TextView textView = (TextView) v.findViewById(R.id.tv_code_copy);
......
...@@ -203,7 +203,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe ...@@ -203,7 +203,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
203 pinName.setText(merch.getName()); 203 pinName.setText(merch.getName());
204 204
205 TextView pinDays = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_days); 205 TextView pinDays = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_days);
206 - pinDays.setText(merch.getSnippet()); 206 + pinDays.setText(merch.getSnippet()); //TODO: wrong getter
207 207
208 TextView pinTel = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_tel); 208 TextView pinTel = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_tel);
209 pinTel.setText(merch.getTelephone()); 209 pinTel.setText(merch.getTelephone());
......
...@@ -200,7 +200,10 @@ public class WarplyManagerHelper { ...@@ -200,7 +200,10 @@ public class WarplyManagerHelper {
200 mAlertDialogSharing = new AlertDialog.Builder(context) 200 mAlertDialogSharing = new AlertDialog.Builder(context)
201 .setTitle(R.string.cos_dlg_success_title) 201 .setTitle(R.string.cos_dlg_success_title)
202 .setMessage(alertTitle) 202 .setMessage(alertTitle)
203 - .setPositiveButton(R.string.cos_dlg_positive_button, (dialogPositive, whichPositive) -> { 203 + .setNegativeButton(R.string.cos_dlg_negative_button, (dialogPositive, whichPositive) -> {
204 + rejectSharingDialog(context, sharingId);
205 + })
206 + .setPositiveButton(R.string.cos_dlg_positive_button, (dialogNegative, whichNegative) -> {
204 WarplyManager.cosmoteRetrieveSharing(new CosmoteRetrieveSharingRequest() 207 WarplyManager.cosmoteRetrieveSharing(new CosmoteRetrieveSharingRequest()
205 .setSharingId(sharingId) 208 .setSharingId(sharingId)
206 .setAccept(true), 209 .setAccept(true),
...@@ -233,9 +236,6 @@ public class WarplyManagerHelper { ...@@ -233,9 +236,6 @@ public class WarplyManagerHelper {
233 } 236 }
234 }); 237 });
235 }) 238 })
236 - .setNegativeButton(R.string.cos_dlg_negative_button, (dialogNegative, whichNegative) -> {
237 - rejectSharingDialog(context, sharingId);
238 - })
239 .show(); 239 .show();
240 } 240 }
241 241
......
...@@ -338,11 +338,12 @@ ...@@ -338,11 +338,12 @@
338 android:id="@+id/ll_active_deals_codes_view" 338 android:id="@+id/ll_active_deals_codes_view"
339 android:layout_width="match_parent" 339 android:layout_width="match_parent"
340 android:layout_height="wrap_content" 340 android:layout_height="wrap_content"
341 - app:layout_maxHeight="60dp"
342 android:visibility="gone" 341 android:visibility="gone"
343 - app:alignContent="flex_start" 342 + app:flexDirection="row"
344 - app:alignItems="flex_start" 343 + app:justifyContent="flex_start"
345 - app:flexWrap="wrap"></com.google.android.flexbox.FlexboxLayout> 344 + app:flexWrap="wrap">
345 +
346 + </com.google.android.flexbox.FlexboxLayout>
346 347
347 <TextView 348 <TextView
348 android:id="@+id/tv_active_deals_date_text" 349 android:id="@+id/tv_active_deals_date_text"
......