Panagiotis Triantafyllou

new keys

......@@ -96,9 +96,9 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
}
mergeDatasets(
mValuesList,
mSeasonalList,
mContextualList
mContextualList,
mValuesList
);
mIvBack = findViewById(R.id.iv_list_close);
......@@ -167,9 +167,9 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
}
mergeDatasets(
mValuesList,
mSeasonalList,
mContextualList
mContextualList,
mValuesList
);
runOnUiThread(() -> {
......@@ -429,21 +429,10 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
}
}
private void mergeDatasets(ArrayList<Campaign> campaignList,
ArrayList<LoyaltyGiftsForYouPackage> seasonalList,
ArrayList<LoyaltyContextualOfferModel> ccmsList) {
private void mergeDatasets(ArrayList<LoyaltyGiftsForYouPackage> seasonalList,
ArrayList<LoyaltyContextualOfferModel> ccmsList,
ArrayList<Campaign> campaignList) {
mData.clear();
if (campaignList != null && campaignList.size() > 0) {
Log.v("GIFTS_FOR_YOU", String.valueOf(campaignList.size()));
for (Campaign campaign : campaignList) {
MergedGifts data = new MergedGifts();
data.setCampaign(campaign);
data.setSeasonalList(null);
data.setDataType(1);
mData.add(data);
}
}
if (seasonalList != null && seasonalList.size() > 0) {
Log.v("SEASONAL", String.valueOf(seasonalList.size()));
for (LoyaltyGiftsForYouPackage seasonal : seasonalList) {
......@@ -466,6 +455,17 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
mData.add(data);
}
}
if (campaignList != null && campaignList.size() > 0) {
Log.v("GIFTS_FOR_YOU", String.valueOf(campaignList.size()));
for (Campaign campaign : campaignList) {
MergedGifts data = new MergedGifts();
data.setCampaign(campaign);
data.setSeasonalList(null);
data.setDataType(1);
mData.add(data);
}
}
}
private void filterItems() {
......
......@@ -103,43 +103,43 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
mLlEmptyWallet = findViewById(R.id.ll_empty_wallet);
mLlActiveCodesView = findViewById(R.id.ll_active_deals_codes_view);
ArrayList<ActiveDFYCouponModel> dlist = new ArrayList<>();
ActiveDFYCouponModel model = new ActiveDFYCouponModel();
model.setCode("123456789");
model.setValue("10");
model.setDate("2022-09-14 20:20");
dlist.add(model);
model = new ActiveDFYCouponModel();
model.setCode("123456780");
model.setValue("10");
model.setDate("2022-09-14 20:20");
dlist.add(model);
model = new ActiveDFYCouponModel();
model.setCode("123456781");
model.setValue("10");
model.setDate("2022-09-14 20:20");
dlist.add(model);
model = new ActiveDFYCouponModel();
model.setCode("123456782");
model.setValue("10");
model.setDate("2022-09-14 20:20");
dlist.add(model);
model = new ActiveDFYCouponModel();
model.setCode("123456783");
model.setValue("10");
model.setDate("2022-09-14 20:20");
dlist.add(model);
model = new ActiveDFYCouponModel();
model.setCode("123456784");
model.setValue("10");
model.setDate("2022-09-14 20:20");
dlist.add(model);
model = new ActiveDFYCouponModel();
model.setCode("123456785");
model.setValue("10");
model.setDate("2022-09-14 20:20");
dlist.add(model);
WarplyManagerHelper.setActiveDFYCoupons(dlist);
// ArrayList<ActiveDFYCouponModel> dlist = new ArrayList<>();
// ActiveDFYCouponModel model = new ActiveDFYCouponModel();
// model.setCode("123456789");
// model.setValue("10");
// model.setDate("2022-09-14 20:20");
// dlist.add(model);
// model = new ActiveDFYCouponModel();
// model.setCode("123456780");
// model.setValue("10");
// model.setDate("2022-09-14 20:20");
// dlist.add(model);
// model = new ActiveDFYCouponModel();
// model.setCode("123456781");
// model.setValue("10");
// model.setDate("2022-09-14 20:20");
// dlist.add(model);
// model = new ActiveDFYCouponModel();
// model.setCode("123456782");
// model.setValue("10");
// model.setDate("2022-09-14 20:20");
// dlist.add(model);
// model = new ActiveDFYCouponModel();
// model.setCode("123456783");
// model.setValue("10");
// model.setDate("2022-09-14 20:20");
// dlist.add(model);
// model = new ActiveDFYCouponModel();
// model.setCode("123456784");
// model.setValue("10");
// model.setDate("2022-09-14 20:20");
// dlist.add(model);
// model = new ActiveDFYCouponModel();
// model.setCode("123456785");
// model.setValue("10");
// model.setDate("2022-09-14 20:20");
// dlist.add(model);
// WarplyManagerHelper.setActiveDFYCoupons(dlist);
if (WarplyManagerHelper.getActiveDFYCoupons() != null) {
Collections.sort(WarplyManagerHelper.getActiveDFYCoupons(), new Comparator<ActiveDFYCouponModel>() {
......@@ -402,7 +402,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals_plural), String.valueOf(WarplyManagerHelper.getActiveDFYCoupons().size())));
mTvActiveCode.setVisibility(View.GONE);
for (ActiveDFYCouponModel dealsItem : WarplyManagerHelper.getActiveDFYCoupons()) {
//TODO fix logic
for (ActiveDFYCouponModel dealsItem : WarplyManagerHelper.getActiveDFYCoupons().subList(0, 4)) {
LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout v = (LinearLayout) vi.inflate(R.layout.item_selectable, null);
TextView textView = (TextView) v.findViewById(R.id.tv_code_copy);
......
......@@ -203,7 +203,7 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
pinName.setText(merch.getName());
TextView pinDays = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_days);
pinDays.setText(merch.getSnippet());
pinDays.setText(merch.getSnippet()); //TODO: wrong getter
TextView pinTel = (TextView) bottomSheetDialog.findViewById(R.id.tv_pin_tel);
pinTel.setText(merch.getTelephone());
......
......@@ -200,7 +200,10 @@ public class WarplyManagerHelper {
mAlertDialogSharing = new AlertDialog.Builder(context)
.setTitle(R.string.cos_dlg_success_title)
.setMessage(alertTitle)
.setPositiveButton(R.string.cos_dlg_positive_button, (dialogPositive, whichPositive) -> {
.setNegativeButton(R.string.cos_dlg_negative_button, (dialogPositive, whichPositive) -> {
rejectSharingDialog(context, sharingId);
})
.setPositiveButton(R.string.cos_dlg_positive_button, (dialogNegative, whichNegative) -> {
WarplyManager.cosmoteRetrieveSharing(new CosmoteRetrieveSharingRequest()
.setSharingId(sharingId)
.setAccept(true),
......@@ -233,9 +236,6 @@ public class WarplyManagerHelper {
}
});
})
.setNegativeButton(R.string.cos_dlg_negative_button, (dialogNegative, whichNegative) -> {
rejectSharingDialog(context, sharingId);
})
.show();
}
......
......@@ -338,11 +338,12 @@
android:id="@+id/ll_active_deals_codes_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_maxHeight="60dp"
android:visibility="gone"
app:alignContent="flex_start"
app:alignItems="flex_start"
app:flexWrap="wrap"></com.google.android.flexbox.FlexboxLayout>
app:flexDirection="row"
app:justifyContent="flex_start"
app:flexWrap="wrap">
</com.google.android.flexbox.FlexboxLayout>
<TextView
android:id="@+id/tv_active_deals_date_text"
......