Panagiotis Triantafyllou

session changes, small fixes

......@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
public void onWarplyReady() {
if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) {
WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest()
.setGuid("6005892749"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910
.setGuid("6010490808"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910
mLoginReceiver);
} else {
startNextActivity();
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4.6rc36'
PUBLISH_VERSION = '4.5.4.6rc37'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -298,6 +298,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis
SharingCoupon newShCoupon = new SharingCoupon();
newShCoupon = shCoupon;
newShCoupon.setName(cpnset.getName());
newShCoupon.setFinal_price(cpnset.getFinal_price());
mSharedCoupons.add(newShCoupon);
break;
}
......
/*
* 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 13-Jan-23.
*/
public class LoyaltySDKSessionExpiredEventModel {
private boolean sessionExpired;
public LoyaltySDKSessionExpiredEventModel() {
this.sessionExpired = true;
}
public boolean isLoyaltySessionExpired() {
return sessionExpired;
}
public void setLoyaltySessionExpired(boolean sessionExpired) {
this.sessionExpired = sessionExpired;
}
}
......@@ -53,6 +53,7 @@ public class SharingCoupon implements Parcelable, Serializable {
private static final String COUPONSET_UUID = "couponset_uuid";
private static final String NAME = "name";
private static final String MERCHANT_UUID = "merchant_uuid";
private static final String FINAL_PRICE = "final_price";
/* Member variables of the Campaign object */
......@@ -63,6 +64,7 @@ public class SharingCoupon implements Parcelable, Serializable {
private String couponsetUuid = "";
private String name = "";
private String merchantUuid = "";
private double final_price = 0.0d;
/**
* Basic constructor used to create an object from a String, representing a
......@@ -82,6 +84,7 @@ public class SharingCoupon implements Parcelable, Serializable {
this.date = "";
this.couponsetUuid = "";
this.name = "";
this.final_price = 0.0d;
}
/**
......@@ -98,6 +101,7 @@ public class SharingCoupon implements Parcelable, Serializable {
this.transactionMetadata = json.optString(TRANSACTION_METADATA);
this.name = json.optString(NAME);
this.merchantUuid = json.optString(MERCHANT_UUID);
this.final_price = json.optDouble(FINAL_PRICE);
}
}
......@@ -109,6 +113,7 @@ public class SharingCoupon implements Parcelable, Serializable {
this.transactionMetadata = source.readString();
this.name = source.readString();
this.merchantUuid = source.readString();
this.final_price = source.readDouble();
}
@Override
......@@ -120,6 +125,7 @@ public class SharingCoupon implements Parcelable, Serializable {
dest.writeString(this.transactionMetadata);
dest.writeString(this.name);
dest.writeString(this.merchantUuid);
dest.writeDouble(this.final_price);
}
/**
......@@ -137,6 +143,7 @@ public class SharingCoupon implements Parcelable, Serializable {
jObj.putOpt(TRANSACTION_METADATA, this.transactionMetadata);
jObj.putOpt(NAME, this.name);
jObj.putOpt(MERCHANT_UUID, this.merchantUuid);
jObj.putOpt(FINAL_PRICE, this.final_price);
} catch (JSONException e) {
if (WarpConstants.DEBUG) {
e.printStackTrace();
......@@ -232,6 +239,14 @@ public class SharingCoupon implements Parcelable, Serializable {
this.merchantUuid = merchantUuid;
}
public double getFinal_price() {
return final_price;
}
public void setFinal_price(double final_price) {
this.final_price = final_price;
}
@Override
public int describeContents() {
return 0;
......
......@@ -12,6 +12,7 @@ import ly.warp.sdk.io.models.LoyaltyEventModel;
import ly.warp.sdk.io.models.LoyaltyGiftsForYouOfferClickEvent;
import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel;
import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
import ly.warp.sdk.io.models.LoyaltySDKSessionExpiredEventModel;
import ly.warp.sdk.io.models.QuestionnaireEventModel;
import ly.warp.sdk.io.models.WarplyCCMSEnabledModel;
import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel;
......@@ -43,6 +44,7 @@ public class WarplyEventBusManager {
private HealthEventModel healthAdded;
private WarplyCouponsChangedEventModel couponsChanged;
private WarplyPacingCardEventModel widgetChanged;
private LoyaltySDKSessionExpiredEventModel sessionExpired;
public WarplyEventBusManager() {
......@@ -60,6 +62,10 @@ public class WarplyEventBusManager {
this.ccmsAdded = ccmsAdded;
}
public WarplyEventBusManager (LoyaltySDKSessionExpiredEventModel sessionExpired) {
this.sessionExpired = sessionExpired;
}
public WarplyEventBusManager(CouponsEventModel couponsAdded) {
this.couponsAdded = couponsAdded;
}
......@@ -217,4 +223,8 @@ public class WarplyEventBusManager {
public WarplyPacingCardEventModel getWidgetChanged() {
return widgetChanged;
}
public LoyaltySDKSessionExpiredEventModel isLoyaltySessionExpired() {
return sessionExpired;
}
}
......
......@@ -124,7 +124,8 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap
simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
holder.tvCouponDate.setText(simpleDateFormat.format(newDate != null ? newDate : ""));
holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro));
String itemValue = String.format("%.02f", couponItem.getFinal_price());
holder.tvCouponValue.setText(itemValue + mContext.getResources().getString(R.string.euro));
holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
}
}
......
......@@ -144,7 +144,8 @@ public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapte
}
}
holder.tvCouponValue.setText(couponItem.getDiscount() + mContext.getResources().getString(R.string.euro));
String itemValue = String.format("%.02f", couponItem.getFinal_price());
holder.tvCouponValue.setText(itemValue + mContext.getResources().getString(R.string.euro));
holder.itemView.setOnClickListener(v -> onClickSubject.onNext(couponItem));
}
}
......
......@@ -70,7 +70,7 @@
<string name="cos_popup_gifts_title">COSMOTE GIFTS FOR YOU</string>
<string name="cos_popup_gifts_subtitle">Σε αυτή την ενότητα βρίσκεις τα διαθέσιμα δώρα και επιβραβεύσεις αποκλειστικά για σένα!</string>
<string name="cos_mycoupon_date">Το κουπόνι ισχύει έως %1$s</string>
<string name="cos_gift_it">Kάνε δώρο</string>
<string name="cos_gift_it">Δώρισε το</string>
<string name="cos_popup_more_title">COSMOTE MORE FOR YOU</string>
<string name="cos_popup_more_subtitle">Σε αυτή την ενότητα βρες έρευνες, παιχνίδια, διαγωνισμούς και επιβραβεύσεις για τις αθλητικές σου δραστηριότητες!</string>
<string name="cos_deals_win_title">Μέχρι τώρα έχεις κερδίσει %1$s€ σε προσφορές από %2$s κουπόνια!</string>
......@@ -95,7 +95,7 @@
<string name="cos_shops">Δες τα καταστήματα</string>
<string name="cos_website">Δες το eshop</string>
<string name="cos_coupon_shops_title">Καταστήματα</string>
<string name="cos_coupon_gift">Kάνε δώρο</string>
<string name="cos_coupon_gift">Δώρισε το</string>
<string name="cos_coupon_share_gift_title">Επίλεξε το κινητό από το οποίο θα γίνει η αποστολή και συμπλήρωσε το COSMOTE κινητό που θα λάβει το δώρο.</string>
<string name="cos_coupon_share_sender">Αποστολέας</string>
<string name="cos_coupon_share_hint">Καταχώρηση τηλεφώνου</string>
......