Panagiotis Triantafyllou

new keys

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4-cosbeta90'
PUBLISH_VERSION = '4.5.4-cosbeta91'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -380,8 +380,9 @@ public class WarplyManagerHelper {
mAlertDialogErrorSharing = new AlertDialog.Builder(context)
.setTitle(R.string.cos_dlg_return_title)
.setMessage(message)
.setNegativeButton(R.string.cos_dlg_negative_button, (dialogPositive, whichPositive) -> {
rejectSharingDialog(context, sharingId);
.setNegativeButton(R.string.cos_dlg_negative_button2, (dialogPositive, whichPositive) -> {
// rejectSharingDialog(context, sharingId);
dialogPositive.dismiss();
})
.setPositiveButton(R.string.cos_dlg_positive_button, (dialogNegative, whichNegative) -> {
WarplyManager.cosmoteRetrieveSharing(new CosmoteRetrieveSharingRequest()
......@@ -405,7 +406,7 @@ public class WarplyManagerHelper {
}
});
acceptSharingDialog(context);
// acceptSharingDialog(context);
} else
errorSharingDialog(context);
}
......
......@@ -28,10 +28,12 @@ import io.reactivex.subjects.PublishSubject;
import ly.warp.sdk.R;
import ly.warp.sdk.activities.GiftsForYouActivity;
import ly.warp.sdk.activities.TelcoActivity;
import ly.warp.sdk.activities.WarpViewActivity;
import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
import ly.warp.sdk.io.models.MergedGifts;
import ly.warp.sdk.utils.WarpJSONParser;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
public class MergedGiftsAdapter extends RecyclerView.Adapter<MergedGiftsAdapter.MergedGiftsViewHolder> {
......@@ -110,6 +112,37 @@ public class MergedGiftsAdapter extends RecyclerView.Adapter<MergedGiftsAdapter.
}
holder.tvMergedGiftsTitle.setText(ccms.getTitle());
if (mergedgiftsItem.getCampaign().getIsNew())
holder.ivIsNew.setVisibility(View.VISIBLE);
else
holder.ivIsNew.setVisibility(View.GONE);
holder.itemView.setOnClickListener(v -> onClickSubject.onNext(mergedgiftsItem));
return;
}
}
return;
}
if (extraFields.has("ccms_offer") && extraFields.optString("ccms_offer").equals("true")) {
for (LoyaltyContextualOfferModel ccms : WarplyManagerHelper.getCCMSLoyaltyCampaigns()) {
if (ccms.getLoyaltyCampaignId().equals(mergedgiftsItem.getCampaign().getSessionUUID()) && ccms.getZone().equals("COSMOTE_APP_GIFTS4U")) {
if (!TextUtils.isEmpty(ccms.getImageUrl())) {
Glide.with(mContext)
.load(ccms.getImageUrl())
.transform(new CenterCrop(), new RoundedCorners(4))
.diskCacheStrategy(DiskCacheStrategy.DATA)
.into(holder.ivMergedGiftsLogo);
} else {
Glide.with(mContext)
.load(R.drawable.ic_cosmote_logo_horizontal_grey)
.into(holder.ivMergedGiftsLogo);
}
holder.tvMergedGiftsTitle.setText(ccms.getTitle());
if (mergedgiftsItem.getCampaign().getIsNew())
holder.ivIsNew.setVisibility(View.VISIBLE);
else
holder.ivIsNew.setVisibility(View.GONE);
holder.itemView.setOnClickListener(v -> onClickSubject.onNext(mergedgiftsItem));
return;
}
......
......@@ -15,12 +15,17 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import org.json.JSONObject;
import java.util.ArrayList;
import io.reactivex.Observable;
import io.reactivex.subjects.PublishSubject;
import ly.warp.sdk.R;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
import ly.warp.sdk.utils.WarpJSONParser;
import ly.warp.sdk.utils.WarplyManagerHelper;
public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapter.MoreCampaignViewHolder> {
......@@ -86,6 +91,40 @@ public class MoreCampaignAdapter extends RecyclerView.Adapter<MoreCampaignAdapte
Campaign campaignItem = mCampaigns.get(position);
if (campaignItem != null) {
JSONObject extraFields = WarpJSONParser.getJSONFromString(campaignItem.getExtraFields());
if (extraFields != null) {
if (extraFields.has("ccms_offer") && extraFields.optString("ccms_offer").equals("true")) {
for (LoyaltyContextualOfferModel ccms : WarplyManagerHelper.getCCMSLoyaltyCampaigns()) {
if (ccms.getLoyaltyCampaignId().equals(campaignItem.getSessionUUID()) && ccms.getZone().equals("COSMOTE_APP_MORE4U")) {
if (!TextUtils.isEmpty(ccms.getImageUrl())) {
Glide.with(mContext)
.load(ccms.getImageUrl())
.transform(new CenterCrop(), new RoundedCorners(4))
.diskCacheStrategy(DiskCacheStrategy.DATA)
.into(holder.ivCampaignTitle);
} else {
Glide.with(mContext)
.load(R.drawable.ic_cosmote_logo_horizontal_grey)
.into(holder.ivCampaignTitle);
}
holder.tvCampaignTitle.setText(ccms.getTitle());
holder.tvCampaignSubtitle.setText(ccms.getSubtitle());
holder.tvCampaignMessage.setText(ccms.getMessage());
if (campaignItem.getIsNew())
holder.ivIsNew.setVisibility(View.VISIBLE);
else
holder.ivIsNew.setVisibility(View.GONE);
holder.itemView.setOnClickListener(v -> onClickSubject.onNext(campaignItem));
return;
}
}
return;
}
}
if (!TextUtils.isEmpty(campaignItem.getLogoUrl())) {
Glide.with(mContext)
.load(campaignItem.getLogoUrl())
......