Panagiotis Triantafyllou

possible fixes

......@@ -45,7 +45,7 @@ MerchantId=20113
# The login type must be one of the below:
# email, msisdn, username
LoginType=msisdn
LoginType=username
# The deeplink url scheme for react native campaigns:
# Example visit.greece.gr
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4-cosbeta25'
PUBLISH_VERSION = '4.5.4-cosbeta26'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -471,13 +471,13 @@ public enum Warply {
INSTANCE.getInboxInternal(new CallbackReceiver<CampaignList>() {
@Override
public void onSuccess(CampaignList result) {
WarplyManagerHelper.setUniqueCampaignList(result);
if (result.size() >= 0) {
objectSerializer.serialize(result, File.separator + requestSignature);
warplyPreferences.saveInboxLastCachedTimeStamp(requestSignature, System.currentTimeMillis());
INSTANCE.mLastReceivedCampaigns = result;
if (receiver != null) {
WarplyManagerHelper.setUniqueCampaignList(result);
receiver.onSuccess(result);
}
}
......
......@@ -31,6 +31,8 @@ import ly.warp.sdk.io.models.ActiveDFYCouponEventModel;
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.Couponset;
import ly.warp.sdk.io.models.CouponsetsList;
import ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
......@@ -68,7 +70,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
setContentView(R.layout.activity_loyalty_wallet);
mIvBack = findViewById(R.id.iv_back);
mTvUsername = findViewById(R.id.tv_name);
mTvUsername = findViewById(R.id.tv_profile_name);
mLlQuestionnaire = findViewById(R.id.ll_user_questionnaire);
mLlUserBadge = findViewById(R.id.ll_user_badge);
mTvUserBadge = findViewById(R.id.tv_type);
......@@ -162,7 +164,23 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener {
// ===========================================================
private void initViews() {
if (WarplyManagerHelper.getCouponList() != null) {
CouponList mCouponList = new CouponList();
CouponList mCouponListInitial = new CouponList();
mCouponListInitial.addAll(WarplyManagerHelper.getCouponList());
CouponsetsList mCouponsetListInitial = new CouponsetsList();
mCouponsetListInitial.addAll(WarplyManagerHelper.getCouponsets());
for (Coupon coupon : mCouponListInitial) {
for (Couponset couponset : mCouponsetListInitial) {
if (coupon.getCouponsetUuid().equals(couponset.getUuid())) {
coupon.setDescription(couponset.getShortDescription());
coupon.setImage(couponset.getImgPreview());
coupon.setName(couponset.getName());
mCouponList.add(coupon);
}
}
}
if (mCouponList != null) {
mAdapterCoupons = new ActiveCouponAdapter(this, WarplyManagerHelper.getCouponList());
mRecyclerCoupons.setAdapter(mAdapterCoupons);
mAdapterCoupons.getPositionClicks()
......
......@@ -244,7 +244,7 @@ public class WarplyDBHelper extends SQLiteOpenHelper {
public synchronized String getAuthValue(String columnName) {
String columnValue = "";
Cursor cursor = getDb().query(TABLE_AUTH, new String[]{columnName}, null, null, null, null, null);
if (cursor != null) {
if (cursor != null && cursor.moveToFirst()) {
cursor.moveToFirst();
columnValue = cursor.getString(cursor.getColumnIndex(columnName));
cursor.close();
......@@ -256,7 +256,7 @@ public class WarplyDBHelper extends SQLiteOpenHelper {
public synchronized String getClientValue(String columnName) {
String columnValue = "";
Cursor cursor = getDb().query(TABLE_CLIENT, new String[]{columnName}, null, null, null, null, null);
if (cursor != null) {
if (cursor != null && cursor.moveToFirst()) {
cursor.moveToFirst();
columnValue = cursor.getString(cursor.getColumnIndex(columnName));
cursor.close();
......
......@@ -46,10 +46,12 @@ public class PacingDetails {
private static final String STEPS = "steps";
private static final String METERS = "meters";
private static final String RESULT = "result";
private static final String ENABLED = "enabled";
/* Member variables of the Campaign object */
private PacingInner steps = new PacingInner();
private PacingInner meters = new PacingInner();
private boolean enabled = false;
/**
* Basic constructor used to create an object from a String, representing a
......@@ -78,6 +80,7 @@ public class PacingDetails {
if (result.optJSONObject(METERS) != null) {
this.meters = new PacingInner(result.optJSONObject(METERS));
}
this.enabled = result.optBoolean(ENABLED);
}
}
}
......@@ -92,6 +95,7 @@ public class PacingDetails {
try {
jObj.putOpt(STEPS, this.steps);
jObj.putOpt(METERS, this.meters);
jObj.putOpt(ENABLED, this.enabled);
} catch (JSONException e) {
if (WarpConstants.DEBUG) {
e.printStackTrace();
......
......@@ -402,6 +402,7 @@ public class WarplyManagerHelper {
* Set the List with CCMS Campaigns
*/
public static void setCCMSLoyaltyCampaigns(ArrayList<LoyaltyContextualOfferModel> list) {
mCCMSList.clear();
mCCMSList = list;
if (list == null || list.size() == 0) {
......
......@@ -104,7 +104,7 @@
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_name"
android:id="@+id/tv_profile_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="6dp"
......