Panagiotis Triantafyllou

changes for ios also

Showing 22 changed files with 375 additions and 73 deletions
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4-cosbeta14'
PUBLISH_VERSION = '4.5.4-cosbeta15'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -4,7 +4,6 @@ import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
......@@ -121,7 +120,11 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
// mTvTerms.setPaintFlags(mTvTerms.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
mLlGiftIt.setOnClickListener(this);
createBarcodeBitmap(mCoupon.getCoupon());
String tempCoupon = mCoupon.getCoupon();
for (int i = 0; i < (12 - mCoupon.getCoupon().length()); i++) {
tempCoupon += "0";
}
createBarcodeBitmap(tempCoupon);
}
private void createBarcodeBitmap(String barcodeString) {
......
......@@ -224,7 +224,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
}
private ArrayList<MergedGifts> mergeDatasets(CampaignList campaignList, CouponsetsList couponsetsList) {
if (campaignList.size() > 0) {
if (campaignList != null && campaignList.size() > 0) {
for (Campaign campaign : campaignList) {
MergedGifts data = new MergedGifts();
data.setCampaign(campaign);
......@@ -234,7 +234,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene
}
}
if (couponsetsList.size() > 0) {
if (couponsetsList != null && couponsetsList.size() > 0) {
for (Couponset couponset : couponsetsList) {
MergedGifts data = new MergedGifts();
data.setCampaign(null);
......
......@@ -10,11 +10,27 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import org.greenrobot.eventbus.EventBus;
import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.concurrent.TimeUnit;
import ly.warp.sdk.R;
import ly.warp.sdk.io.models.ActiveDFYCouponModel;
import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
import ly.warp.sdk.views.adapters.ActiveCouponAdapter;
public class LoyaltyWallet extends Activity implements View.OnClickListener {
......@@ -28,11 +44,16 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
// ===========================================================
private ImageView mIvBack;
private TextView mTvUsername, mTvActiveCoupons,
mTvActiveRewards, mTvUserBadge;
private ConstraintLayout mClActiveCoupons, mClActiveRewards, mClActiveGifts;
private LinearLayout mLlAnalysisButton, mLlQuestionnaire, mLlUserBadge,
mLlPastCoupons;
private TextView mTvUsername, mTvDealsValue, mTvDealsValueAll,
mTvUserBadge, mTvGiftsValue, mTvGiftsValueAll, mTvActiveCode, mTvActiveDate;
private ConstraintLayout mClDealsBanner,
mClGiftsBanner;
private LinearLayout mLlQuestionnaire, mLlUserBadge;
float couponValue = 0.0f, couponDfyValue = 0.0f;
int couponCount = 0;
private RecyclerView mRecyclerCoupons;
private ActiveCouponAdapter mAdapterCoupons;
CouponList cpnlist = new CouponList();
// ===========================================================
// Methods for/from SuperClass/Interfaces
......@@ -44,13 +65,53 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
setContentView(R.layout.activity_loyalty_wallet);
mIvBack = findViewById(R.id.iv_back);
// mTvAnalysisButton = findViewById(R.id.rl_analysis_row).findViewById(R.id.cl_chart_info).findViewById(R.id.tv_analysis_details);
mTvUsername = findViewById(R.id.tv_name);
mLlQuestionnaire = findViewById(R.id.ll_user_questionnaire);
mLlUserBadge = findViewById(R.id.ll_user_badge);
mTvActiveRewards = findViewById(R.id.tv_active_deals_text);
mTvUserBadge = findViewById(R.id.tv_type);
mClActiveGifts = findViewById(R.id.cl_mygifts);
mTvGiftsValue = findViewById(R.id.tv_gifts_value);
mTvGiftsValueAll = findViewById(R.id.tv_gifts_value_all);
mClDealsBanner = findViewById(R.id.cl_deals_cos);
mClGiftsBanner = findViewById(R.id.cl_deals_win);
mTvDealsValue = findViewById(R.id.tv_deals_value);
mTvDealsValueAll = findViewById(R.id.tv_deals_value_all);
mTvActiveCode = findViewById(R.id.tv_active_deals_text);
mTvActiveDate = findViewById(R.id.tv_active_deals_date_text);
if (WarplyManagerHelper.getActiveDFYCoupons() != null) {
Collections.sort(WarplyManagerHelper.getActiveDFYCoupons(), new Comparator<ActiveDFYCouponModel>() {
public int compare(ActiveDFYCouponModel o1, ActiveDFYCouponModel o2) {
return o1.getDate().compareTo(o2.getDate());
}
});
for (ActiveDFYCouponModel dfycoupon : WarplyManagerHelper.getActiveDFYCoupons()) {
try {
couponDfyValue += Float.parseFloat(dfycoupon.getValue());
} catch (NumberFormatException e) {
}
}
}
if (WarplyManagerHelper.getCouponList() != null) {
for (Coupon coupon : WarplyManagerHelper.getCouponList()) {
if (coupon.getStatus() == 1) {
try {
cpnlist.add(coupon);
couponCount += 1;
couponValue += Float.parseFloat(coupon.getDiscount());
} catch (NumberFormatException e) {
cpnlist.remove(coupon);
couponCount -= 1;
}
}
}
mRecyclerCoupons = findViewById(R.id.rv_active_coupons);
mRecyclerCoupons.setNestedScrollingEnabled(false);
mRecyclerCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
}
initViews();
}
......@@ -70,9 +131,14 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
startActivity(WarpViewActivity.createIntentFromURL(LoyaltyWallet.this, WarplyManagerHelper.openQuestionnaire()));
return;
}
if (view.getId() == R.id.cl_mygifts) {
Intent intent = new Intent(LoyaltyWallet.this, ActiveGiftsActivity.class);
startActivity(intent);
if (view.getId() == R.id.cl_deals_cos) {
WarplyDealsAnalysisEventModel warplyDealsAnalysisEventModel = new WarplyDealsAnalysisEventModel();
warplyDealsAnalysisEventModel.setPressed(true);
EventBus.getDefault().post(new WarplyEventBusManager(warplyDealsAnalysisEventModel));
return;
}
if (view.getId() == R.id.cl_deals_win) {
}
}
......@@ -81,10 +147,37 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
// ===========================================================
private void initViews() {
CouponList cpnlist = new CouponList();
for (Coupon cpn : WarplyManagerHelper.getCouponList()) {
if (cpn.getStatus() == 1)
cpnlist.add(cpn);
mAdapterCoupons = new ActiveCouponAdapter(this, cpnlist);
mRecyclerCoupons.setAdapter(mAdapterCoupons);
mAdapterCoupons.getPositionClicks()
.doOnNext(coupon -> {
Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
startActivity(intent);
})
.doOnError(error -> {
})
.subscribe();
mTvGiftsValue.setText(String.format(getString(R.string.cos_value), String.valueOf(couponValue)));
mTvGiftsValueAll.setText(String.format(getString(R.string.cos_deals_win_title), String.valueOf(couponValue), String.valueOf(couponCount)));
mTvDealsValue.setText(String.format(getString(R.string.cos_value), String.valueOf(couponDfyValue)));
mTvDealsValueAll.setText(String.format(getString(R.string.cos_deals_win_title_cos), String.valueOf(couponDfyValue)));
if (WarplyManagerHelper.getActiveDFYCoupons() != null && WarplyManagerHelper.getActiveDFYCoupons().size() > 0) {
mTvActiveCode.setText(WarplyManagerHelper.getActiveDFYCoupons().get(0).getCode());
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
String date1 = WarplyManagerHelper.getActiveDFYCoupons().get(0).getDate();
String date2 = dateFormat.format(new Date());
try {
Date toDate = dateFormat.parse(date2);
Date fromDate = dateFormat.parse(date1);
long diff = TimeUnit.MILLISECONDS.toDays(fromDate.getTime() - toDate.getTime());
mTvActiveDate.setText(String.format(getString(R.string.cos_active_coupon_date), String.valueOf(diff)));
} catch (ParseException e) {
e.printStackTrace();
}
}
if (WarplyManagerHelper.getConsumer() != null) {
......@@ -102,12 +195,10 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
}
mIvBack.setOnClickListener(this);
// mTvAnalysisButton.setOnClickListener(this);
mLlQuestionnaire.setOnClickListener(this);
//TODO: change the parameter, for testing purposes only
mTvActiveRewards.setText(String.format(getResources().getString(R.string.cos_active_rewards), String.valueOf(cpnlist.size())));
mClActiveGifts.setOnClickListener(this);
mLlUserBadge.setOnClickListener(this);
mClDealsBanner.setOnClickListener(this);
mClGiftsBanner.setOnClickListener(this);
}
// ===========================================================
......
......@@ -127,6 +127,8 @@ public class WarpViewActivity extends WarpBaseActivity {
EventBus.getDefault().unregister(this);
if (event.getQuestionnaire() != null)
EventBus.getDefault().post(new WarplyEventBusManager(event.getQuestionnaire()));
if (event.getCoupon() != null)
EventBus.getDefault().post(new WarplyEventBusManager(event.getCoupon()));
finish();
}
......
/*
* Copyright 2010-2013 Warply Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package ly.warp.sdk.io.models;
/**
* Created by Panagiotis Triantafyllou on 22-June-22.
*/
public class ActiveDFYCouponModel {
private String value;
private String date;
private String code;
public ActiveDFYCouponModel() {
this.value = "";
this.date = "";
this.code = "";
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
/*
* Copyright 2010-2013 Warply Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package ly.warp.sdk.io.models;
/**
* Created by Panagiotis Triantafyllou on 21-June-22.
*/
public class CouponEventModel {
private boolean success;
public CouponEventModel() {
this.success = false;
}
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
}
package ly.warp.sdk.io.models;
/**
* Created by Panagiotis Triantafyllou on 22/Ιουν/2022.
*/
public class LoyaltyGiftsForYouPackage {
private String title;
private String imageUrl;
private String loyaltyPackageId;
public LoyaltyGiftsForYouPackage() {
this.title = "";
this.imageUrl = "";
this.loyaltyPackageId = "";
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public String getLoyaltyPackageId() {
return loyaltyPackageId;
}
public void setLoyaltyPackageId(String loyaltyPackageId) {
this.loyaltyPackageId = loyaltyPackageId;
}
}
......@@ -12,7 +12,6 @@ import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.HashMap;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.constants.WarpConstants;
/**
......@@ -29,6 +28,8 @@ public class WarplyIntegrationRequest {
private final String KEY_ACTION = "action";
private final String KEY_ACTION_VALUE = "integration";
private final String KEY_DATA = "data";
private final String KEY_METHOD = "method";
private final String KEY_METHOD_VALUE = "consumer_extra_data";
// ===========================================================
// Fields
......@@ -143,12 +144,16 @@ public class WarplyIntegrationRequest {
try {
JSONObject extraJson = new JSONObject();
extraJson.putOpt(KEY_ACTION, KEY_ACTION_VALUE);
extraJson.putOpt(KEY_METHOD, KEY_METHOD_VALUE);
ArrayList list = new ArrayList();
list.add("6982853746");
list.add("6982853747");
list.add("6982853748");
JSONObject data = new JSONObject();
data.putOpt("nonTelco", WarplyManagerHelper.loadCustomerState().isNonTelco());
data.putOpt("acceptedConsent", WarplyManagerHelper.loadCustomerState().isAcceptedConsent());
data.putOpt("msisdnList", new JSONArray(WarplyManagerHelper.loadCustomerState().getMsisdnList()));
data.putOpt("guid", WarplyManagerHelper.loadCustomerState().getGuid());
data.putOpt("nonTelco", false);
data.putOpt("acceptedConsent", true);
data.putOpt("msisdnList", new JSONArray(list));
data.putOpt("guid", "12345678");
extraJson.putOpt(KEY_DATA, data);
bodyJsonObject.putOpt(KEY_MAPP, extraJson);
......
......@@ -25,11 +25,16 @@
package ly.warp.sdk.utils;
import android.util.Log;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import ly.warp.sdk.Warply;
import ly.warp.sdk.db.WarplyDBHelper;
import ly.warp.sdk.io.models.ActiveDFYCouponModel;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.CampaignList;
import ly.warp.sdk.io.models.Consumer;
......@@ -37,6 +42,7 @@ import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.io.models.CouponsetsList;
import ly.warp.sdk.io.models.CustomerStateModel;
import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
import ly.warp.sdk.io.models.LoyaltyGiftsForYouPackage;
/**
* Created by Panagiotis Triantafyllou on 18-Apr-22.
......@@ -58,6 +64,9 @@ public class WarplyManagerHelper {
private static CouponsetsList mCouponsetsList = new CouponsetsList();
private static CustomerStateModel mCustomerStateModel;
private static CampaignList mCampaignList;
private static ArrayList<ActiveDFYCouponModel> mDfyCoupons = new ArrayList();
private static ArrayList<LoyaltyGiftsForYouPackage> mSeasonalList = new ArrayList<>();
private static ArrayList<LoyaltyContextualOfferModel> mCCMSList = new ArrayList<>();
// ===========================================================
// Methods for/from SuperClass/Interfaces
......@@ -93,26 +102,26 @@ public class WarplyManagerHelper {
/**
* Open Warply campaign with sharing id
*/
public static String constructCampaignUrlForShare(String sessionUuid, String sharingId) {
if (getCampaignList() != null) {
for (Campaign item : getCampaignList()) {
if (item.getSessionUUID().equals(sessionUuid)) {
String url = item.getIndexUrl()
+ "?web_id=" + WarpUtils.getWebId(Warply.getWarplyContext())
+ "&app_uuid=" + WarplyProperty.getAppUuid(Warply.getWarplyContext())
+ "&api_key=" + WarpUtils.getApiKey(Warply.getWarplyContext())
+ "&session_uuid=" + item.getSessionUUID()
+ "&access_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token")
+ "&refresh_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token")
+ "&client_id=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id")
+ "&client_secret=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret")
+ "&sharing_id=" + sharingId;
return url;
}
}
}
return "";
public static void constructCampaignUrlForShare(String sharingId) {
// if (getCampaignList() != null) {
// for (Campaign item : getCampaignList()) {
// if (item.getSessionUUID().equals(sessionUuid)) {
// String url = item.getIndexUrl()
// + "?web_id=" + WarpUtils.getWebId(Warply.getWarplyContext())
// + "&app_uuid=" + WarplyProperty.getAppUuid(Warply.getWarplyContext())
// + "&api_key=" + WarpUtils.getApiKey(Warply.getWarplyContext())
// + "&session_uuid=" + item.getSessionUUID()
// + "&access_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token")
// + "&refresh_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token")
// + "&client_id=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id")
// + "&client_secret=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret")
// + "&sharing_id=" + sharingId;
// return url;
// }
// }
// }
//
// return "";
}
/**
......@@ -122,14 +131,39 @@ public class WarplyManagerHelper {
return /*url*/ "";
}
// public static CampaignList mergeCCMS(ArrayList<LoyaltyContextualOfferModel> ccmslist, CampaignList clist) {
// CampaignList mergedList = clist;
// for (LoyaltyContextualOfferModel element : ccmslist) {
//
// }
//
// return mergedList;
// }
private void mergeCCMS() {
}
/**
* Set the List with CCMS Campaigns
*/
public static void setCCMSLoyaltyCampaigns(ArrayList<LoyaltyContextualOfferModel> list) {
mCCMSList = list;
if (mUniqueCampaignList != null && mUniqueCampaignList.get("gifts_for_you") != null && mUniqueCampaignList.get("gifts_for_you").size() > 0) {
for (Campaign camp : mUniqueCampaignList.get("gifts_for_you")) {
try {
String te2 = WarpJSONParser.getJSONFromString(camp.getExtraFields()).keys().next();
} catch (Exception exception) {
Log.v("WarplyManagerHelper_CCMS", exception.toString());
}
}
}
}
/**
* Save the LoyaltyGiftsForYouPackage list
*/
public static void setSeasonalList(ArrayList<LoyaltyGiftsForYouPackage> seasonalCoupons) {
mSeasonalList = seasonalCoupons;
}
/**
* Get the LoyaltyGiftsForYouPackage list
*/
public static ArrayList<LoyaltyGiftsForYouPackage> getSeasonalList() {
return mSeasonalList;
}
/**
* Open Questionnaire
......@@ -172,22 +206,15 @@ public class WarplyManagerHelper {
/**
* Set the List with active D4Y coupons
*/
public static void setActiveDFYCoupons(ArrayList<String> codes) {
public static void setActiveDFYCoupons(ArrayList<ActiveDFYCouponModel> dfyCoupons) {
mDfyCoupons = dfyCoupons;
}
/**
* Get the List with active D4Y coupons
*/
public static ArrayList<String> getActiveDFYCoupons() {
return new ArrayList<>();
}
/**
* Set the List with CCMS Campaigns
*/
public static void setCCMSLoyaltyCampaigns(ArrayList<LoyaltyContextualOfferModel> list) {
//TODO: create
public static ArrayList<ActiveDFYCouponModel> getActiveDFYCoupons() {
return mDfyCoupons;
}
public static Consumer getConsumer() {
......
......@@ -2,6 +2,7 @@ package ly.warp.sdk.utils.managers;
import java.util.HashMap;
import ly.warp.sdk.io.models.CouponEventModel;
import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
import ly.warp.sdk.io.models.LoyaltyGiftsForYouOfferClickEvent;
import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
......@@ -25,6 +26,7 @@ public class WarplyEventBusManager {
private WarplyCCMSEnabledModel ccmsActivated;
private LoyaltyGiftsForYouOfferClickEvent giftsYou;
private QuestionnaireEventModel questionnaire;
private CouponEventModel coupon;
public WarplyEventBusManager() {
......@@ -38,6 +40,10 @@ public class WarplyEventBusManager {
this.questionnaire = questionnaire;
}
public WarplyEventBusManager(CouponEventModel coupon) {
this.coupon = coupon;
}
public WarplyEventBusManager(LoyaltySDKFirebaseEventModel fireEvent) {
this.fireEvent = fireEvent;
}
......@@ -127,4 +133,8 @@ public class WarplyEventBusManager {
public QuestionnaireEventModel getQuestionnaire() {
return questionnaire;
}
public CouponEventModel getCoupon() {
return coupon;
}
}
......
......@@ -62,6 +62,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import ly.warp.sdk.Warply;
import ly.warp.sdk.io.models.CouponEventModel;
import ly.warp.sdk.io.models.QuestionnaireEventModel;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyProperty;
......@@ -382,6 +383,10 @@ public class WarpView extends WebView {
questionnaireEvent.setParameter(parts[2]);
WarpUtils.setUserTag(Warply.getWarplyContext(), parts[2]);
EventBus.getDefault().post(new WarplyEventBusManager(questionnaireEvent));
} else if (parts[1].equals("event:couponRetrieved")) {
CouponEventModel couponEvent = new CouponEventModel();
couponEvent.setSuccess(true);
EventBus.getDefault().post(new WarplyEventBusManager(couponEvent));
}
}
}
......
......@@ -6,5 +6,5 @@
android:endColor="@color/cos_skyblue"
android:type="linear"/>
<corners
android:radius="12dp"/>
android:radius="7dp"/>
</shape>
\ No newline at end of file
......
......@@ -95,9 +95,10 @@
android:layout_height="match_parent"
android:layout_below="@+id/ll_more_popup"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="48dp"
android:layout_marginTop="4dp"
android:clipToPadding="false"
android:orientation="vertical"
android:paddingTop="44dp"
android:paddingBottom="24dp" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
......
......@@ -11,7 +11,7 @@
<string name="cos_profile_type">Traveller</string>
<string name="header_add">Προσθήκη</string>
<string name="cos_profile_reward">My Loyalty\nWallet</string>
<string name="cos_profile_title">My loyalty wallet</string>
<string name="cos_profile_title">For You</string>
<string name="cos_deals_title">Deals for You</string>
<string name="cos_profile_more">Δες περισσότερα</string>
<string name="cos_gifts_title">GIFTS for YOU</string>
......@@ -67,12 +67,14 @@
<string name="cos_gift_it">Κάντο δώρο!</string>
<string name="cos_popup_more_title">COSMOTE MORE FOR YOU</string>
<string name="cos_popup_more_subtitle">Εδώ μπορείς να βρεις διαγωνισμούς και\nνα σε επιβραβεύσουμε για τις αθλητικές σου\nδραστηριότητες!</string>
<string name="cos_deals_win_title">Μέχρι τώρα έχεις κερδίσει 30 κουπόνια\nκαι 20,00€ σε προσφορές!</string>
<string name="cos_deals_win_title">Μέχρι τώρα έχεις κερδίσει %1$s€ σε προσφορές από %2$s κουπόνια!</string>
<string name="cos_deals_win_title_cos">Μέχρι τώρα έχεις κερδίσει %1$s€ με το DEALS for YOU!</string>
<string name="cos_mygifts">Τα δώρα μου</string>
<string name="cos_gifts_banner_title">Δώρα:</string>
<string name="cos_see_more">Δες περισσότερα</string>
<string name="cos_active_gifts_title">Ενεργά δώρα</string>
<string name="cos_loyalty_analysis">Ανάλυση συναλλαγών</string>
<string name="cos_value">%1$s€</string>
<string-array name="coupons_array">
<item>Κουπόνια</item>
......