Panagiotis Triantafyllou

new keys

...@@ -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-cosbeta90' 5 + PUBLISH_VERSION = '4.5.4-cosbeta91'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 7 }
8 8
......
...@@ -380,8 +380,9 @@ public class WarplyManagerHelper { ...@@ -380,8 +380,9 @@ public class WarplyManagerHelper {
380 mAlertDialogErrorSharing = new AlertDialog.Builder(context) 380 mAlertDialogErrorSharing = new AlertDialog.Builder(context)
381 .setTitle(R.string.cos_dlg_return_title) 381 .setTitle(R.string.cos_dlg_return_title)
382 .setMessage(message) 382 .setMessage(message)
383 - .setNegativeButton(R.string.cos_dlg_negative_button, (dialogPositive, whichPositive) -> { 383 + .setNegativeButton(R.string.cos_dlg_negative_button2, (dialogPositive, whichPositive) -> {
384 - rejectSharingDialog(context, sharingId); 384 +// rejectSharingDialog(context, sharingId);
385 + dialogPositive.dismiss();
385 }) 386 })
386 .setPositiveButton(R.string.cos_dlg_positive_button, (dialogNegative, whichNegative) -> { 387 .setPositiveButton(R.string.cos_dlg_positive_button, (dialogNegative, whichNegative) -> {
387 WarplyManager.cosmoteRetrieveSharing(new CosmoteRetrieveSharingRequest() 388 WarplyManager.cosmoteRetrieveSharing(new CosmoteRetrieveSharingRequest()
...@@ -405,7 +406,7 @@ public class WarplyManagerHelper { ...@@ -405,7 +406,7 @@ public class WarplyManagerHelper {
405 406
406 } 407 }
407 }); 408 });
408 - acceptSharingDialog(context); 409 +// acceptSharingDialog(context);
409 } else 410 } else
410 errorSharingDialog(context); 411 errorSharingDialog(context);
411 } 412 }
......
...@@ -28,10 +28,12 @@ import io.reactivex.subjects.PublishSubject; ...@@ -28,10 +28,12 @@ import io.reactivex.subjects.PublishSubject;
28 import ly.warp.sdk.R; 28 import ly.warp.sdk.R;
29 import ly.warp.sdk.activities.GiftsForYouActivity; 29 import ly.warp.sdk.activities.GiftsForYouActivity;
30 import ly.warp.sdk.activities.TelcoActivity; 30 import ly.warp.sdk.activities.TelcoActivity;
31 +import ly.warp.sdk.activities.WarpViewActivity;
31 import ly.warp.sdk.io.models.LoyaltyContextualOfferModel; 32 import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
32 import ly.warp.sdk.io.models.MergedGifts; 33 import ly.warp.sdk.io.models.MergedGifts;
33 import ly.warp.sdk.utils.WarpJSONParser; 34 import ly.warp.sdk.utils.WarpJSONParser;
34 import ly.warp.sdk.utils.WarplyManagerHelper; 35 import ly.warp.sdk.utils.WarplyManagerHelper;
36 +import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
35 37
36 public class MergedGiftsAdapter extends RecyclerView.Adapter<MergedGiftsAdapter.MergedGiftsViewHolder> { 38 public class MergedGiftsAdapter extends RecyclerView.Adapter<MergedGiftsAdapter.MergedGiftsViewHolder> {
37 39
...@@ -110,6 +112,37 @@ public class MergedGiftsAdapter extends RecyclerView.Adapter<MergedGiftsAdapter. ...@@ -110,6 +112,37 @@ public class MergedGiftsAdapter extends RecyclerView.Adapter<MergedGiftsAdapter.
110 } 112 }
111 113
112 holder.tvMergedGiftsTitle.setText(ccms.getTitle()); 114 holder.tvMergedGiftsTitle.setText(ccms.getTitle());
115 + if (mergedgiftsItem.getCampaign().getIsNew())
116 + holder.ivIsNew.setVisibility(View.VISIBLE);
117 + else
118 + holder.ivIsNew.setVisibility(View.GONE);
119 + holder.itemView.setOnClickListener(v -> onClickSubject.onNext(mergedgiftsItem));
120 + return;
121 + }
122 + }
123 + return;
124 + }
125 +
126 + if (extraFields.has("ccms_offer") && extraFields.optString("ccms_offer").equals("true")) {
127 + for (LoyaltyContextualOfferModel ccms : WarplyManagerHelper.getCCMSLoyaltyCampaigns()) {
128 + if (ccms.getLoyaltyCampaignId().equals(mergedgiftsItem.getCampaign().getSessionUUID()) && ccms.getZone().equals("COSMOTE_APP_GIFTS4U")) {
129 + if (!TextUtils.isEmpty(ccms.getImageUrl())) {
130 + Glide.with(mContext)
131 + .load(ccms.getImageUrl())
132 + .transform(new CenterCrop(), new RoundedCorners(4))
133 + .diskCacheStrategy(DiskCacheStrategy.DATA)
134 + .into(holder.ivMergedGiftsLogo);
135 + } else {
136 + Glide.with(mContext)
137 + .load(R.drawable.ic_cosmote_logo_horizontal_grey)
138 + .into(holder.ivMergedGiftsLogo);
139 + }
140 +
141 + holder.tvMergedGiftsTitle.setText(ccms.getTitle());
142 + if (mergedgiftsItem.getCampaign().getIsNew())
143 + holder.ivIsNew.setVisibility(View.VISIBLE);
144 + else
145 + holder.ivIsNew.setVisibility(View.GONE);
113 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(mergedgiftsItem)); 146 holder.itemView.setOnClickListener(v -> onClickSubject.onNext(mergedgiftsItem));
114 return; 147 return;
115 } 148 }
......
...@@ -15,12 +15,17 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy; ...@@ -15,12 +15,17 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy;
15 import com.bumptech.glide.load.resource.bitmap.CenterCrop; 15 import com.bumptech.glide.load.resource.bitmap.CenterCrop;
16 import com.bumptech.glide.load.resource.bitmap.RoundedCorners; 16 import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
17 17
18 +import org.json.JSONObject;
19 +
18 import java.util.ArrayList; 20 import java.util.ArrayList;
19 21
20 import io.reactivex.Observable; 22 import io.reactivex.Observable;
21 import io.reactivex.subjects.PublishSubject; 23 import io.reactivex.subjects.PublishSubject;
22 import ly.warp.sdk.R; 24 import ly.warp.sdk.R;
23 import ly.warp.sdk.io.models.Campaign; 25 import ly.warp.sdk.io.models.Campaign;
26 +import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
27 +import ly.warp.sdk.utils.WarpJSONParser;
28 +import ly.warp.sdk.utils.WarplyManagerHelper;
24 29
25 public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapter.MoreCampaignViewHolder> { 30 public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapter.MoreCampaignViewHolder> {
26 31
...@@ -86,6 +91,40 @@ public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapte ...@@ -86,6 +91,40 @@ public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapte
86 Campaign campaignItem = mCampaigns.get(position); 91 Campaign campaignItem = mCampaigns.get(position);
87 92
88 if (campaignItem != null) { 93 if (campaignItem != null) {
94 + JSONObject extraFields = WarpJSONParser.getJSONFromString(campaignItem.getExtraFields());
95 + if (extraFields != null) {
96 + if (extraFields.has("ccms_offer") && extraFields.optString("ccms_offer").equals("true")) {
97 + for (LoyaltyContextualOfferModel ccms : WarplyManagerHelper.getCCMSLoyaltyCampaigns()) {
98 + if (ccms.getLoyaltyCampaignId().equals(campaignItem.getSessionUUID()) && ccms.getZone().equals("COSMOTE_APP_MORE4U")) {
99 + if (!TextUtils.isEmpty(ccms.getImageUrl())) {
100 + Glide.with(mContext)
101 + .load(ccms.getImageUrl())
102 + .transform(new CenterCrop(), new RoundedCorners(4))
103 + .diskCacheStrategy(DiskCacheStrategy.DATA)
104 + .into(holder.ivCampaignTitle);
105 + } else {
106 + Glide.with(mContext)
107 + .load(R.drawable.ic_cosmote_logo_horizontal_grey)
108 + .into(holder.ivCampaignTitle);
109 + }
110 +
111 + holder.tvCampaignTitle.setText(ccms.getTitle());
112 + holder.tvCampaignSubtitle.setText(ccms.getSubtitle());
113 + holder.tvCampaignMessage.setText(ccms.getMessage());
114 + if (campaignItem.getIsNew())
115 + holder.ivIsNew.setVisibility(View.VISIBLE);
116 + else
117 + holder.ivIsNew.setVisibility(View.GONE);
118 +
119 + holder.itemView.setOnClickListener(v -> onClickSubject.onNext(campaignItem));
120 + return;
121 + }
122 + }
123 + return;
124 + }
125 + }
126 +
127 +
89 if (!TextUtils.isEmpty(campaignItem.getLogoUrl())) { 128 if (!TextUtils.isEmpty(campaignItem.getLogoUrl())) {
90 Glide.with(mContext) 129 Glide.with(mContext)
91 .load(campaignItem.getLogoUrl()) 130 .load(campaignItem.getLogoUrl())
......