Showing
8 changed files
with
31 additions
and
8 deletions
... | @@ -45,7 +45,7 @@ MerchantId=20113 | ... | @@ -45,7 +45,7 @@ MerchantId=20113 |
45 | 45 | ||
46 | # The login type must be one of the below: | 46 | # The login type must be one of the below: |
47 | # email, msisdn, username | 47 | # email, msisdn, username |
48 | -LoginType=msisdn | 48 | +LoginType=username |
49 | 49 | ||
50 | # The deeplink url scheme for react native campaigns: | 50 | # The deeplink url scheme for react native campaigns: |
51 | # Example visit.greece.gr | 51 | # Example visit.greece.gr | ... | ... |
... | @@ -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-cosbeta25' | 5 | + PUBLISH_VERSION = '4.5.4-cosbeta26' |
6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
7 | } | 7 | } |
8 | 8 | ... | ... |
... | @@ -471,13 +471,13 @@ public enum Warply { | ... | @@ -471,13 +471,13 @@ public enum Warply { |
471 | INSTANCE.getInboxInternal(new CallbackReceiver<CampaignList>() { | 471 | INSTANCE.getInboxInternal(new CallbackReceiver<CampaignList>() { |
472 | @Override | 472 | @Override |
473 | public void onSuccess(CampaignList result) { | 473 | public void onSuccess(CampaignList result) { |
474 | + WarplyManagerHelper.setUniqueCampaignList(result); | ||
474 | if (result.size() >= 0) { | 475 | if (result.size() >= 0) { |
475 | objectSerializer.serialize(result, File.separator + requestSignature); | 476 | objectSerializer.serialize(result, File.separator + requestSignature); |
476 | warplyPreferences.saveInboxLastCachedTimeStamp(requestSignature, System.currentTimeMillis()); | 477 | warplyPreferences.saveInboxLastCachedTimeStamp(requestSignature, System.currentTimeMillis()); |
477 | 478 | ||
478 | INSTANCE.mLastReceivedCampaigns = result; | 479 | INSTANCE.mLastReceivedCampaigns = result; |
479 | if (receiver != null) { | 480 | if (receiver != null) { |
480 | - WarplyManagerHelper.setUniqueCampaignList(result); | ||
481 | receiver.onSuccess(result); | 481 | receiver.onSuccess(result); |
482 | } | 482 | } |
483 | } | 483 | } | ... | ... |
... | @@ -31,6 +31,8 @@ import ly.warp.sdk.io.models.ActiveDFYCouponEventModel; | ... | @@ -31,6 +31,8 @@ import ly.warp.sdk.io.models.ActiveDFYCouponEventModel; |
31 | import ly.warp.sdk.io.models.ActiveDFYCouponModel; | 31 | import ly.warp.sdk.io.models.ActiveDFYCouponModel; |
32 | import ly.warp.sdk.io.models.Coupon; | 32 | import ly.warp.sdk.io.models.Coupon; |
33 | import ly.warp.sdk.io.models.CouponList; | 33 | import ly.warp.sdk.io.models.CouponList; |
34 | +import ly.warp.sdk.io.models.Couponset; | ||
35 | +import ly.warp.sdk.io.models.CouponsetsList; | ||
34 | import ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel; | 36 | import ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel; |
35 | import ly.warp.sdk.utils.WarplyManagerHelper; | 37 | import ly.warp.sdk.utils.WarplyManagerHelper; |
36 | import ly.warp.sdk.utils.managers.WarplyEventBusManager; | 38 | import ly.warp.sdk.utils.managers.WarplyEventBusManager; |
... | @@ -68,7 +70,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { | ... | @@ -68,7 +70,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { |
68 | setContentView(R.layout.activity_loyalty_wallet); | 70 | setContentView(R.layout.activity_loyalty_wallet); |
69 | 71 | ||
70 | mIvBack = findViewById(R.id.iv_back); | 72 | mIvBack = findViewById(R.id.iv_back); |
71 | - mTvUsername = findViewById(R.id.tv_name); | 73 | + mTvUsername = findViewById(R.id.tv_profile_name); |
72 | mLlQuestionnaire = findViewById(R.id.ll_user_questionnaire); | 74 | mLlQuestionnaire = findViewById(R.id.ll_user_questionnaire); |
73 | mLlUserBadge = findViewById(R.id.ll_user_badge); | 75 | mLlUserBadge = findViewById(R.id.ll_user_badge); |
74 | mTvUserBadge = findViewById(R.id.tv_type); | 76 | mTvUserBadge = findViewById(R.id.tv_type); |
... | @@ -162,7 +164,23 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { | ... | @@ -162,7 +164,23 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { |
162 | // =========================================================== | 164 | // =========================================================== |
163 | 165 | ||
164 | private void initViews() { | 166 | private void initViews() { |
165 | - if (WarplyManagerHelper.getCouponList() != null) { | 167 | + CouponList mCouponList = new CouponList(); |
168 | + CouponList mCouponListInitial = new CouponList(); | ||
169 | + mCouponListInitial.addAll(WarplyManagerHelper.getCouponList()); | ||
170 | + CouponsetsList mCouponsetListInitial = new CouponsetsList(); | ||
171 | + mCouponsetListInitial.addAll(WarplyManagerHelper.getCouponsets()); | ||
172 | + for (Coupon coupon : mCouponListInitial) { | ||
173 | + for (Couponset couponset : mCouponsetListInitial) { | ||
174 | + if (coupon.getCouponsetUuid().equals(couponset.getUuid())) { | ||
175 | + coupon.setDescription(couponset.getShortDescription()); | ||
176 | + coupon.setImage(couponset.getImgPreview()); | ||
177 | + coupon.setName(couponset.getName()); | ||
178 | + mCouponList.add(coupon); | ||
179 | + } | ||
180 | + } | ||
181 | + } | ||
182 | + | ||
183 | + if (mCouponList != null) { | ||
166 | mAdapterCoupons = new ActiveCouponAdapter(this, WarplyManagerHelper.getCouponList()); | 184 | mAdapterCoupons = new ActiveCouponAdapter(this, WarplyManagerHelper.getCouponList()); |
167 | mRecyclerCoupons.setAdapter(mAdapterCoupons); | 185 | mRecyclerCoupons.setAdapter(mAdapterCoupons); |
168 | mAdapterCoupons.getPositionClicks() | 186 | mAdapterCoupons.getPositionClicks() | ... | ... |
... | @@ -244,7 +244,7 @@ public class WarplyDBHelper extends SQLiteOpenHelper { | ... | @@ -244,7 +244,7 @@ public class WarplyDBHelper extends SQLiteOpenHelper { |
244 | public synchronized String getAuthValue(String columnName) { | 244 | public synchronized String getAuthValue(String columnName) { |
245 | String columnValue = ""; | 245 | String columnValue = ""; |
246 | Cursor cursor = getDb().query(TABLE_AUTH, new String[]{columnName}, null, null, null, null, null); | 246 | Cursor cursor = getDb().query(TABLE_AUTH, new String[]{columnName}, null, null, null, null, null); |
247 | - if (cursor != null) { | 247 | + if (cursor != null && cursor.moveToFirst()) { |
248 | cursor.moveToFirst(); | 248 | cursor.moveToFirst(); |
249 | columnValue = cursor.getString(cursor.getColumnIndex(columnName)); | 249 | columnValue = cursor.getString(cursor.getColumnIndex(columnName)); |
250 | cursor.close(); | 250 | cursor.close(); |
... | @@ -256,7 +256,7 @@ public class WarplyDBHelper extends SQLiteOpenHelper { | ... | @@ -256,7 +256,7 @@ public class WarplyDBHelper extends SQLiteOpenHelper { |
256 | public synchronized String getClientValue(String columnName) { | 256 | public synchronized String getClientValue(String columnName) { |
257 | String columnValue = ""; | 257 | String columnValue = ""; |
258 | Cursor cursor = getDb().query(TABLE_CLIENT, new String[]{columnName}, null, null, null, null, null); | 258 | Cursor cursor = getDb().query(TABLE_CLIENT, new String[]{columnName}, null, null, null, null, null); |
259 | - if (cursor != null) { | 259 | + if (cursor != null && cursor.moveToFirst()) { |
260 | cursor.moveToFirst(); | 260 | cursor.moveToFirst(); |
261 | columnValue = cursor.getString(cursor.getColumnIndex(columnName)); | 261 | columnValue = cursor.getString(cursor.getColumnIndex(columnName)); |
262 | cursor.close(); | 262 | cursor.close(); | ... | ... |
... | @@ -46,10 +46,12 @@ public class PacingDetails { | ... | @@ -46,10 +46,12 @@ public class PacingDetails { |
46 | private static final String STEPS = "steps"; | 46 | private static final String STEPS = "steps"; |
47 | private static final String METERS = "meters"; | 47 | private static final String METERS = "meters"; |
48 | private static final String RESULT = "result"; | 48 | private static final String RESULT = "result"; |
49 | + private static final String ENABLED = "enabled"; | ||
49 | 50 | ||
50 | /* Member variables of the Campaign object */ | 51 | /* Member variables of the Campaign object */ |
51 | private PacingInner steps = new PacingInner(); | 52 | private PacingInner steps = new PacingInner(); |
52 | private PacingInner meters = new PacingInner(); | 53 | private PacingInner meters = new PacingInner(); |
54 | + private boolean enabled = false; | ||
53 | 55 | ||
54 | /** | 56 | /** |
55 | * Basic constructor used to create an object from a String, representing a | 57 | * Basic constructor used to create an object from a String, representing a |
... | @@ -78,6 +80,7 @@ public class PacingDetails { | ... | @@ -78,6 +80,7 @@ public class PacingDetails { |
78 | if (result.optJSONObject(METERS) != null) { | 80 | if (result.optJSONObject(METERS) != null) { |
79 | this.meters = new PacingInner(result.optJSONObject(METERS)); | 81 | this.meters = new PacingInner(result.optJSONObject(METERS)); |
80 | } | 82 | } |
83 | + this.enabled = result.optBoolean(ENABLED); | ||
81 | } | 84 | } |
82 | } | 85 | } |
83 | } | 86 | } |
... | @@ -92,6 +95,7 @@ public class PacingDetails { | ... | @@ -92,6 +95,7 @@ public class PacingDetails { |
92 | try { | 95 | try { |
93 | jObj.putOpt(STEPS, this.steps); | 96 | jObj.putOpt(STEPS, this.steps); |
94 | jObj.putOpt(METERS, this.meters); | 97 | jObj.putOpt(METERS, this.meters); |
98 | + jObj.putOpt(ENABLED, this.enabled); | ||
95 | } catch (JSONException e) { | 99 | } catch (JSONException e) { |
96 | if (WarpConstants.DEBUG) { | 100 | if (WarpConstants.DEBUG) { |
97 | e.printStackTrace(); | 101 | e.printStackTrace(); | ... | ... |
... | @@ -402,6 +402,7 @@ public class WarplyManagerHelper { | ... | @@ -402,6 +402,7 @@ public class WarplyManagerHelper { |
402 | * Set the List with CCMS Campaigns | 402 | * Set the List with CCMS Campaigns |
403 | */ | 403 | */ |
404 | public static void setCCMSLoyaltyCampaigns(ArrayList<LoyaltyContextualOfferModel> list) { | 404 | public static void setCCMSLoyaltyCampaigns(ArrayList<LoyaltyContextualOfferModel> list) { |
405 | + mCCMSList.clear(); | ||
405 | mCCMSList = list; | 406 | mCCMSList = list; |
406 | 407 | ||
407 | if (list == null || list.size() == 0) { | 408 | if (list == null || list.size() == 0) { | ... | ... |
... | @@ -104,7 +104,7 @@ | ... | @@ -104,7 +104,7 @@ |
104 | app:layout_constraintTop_toTopOf="parent" /> | 104 | app:layout_constraintTop_toTopOf="parent" /> |
105 | 105 | ||
106 | <TextView | 106 | <TextView |
107 | - android:id="@+id/tv_name" | 107 | + android:id="@+id/tv_profile_name" |
108 | android:layout_width="wrap_content" | 108 | android:layout_width="wrap_content" |
109 | android:layout_height="wrap_content" | 109 | android:layout_height="wrap_content" |
110 | android:layout_marginVertical="6dp" | 110 | android:layout_marginVertical="6dp" | ... | ... |
-
Please register or login to post a comment