Showing
12 changed files
with
169 additions
and
22 deletions
... | @@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity { | ... | @@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity { |
36 | public void onWarplyReady() { | 36 | public void onWarplyReady() { |
37 | if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) { | 37 | if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) { |
38 | WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest() | 38 | WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest() |
39 | - .setGuid("6012049321"), //6012049321, 6012049322, 6012049323 | 39 | + .setGuid("7000000826"), //6012049321, 6012049322, 6012049323, 7000000831 history |
40 | mLoginReceiver); | 40 | mLoginReceiver); |
41 | } else { | 41 | } else { |
42 | startNextActivity(); | 42 | startNextActivity(); | ... | ... |
... | @@ -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-cosbeta62' | 5 | + PUBLISH_VERSION = '4.5.4-cosbeta63' |
6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
7 | } | 7 | } |
8 | 8 | ... | ... |
... | @@ -124,6 +124,8 @@ public class ContextualActivity extends Activity implements View.OnClickListener | ... | @@ -124,6 +124,8 @@ public class ContextualActivity extends Activity implements View.OnClickListener |
124 | private void showActivationDialog() { | 124 | private void showActivationDialog() { |
125 | final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this); | 125 | final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this); |
126 | bottomSheetDialog.setContentView(R.layout.dl_share); | 126 | bottomSheetDialog.setContentView(R.layout.dl_share); |
127 | + TextView tvHeader = bottomSheetDialog.findViewById(R.id.tv_sender_value); | ||
128 | + tvHeader.setText(R.string.cos_coupon_share_telco); | ||
127 | LinearLayout parent = bottomSheetDialog.findViewById(R.id.ll_share_dialog_view_inner); | 129 | LinearLayout parent = bottomSheetDialog.findViewById(R.id.ll_share_dialog_view_inner); |
128 | 130 | ||
129 | ImageView dialogClose = (ImageView) bottomSheetDialog.findViewById(R.id.iv_sender_list_close); | 131 | ImageView dialogClose = (ImageView) bottomSheetDialog.findViewById(R.id.iv_sender_list_close); |
... | @@ -169,6 +171,7 @@ public class ContextualActivity extends Activity implements View.OnClickListener | ... | @@ -169,6 +171,7 @@ public class ContextualActivity extends Activity implements View.OnClickListener |
169 | .setUserMsisdn(mSender) | 171 | .setUserMsisdn(mSender) |
170 | .setSessionId(mCCMS.getSessionId()) | 172 | .setSessionId(mCCMS.getSessionId()) |
171 | .setBusinessService(mCCMS.getBusinessService()) | 173 | .setBusinessService(mCCMS.getBusinessService()) |
174 | + .setNotificationMessage(mCCMS.getNotificationMessage()) | ||
172 | .setOfferName(mCCMS.getOfferName()) | 175 | .setOfferName(mCCMS.getOfferName()) |
173 | .setProductType(mCCMS.getProductType()) | 176 | .setProductType(mCCMS.getProductType()) |
174 | .setProvDuration(mCCMS.getProvDuration()) | 177 | .setProvDuration(mCCMS.getProvDuration()) | ... | ... |
... | @@ -280,6 +280,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene | ... | @@ -280,6 +280,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene |
280 | seasonalCLick.setTitle(dataItem.getSeasonalList().getTitle()); | 280 | seasonalCLick.setTitle(dataItem.getSeasonalList().getTitle()); |
281 | seasonalCLick.setLoyaltyPackageId(dataItem.getSeasonalList().getLoyaltyPackageId()); | 281 | seasonalCLick.setLoyaltyPackageId(dataItem.getSeasonalList().getLoyaltyPackageId()); |
282 | seasonalCLick.setImageUrl(dataItem.getSeasonalList().getImageUrl()); | 282 | seasonalCLick.setImageUrl(dataItem.getSeasonalList().getImageUrl()); |
283 | + seasonalCLick.setContext(GiftsForYouActivity.this); | ||
283 | EventBus.getDefault().post(new WarplyEventBusManager(seasonalCLick)); | 284 | EventBus.getDefault().post(new WarplyEventBusManager(seasonalCLick)); |
284 | } else if (dataItem.getDataType() == 3) { | 285 | } else if (dataItem.getDataType() == 3) { |
285 | Intent intent = new Intent(GiftsForYouActivity.this, ContextualActivity.class); | 286 | Intent intent = new Intent(GiftsForYouActivity.this, ContextualActivity.class); |
... | @@ -414,6 +415,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene | ... | @@ -414,6 +415,7 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene |
414 | seasonalCLick.setTitle(dataItem.getSeasonalList().getTitle()); | 415 | seasonalCLick.setTitle(dataItem.getSeasonalList().getTitle()); |
415 | seasonalCLick.setLoyaltyPackageId(dataItem.getSeasonalList().getLoyaltyPackageId()); | 416 | seasonalCLick.setLoyaltyPackageId(dataItem.getSeasonalList().getLoyaltyPackageId()); |
416 | seasonalCLick.setImageUrl(dataItem.getSeasonalList().getImageUrl()); | 417 | seasonalCLick.setImageUrl(dataItem.getSeasonalList().getImageUrl()); |
418 | + seasonalCLick.setContext(GiftsForYouActivity.this); | ||
417 | EventBus.getDefault().post(new WarplyEventBusManager(seasonalCLick)); | 419 | EventBus.getDefault().post(new WarplyEventBusManager(seasonalCLick)); |
418 | } else if (dataItem.getDataType() == 3) { | 420 | } else if (dataItem.getDataType() == 3) { |
419 | Intent intent = new Intent(GiftsForYouActivity.this, ContextualActivity.class); | 421 | Intent intent = new Intent(GiftsForYouActivity.this, ContextualActivity.class); | ... | ... |
... | @@ -16,11 +16,15 @@ import androidx.core.content.ContextCompat; | ... | @@ -16,11 +16,15 @@ import androidx.core.content.ContextCompat; |
16 | import androidx.recyclerview.widget.LinearLayoutManager; | 16 | import androidx.recyclerview.widget.LinearLayoutManager; |
17 | import androidx.recyclerview.widget.RecyclerView; | 17 | import androidx.recyclerview.widget.RecyclerView; |
18 | 18 | ||
19 | +import java.util.ArrayList; | ||
20 | + | ||
19 | import io.github.inflationx.calligraphy3.CalligraphyTypefaceSpan; | 21 | import io.github.inflationx.calligraphy3.CalligraphyTypefaceSpan; |
20 | import io.github.inflationx.calligraphy3.TypefaceUtils; | 22 | import io.github.inflationx.calligraphy3.TypefaceUtils; |
21 | import io.github.inflationx.viewpump.ViewPumpContextWrapper; | 23 | import io.github.inflationx.viewpump.ViewPumpContextWrapper; |
22 | import ly.warp.sdk.R; | 24 | import ly.warp.sdk.R; |
23 | import ly.warp.sdk.io.callbacks.CallbackReceiver; | 25 | import ly.warp.sdk.io.callbacks.CallbackReceiver; |
26 | +import ly.warp.sdk.io.models.Coupon; | ||
27 | +import ly.warp.sdk.io.models.CouponList; | ||
24 | import ly.warp.sdk.io.models.Couponset; | 28 | import ly.warp.sdk.io.models.Couponset; |
25 | import ly.warp.sdk.io.models.SharingCoupon; | 29 | import ly.warp.sdk.io.models.SharingCoupon; |
26 | import ly.warp.sdk.io.models.SharingList; | 30 | import ly.warp.sdk.io.models.SharingList; |
... | @@ -47,7 +51,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis | ... | @@ -47,7 +51,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis |
47 | private RecyclerView mRvExpiredCoupons, mRvSharedCoupons; | 51 | private RecyclerView mRvExpiredCoupons, mRvSharedCoupons; |
48 | private ExpiredCouponAdapter mAdapterExpiredCoupons; | 52 | private ExpiredCouponAdapter mAdapterExpiredCoupons; |
49 | private SharedCouponAdapter mAdapterSharedCoupons; | 53 | private SharedCouponAdapter mAdapterSharedCoupons; |
50 | - private LinearLayout mLlExpiredTab, mLlSharedTab; | 54 | + private LinearLayout mLlExpiredTab, mLlSharedTab, mLlShowMoreExpired, mLlShowMoreShared; |
51 | private RelativeLayout mRlExpiredView, mRlSharedView; | 55 | private RelativeLayout mRlExpiredView, mRlSharedView; |
52 | private SharingList mSharedCoupons = new SharingList(); | 56 | private SharingList mSharedCoupons = new SharingList(); |
53 | 57 | ||
... | @@ -70,6 +74,8 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis | ... | @@ -70,6 +74,8 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis |
70 | mRvSharedCoupons = findViewById(R.id.rv_shared_coupons); | 74 | mRvSharedCoupons = findViewById(R.id.rv_shared_coupons); |
71 | mTvSharedEmpty = findViewById(R.id.tv_shared_empty); | 75 | mTvSharedEmpty = findViewById(R.id.tv_shared_empty); |
72 | mTvExpiredEmpty = findViewById(R.id.tv_expired_empty); | 76 | mTvExpiredEmpty = findViewById(R.id.tv_expired_empty); |
77 | + mLlShowMoreExpired = findViewById(R.id.ll_show_more_expired); | ||
78 | + mLlShowMoreShared = findViewById(R.id.ll_show_more_shared); | ||
73 | 79 | ||
74 | initViews(); | 80 | initViews(); |
75 | } | 81 | } |
... | @@ -138,6 +144,20 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis | ... | @@ -138,6 +144,20 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis |
138 | 144 | ||
139 | mRlExpiredView.setVisibility(View.GONE); | 145 | mRlExpiredView.setVisibility(View.GONE); |
140 | mRlSharedView.setVisibility(View.VISIBLE); | 146 | mRlSharedView.setVisibility(View.VISIBLE); |
147 | + return; | ||
148 | + } | ||
149 | + if (view.getId() == R.id.ll_show_more_expired) { | ||
150 | + mLlShowMoreExpired.setVisibility(View.GONE); | ||
151 | + mAdapterExpiredCoupons = new ExpiredCouponAdapter(this, WarplyManagerHelper.getCouponExpiredList()); | ||
152 | + mRvExpiredCoupons.setAdapter(mAdapterExpiredCoupons); | ||
153 | + mAdapterExpiredCoupons.notifyDataSetChanged(); | ||
154 | + return; | ||
155 | + } | ||
156 | + if (view.getId() == R.id.ll_show_more_shared) { | ||
157 | + mLlShowMoreShared.setVisibility(View.GONE); | ||
158 | + mAdapterSharedCoupons = new SharedCouponAdapter(LoyaltyAnalysisActivity.this, mSharedCoupons); | ||
159 | + mRvSharedCoupons.setAdapter(mAdapterSharedCoupons); | ||
160 | + mAdapterSharedCoupons.notifyDataSetChanged(); | ||
141 | } | 161 | } |
142 | } | 162 | } |
143 | 163 | ||
... | @@ -154,6 +174,8 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis | ... | @@ -154,6 +174,8 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis |
154 | mIvBack.setOnClickListener(this); | 174 | mIvBack.setOnClickListener(this); |
155 | mLlExpiredTab.setOnClickListener(this); | 175 | mLlExpiredTab.setOnClickListener(this); |
156 | mLlSharedTab.setOnClickListener(this); | 176 | mLlSharedTab.setOnClickListener(this); |
177 | + mLlShowMoreExpired.setOnClickListener(this); | ||
178 | + mLlShowMoreShared.setOnClickListener(this); | ||
157 | 179 | ||
158 | mLlExpiredTab.setBackgroundResource(R.drawable.bottom_border_gradient2); | 180 | mLlExpiredTab.setBackgroundResource(R.drawable.bottom_border_gradient2); |
159 | TextView expiredTab = findViewById(R.id.tv_expired_tab); | 181 | TextView expiredTab = findViewById(R.id.tv_expired_tab); |
... | @@ -195,18 +217,19 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis | ... | @@ -195,18 +217,19 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis |
195 | mTvCouponsValueAll.setText(sBuilder, TextView.BufferType.SPANNABLE); | 217 | mTvCouponsValueAll.setText(sBuilder, TextView.BufferType.SPANNABLE); |
196 | 218 | ||
197 | if (WarplyManagerHelper.getCouponExpiredList() != null && WarplyManagerHelper.getCouponExpiredList().size() > 0) { | 219 | if (WarplyManagerHelper.getCouponExpiredList() != null && WarplyManagerHelper.getCouponExpiredList().size() > 0) { |
220 | + if (WarplyManagerHelper.getCouponExpiredList().size() >= 3) { | ||
221 | + ArrayList<Coupon> tempList = new ArrayList<>(WarplyManagerHelper.getCouponExpiredList().subList(0, 3)); | ||
222 | + | ||
223 | + mRvExpiredCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); | ||
224 | + mAdapterExpiredCoupons = new ExpiredCouponAdapter(this, tempList); | ||
225 | + mRvExpiredCoupons.setAdapter(mAdapterExpiredCoupons); | ||
226 | + mLlShowMoreExpired.setVisibility(View.VISIBLE); | ||
227 | + return; | ||
228 | + } | ||
229 | + | ||
198 | mRvExpiredCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); | 230 | mRvExpiredCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); |
199 | mAdapterExpiredCoupons = new ExpiredCouponAdapter(this, WarplyManagerHelper.getCouponExpiredList()); | 231 | mAdapterExpiredCoupons = new ExpiredCouponAdapter(this, WarplyManagerHelper.getCouponExpiredList()); |
200 | mRvExpiredCoupons.setAdapter(mAdapterExpiredCoupons); | 232 | mRvExpiredCoupons.setAdapter(mAdapterExpiredCoupons); |
201 | -// mAdapterCoupons.getPositionClicks() | ||
202 | -// .doOnNext(coupon -> { | ||
203 | -// Intent intent = new Intent(ActiveCouponsActivity.this, CouponInfoActivity.class); | ||
204 | -// intent.putExtra("coupon", (Serializable) coupon); | ||
205 | -// startActivity(intent); | ||
206 | -// }) | ||
207 | -// .doOnError(error -> { | ||
208 | -// }) | ||
209 | -// .subscribe(); | ||
210 | } else { | 233 | } else { |
211 | mTvExpiredEmpty.setVisibility(View.VISIBLE); | 234 | mTvExpiredEmpty.setVisibility(View.VISIBLE); |
212 | } | 235 | } |
... | @@ -237,6 +260,16 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis | ... | @@ -237,6 +260,16 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis |
237 | 260 | ||
238 | runOnUiThread(() -> { | 261 | runOnUiThread(() -> { |
239 | if (mSharedCoupons != null && mSharedCoupons.size() > 0) { | 262 | if (mSharedCoupons != null && mSharedCoupons.size() > 0) { |
263 | + if (mSharedCoupons.size() >= 3) { | ||
264 | + ArrayList<SharingCoupon> tempList = new ArrayList<>(mSharedCoupons.subList(0, 3)); | ||
265 | + | ||
266 | + mRvSharedCoupons.setLayoutManager(new LinearLayoutManager(LoyaltyAnalysisActivity.this, LinearLayoutManager.VERTICAL, false)); | ||
267 | + mAdapterSharedCoupons = new SharedCouponAdapter(LoyaltyAnalysisActivity.this, tempList); | ||
268 | + mRvSharedCoupons.setAdapter(mAdapterSharedCoupons); | ||
269 | + mLlShowMoreShared.setVisibility(View.VISIBLE); | ||
270 | + return; | ||
271 | + } | ||
272 | + | ||
240 | mRvSharedCoupons.setLayoutManager(new LinearLayoutManager(LoyaltyAnalysisActivity.this, LinearLayoutManager.VERTICAL, false)); | 273 | mRvSharedCoupons.setLayoutManager(new LinearLayoutManager(LoyaltyAnalysisActivity.this, LinearLayoutManager.VERTICAL, false)); |
241 | mAdapterSharedCoupons = new SharedCouponAdapter(LoyaltyAnalysisActivity.this, mSharedCoupons); | 274 | mAdapterSharedCoupons = new SharedCouponAdapter(LoyaltyAnalysisActivity.this, mSharedCoupons); |
242 | mRvSharedCoupons.setAdapter(mAdapterSharedCoupons); | 275 | mRvSharedCoupons.setAdapter(mAdapterSharedCoupons); | ... | ... |
... | @@ -227,6 +227,7 @@ public class TelcoActivity extends Activity implements View.OnClickListener { | ... | @@ -227,6 +227,7 @@ public class TelcoActivity extends Activity implements View.OnClickListener { |
227 | .setSessionId(mCCMS.getSessionId()) | 227 | .setSessionId(mCCMS.getSessionId()) |
228 | .setBusinessService(mCCMS.getBusinessService()) | 228 | .setBusinessService(mCCMS.getBusinessService()) |
229 | .setOfferName(mCCMS.getOfferName()) | 229 | .setOfferName(mCCMS.getOfferName()) |
230 | + .setNotificationMessage(mCCMS.getNotificationMessage()) | ||
230 | .setProductType(mCCMS.getProductType()) | 231 | .setProductType(mCCMS.getProductType()) |
231 | .setProvDuration(mCCMS.getProvDuration()) | 232 | .setProvDuration(mCCMS.getProvDuration()) |
232 | .setNoOfRecurrance(mCCMS.getNoOfRecurrance()) | 233 | .setNoOfRecurrance(mCCMS.getNoOfRecurrance()) | ... | ... |
... | @@ -25,6 +25,8 @@ | ... | @@ -25,6 +25,8 @@ |
25 | 25 | ||
26 | package ly.warp.sdk.io.models; | 26 | package ly.warp.sdk.io.models; |
27 | 27 | ||
28 | +import android.content.Context; | ||
29 | + | ||
28 | import java.util.HashMap; | 30 | import java.util.HashMap; |
29 | 31 | ||
30 | /** | 32 | /** |
... | @@ -35,6 +37,7 @@ public class LoyaltyGiftsForYouOfferClickEvent { | ... | @@ -35,6 +37,7 @@ public class LoyaltyGiftsForYouOfferClickEvent { |
35 | private String title; | 37 | private String title; |
36 | private String imageUrl; | 38 | private String imageUrl; |
37 | private String loyaltyPackageId; | 39 | private String loyaltyPackageId; |
40 | + private Context context; | ||
38 | 41 | ||
39 | public LoyaltyGiftsForYouOfferClickEvent() { | 42 | public LoyaltyGiftsForYouOfferClickEvent() { |
40 | this.title = ""; | 43 | this.title = ""; |
... | @@ -65,4 +68,12 @@ public class LoyaltyGiftsForYouOfferClickEvent { | ... | @@ -65,4 +68,12 @@ public class LoyaltyGiftsForYouOfferClickEvent { |
65 | public void setLoyaltyPackageId(String loyaltyPackageId) { | 68 | public void setLoyaltyPackageId(String loyaltyPackageId) { |
66 | this.loyaltyPackageId = loyaltyPackageId; | 69 | this.loyaltyPackageId = loyaltyPackageId; |
67 | } | 70 | } |
71 | + | ||
72 | + public Context getContext() { | ||
73 | + return context; | ||
74 | + } | ||
75 | + | ||
76 | + public void setContext(Context context) { | ||
77 | + this.context = context; | ||
78 | + } | ||
68 | } | 79 | } | ... | ... |
... | @@ -49,6 +49,7 @@ public class PacingDetails { | ... | @@ -49,6 +49,7 @@ public class PacingDetails { |
49 | private static final String ENABLED = "enabled"; | 49 | private static final String ENABLED = "enabled"; |
50 | private static final String GOAL_REACHED = "goal_reached"; | 50 | private static final String GOAL_REACHED = "goal_reached"; |
51 | private static final String MESSAGE = "msg"; | 51 | private static final String MESSAGE = "msg"; |
52 | + private static final String SHORTCUT_ENABLED = "shortcut_enabled"; | ||
52 | 53 | ||
53 | /* Member variables of the Campaign object */ | 54 | /* Member variables of the Campaign object */ |
54 | private PacingInner steps = new PacingInner(); | 55 | private PacingInner steps = new PacingInner(); |
... | @@ -56,6 +57,7 @@ public class PacingDetails { | ... | @@ -56,6 +57,7 @@ public class PacingDetails { |
56 | private boolean enabled = false; | 57 | private boolean enabled = false; |
57 | private boolean goal_reached = false; | 58 | private boolean goal_reached = false; |
58 | private String msg = ""; | 59 | private String msg = ""; |
60 | + private boolean shortcut_enabled = false; | ||
59 | 61 | ||
60 | /** | 62 | /** |
61 | * Basic constructor used to create an object from a String, representing a | 63 | * Basic constructor used to create an object from a String, representing a |
... | @@ -87,6 +89,7 @@ public class PacingDetails { | ... | @@ -87,6 +89,7 @@ public class PacingDetails { |
87 | this.enabled = result.optBoolean(ENABLED); | 89 | this.enabled = result.optBoolean(ENABLED); |
88 | this.goal_reached = result.optBoolean(GOAL_REACHED); | 90 | this.goal_reached = result.optBoolean(GOAL_REACHED); |
89 | this.msg = result.optString(MESSAGE); | 91 | this.msg = result.optString(MESSAGE); |
92 | + this.shortcut_enabled = result.optBoolean(SHORTCUT_ENABLED); | ||
90 | } | 93 | } |
91 | } | 94 | } |
92 | } | 95 | } |
... | @@ -102,8 +105,9 @@ public class PacingDetails { | ... | @@ -102,8 +105,9 @@ public class PacingDetails { |
102 | jObj.putOpt(STEPS, this.steps); | 105 | jObj.putOpt(STEPS, this.steps); |
103 | jObj.putOpt(METERS, this.meters); | 106 | jObj.putOpt(METERS, this.meters); |
104 | jObj.putOpt(ENABLED, this.enabled); | 107 | jObj.putOpt(ENABLED, this.enabled); |
105 | - jObj.putOpt(ENABLED, this.goal_reached); | 108 | + jObj.putOpt(GOAL_REACHED, this.goal_reached); |
106 | - jObj.putOpt(ENABLED, this.msg); | 109 | + jObj.putOpt(MESSAGE, this.msg); |
110 | + jObj.putOpt(SHORTCUT_ENABLED, this.shortcut_enabled); | ||
107 | } catch (JSONException e) { | 111 | } catch (JSONException e) { |
108 | if (WarpConstants.DEBUG) { | 112 | if (WarpConstants.DEBUG) { |
109 | e.printStackTrace(); | 113 | e.printStackTrace(); |
... | @@ -340,4 +344,20 @@ public class PacingDetails { | ... | @@ -340,4 +344,20 @@ public class PacingDetails { |
340 | public String getMsg() { | 344 | public String getMsg() { |
341 | return msg; | 345 | return msg; |
342 | } | 346 | } |
347 | + | ||
348 | + public void setGoal_reached(boolean goal_reached) { | ||
349 | + this.goal_reached = goal_reached; | ||
350 | + } | ||
351 | + | ||
352 | + public void setMsg(String msg) { | ||
353 | + this.msg = msg; | ||
354 | + } | ||
355 | + | ||
356 | + public boolean isShortcut_enabled() { | ||
357 | + return shortcut_enabled; | ||
358 | + } | ||
359 | + | ||
360 | + public void setShortcut_enabled(boolean shortcut_enabled) { | ||
361 | + this.shortcut_enabled = shortcut_enabled; | ||
362 | + } | ||
343 | } | 363 | } | ... | ... |
... | @@ -74,6 +74,7 @@ public class CosmoteSubmitOrderRequest { | ... | @@ -74,6 +74,7 @@ public class CosmoteSubmitOrderRequest { |
74 | private String mValidity = ""; | 74 | private String mValidity = ""; |
75 | private String mTreatmentCode = ""; | 75 | private String mTreatmentCode = ""; |
76 | private String mSessionId = ""; | 76 | private String mSessionId = ""; |
77 | + private String mNotificationMessage = ""; | ||
77 | 78 | ||
78 | // =========================================================== | 79 | // =========================================================== |
79 | // Constructor | 80 | // Constructor |
... | @@ -234,6 +235,11 @@ public class CosmoteSubmitOrderRequest { | ... | @@ -234,6 +235,11 @@ public class CosmoteSubmitOrderRequest { |
234 | return this; | 235 | return this; |
235 | } | 236 | } |
236 | 237 | ||
238 | + public CosmoteSubmitOrderRequest setNotificationMessage(String notificationMessage) { | ||
239 | + this.mNotificationMessage = notificationMessage; | ||
240 | + return this; | ||
241 | + } | ||
242 | + | ||
237 | /** | 243 | /** |
238 | * Call this to get how often the cached data will be updated. | 244 | * Call this to get how often the cached data will be updated. |
239 | * | 245 | * |
... | @@ -319,6 +325,7 @@ public class CosmoteSubmitOrderRequest { | ... | @@ -319,6 +325,7 @@ public class CosmoteSubmitOrderRequest { |
319 | extraData.putOpt("OfferAudienceLevel", mOfferAudienceLevel); | 325 | extraData.putOpt("OfferAudienceLevel", mOfferAudienceLevel); |
320 | extraData.putOpt("MSISDN", mOfferAudienceLevel.equals("msisdn") ? mUserMsisdn : ""); | 326 | extraData.putOpt("MSISDN", mOfferAudienceLevel.equals("msisdn") ? mUserMsisdn : ""); |
321 | extraData.putOpt("GUID", ""); | 327 | extraData.putOpt("GUID", ""); |
328 | + extraData.putOpt("notificationMessage", mNotificationMessage); | ||
322 | 329 | ||
323 | JSONArray parameters = new JSONArray(); | 330 | JSONArray parameters = new JSONArray(); |
324 | JSONObject param1 = new JSONObject(); | 331 | JSONObject param1 = new JSONObject(); | ... | ... |
... | @@ -15,6 +15,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy; | ... | @@ -15,6 +15,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy; |
15 | 15 | ||
16 | import java.text.ParseException; | 16 | import java.text.ParseException; |
17 | import java.text.SimpleDateFormat; | 17 | import java.text.SimpleDateFormat; |
18 | +import java.util.ArrayList; | ||
18 | import java.util.Date; | 19 | import java.util.Date; |
19 | import java.util.concurrent.TimeUnit; | 20 | import java.util.concurrent.TimeUnit; |
20 | 21 | ||
... | @@ -29,7 +30,7 @@ import ly.warp.sdk.utils.WarplyManagerHelper; | ... | @@ -29,7 +30,7 @@ import ly.warp.sdk.utils.WarplyManagerHelper; |
29 | public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdapter.ExpiredCouponViewHolder> { | 30 | public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdapter.ExpiredCouponViewHolder> { |
30 | 31 | ||
31 | private Context mContext; | 32 | private Context mContext; |
32 | - private CouponList mCoupons; | 33 | + private /*CouponList*/ ArrayList<Coupon> mCoupons; |
33 | private final PublishSubject<Coupon> onClickSubject = PublishSubject.create(); | 34 | private final PublishSubject<Coupon> onClickSubject = PublishSubject.create(); |
34 | 35 | ||
35 | public ExpiredCouponAdapter(Context mContext, CouponList campaignList) { | 36 | public ExpiredCouponAdapter(Context mContext, CouponList campaignList) { |
... | @@ -37,6 +38,11 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap | ... | @@ -37,6 +38,11 @@ public class ExpiredCouponAdapter extends RecyclerView.Adapter<ExpiredCouponAdap |
37 | this.mCoupons = campaignList; | 38 | this.mCoupons = campaignList; |
38 | } | 39 | } |
39 | 40 | ||
41 | + public ExpiredCouponAdapter(Context mContext, ArrayList<Coupon> campaignList) { | ||
42 | + this.mContext = mContext; | ||
43 | + this.mCoupons = /*(CouponList)*/ campaignList; | ||
44 | + } | ||
45 | + | ||
40 | public class ExpiredCouponViewHolder extends RecyclerView.ViewHolder { | 46 | public class ExpiredCouponViewHolder extends RecyclerView.ViewHolder { |
41 | private TextView tvCouponTitle, tvCouponValue, tvCouponDate; | 47 | private TextView tvCouponTitle, tvCouponValue, tvCouponDate; |
42 | private ImageView ivCouponLogo; | 48 | private ImageView ivCouponLogo; | ... | ... |
... | @@ -17,6 +17,7 @@ import org.json.JSONObject; | ... | @@ -17,6 +17,7 @@ import org.json.JSONObject; |
17 | 17 | ||
18 | import java.text.ParseException; | 18 | import java.text.ParseException; |
19 | import java.text.SimpleDateFormat; | 19 | import java.text.SimpleDateFormat; |
20 | +import java.util.ArrayList; | ||
20 | import java.util.Date; | 21 | import java.util.Date; |
21 | import java.util.concurrent.TimeUnit; | 22 | import java.util.concurrent.TimeUnit; |
22 | 23 | ||
... | @@ -32,7 +33,7 @@ import ly.warp.sdk.utils.WarplyManagerHelper; | ... | @@ -32,7 +33,7 @@ import ly.warp.sdk.utils.WarplyManagerHelper; |
32 | public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapter.SharedCouponViewHolder> { | 33 | public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapter.SharedCouponViewHolder> { |
33 | 34 | ||
34 | private Context mContext; | 35 | private Context mContext; |
35 | - private SharingList mCoupons; | 36 | + private /*SharingList*/ ArrayList<SharingCoupon> mCoupons; |
36 | private final PublishSubject<SharingCoupon> onClickSubject = PublishSubject.create(); | 37 | private final PublishSubject<SharingCoupon> onClickSubject = PublishSubject.create(); |
37 | 38 | ||
38 | public SharedCouponAdapter(Context mContext, SharingList campaignList) { | 39 | public SharedCouponAdapter(Context mContext, SharingList campaignList) { |
... | @@ -40,6 +41,11 @@ public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapte | ... | @@ -40,6 +41,11 @@ public class SharedCouponAdapter extends RecyclerView.Adapter<SharedCouponAdapte |
40 | this.mCoupons = campaignList; | 41 | this.mCoupons = campaignList; |
41 | } | 42 | } |
42 | 43 | ||
44 | + public SharedCouponAdapter(Context mContext, ArrayList<SharingCoupon> campaignList) { | ||
45 | + this.mContext = mContext; | ||
46 | + this.mCoupons = campaignList; | ||
47 | + } | ||
48 | + | ||
43 | public class SharedCouponViewHolder extends RecyclerView.ViewHolder { | 49 | public class SharedCouponViewHolder extends RecyclerView.ViewHolder { |
44 | private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvCouponLabel, tvCouponPhone; | 50 | private TextView tvCouponTitle, tvCouponValue, tvCouponDate, tvCouponLabel, tvCouponPhone; |
45 | private ImageView ivCouponLogo; | 51 | private ImageView ivCouponLogo; | ... | ... |
... | @@ -95,24 +95,53 @@ | ... | @@ -95,24 +95,53 @@ |
95 | <androidx.recyclerview.widget.RecyclerView | 95 | <androidx.recyclerview.widget.RecyclerView |
96 | android:id="@+id/rv_expired_coupons" | 96 | android:id="@+id/rv_expired_coupons" |
97 | android:layout_width="match_parent" | 97 | android:layout_width="match_parent" |
98 | - android:layout_height="match_parent" | 98 | + android:layout_height="wrap_content" |
99 | android:layout_below="@+id/tv_expired_title" | 99 | android:layout_below="@+id/tv_expired_title" |
100 | android:layout_marginHorizontal="8dp" | 100 | android:layout_marginHorizontal="8dp" |
101 | android:layout_marginTop="24dp" | 101 | android:layout_marginTop="24dp" |
102 | android:orientation="vertical" /> | 102 | android:orientation="vertical" /> |
103 | 103 | ||
104 | + <LinearLayout | ||
105 | + android:id="@+id/ll_show_more_expired" | ||
106 | + android:layout_width="wrap_content" | ||
107 | + android:layout_height="wrap_content" | ||
108 | + android:layout_below="@+id/rv_expired_coupons" | ||
109 | + android:layout_centerHorizontal="true" | ||
110 | + android:layout_marginTop="20dp" | ||
111 | + android:gravity="center" | ||
112 | + android:orientation="horizontal" | ||
113 | + android:visibility="gone" | ||
114 | + tools:visibility="visible"> | ||
115 | + | ||
116 | + <TextView | ||
117 | + android:id="@+id/tv_barcode" | ||
118 | + fontPath="fonts/pf_square_sans_pro_medium.ttf" | ||
119 | + android:layout_width="wrap_content" | ||
120 | + android:layout_height="wrap_content" | ||
121 | + android:text="@string/cos_see_more" | ||
122 | + android:textColor="@color/grey" | ||
123 | + android:textSize="16sp" /> | ||
124 | + | ||
125 | + <ImageView | ||
126 | + android:id="@+id/iv_barcode_arrow" | ||
127 | + android:layout_width="14dp" | ||
128 | + android:layout_height="14dp" | ||
129 | + android:layout_marginStart="6dp" | ||
130 | + android:src="@drawable/ic_down_dark" /> | ||
131 | + </LinearLayout> | ||
132 | + | ||
104 | <TextView | 133 | <TextView |
105 | android:id="@+id/tv_expired_empty" | 134 | android:id="@+id/tv_expired_empty" |
106 | fontPath="fonts/pf_square_sans_pro_regular.ttf" | 135 | fontPath="fonts/pf_square_sans_pro_regular.ttf" |
107 | android:layout_width="wrap_content" | 136 | android:layout_width="wrap_content" |
108 | android:layout_height="wrap_content" | 137 | android:layout_height="wrap_content" |
138 | + android:layout_below="@+id/tv_expired_title" | ||
109 | android:layout_centerHorizontal="true" | 139 | android:layout_centerHorizontal="true" |
110 | android:layout_marginTop="56dp" | 140 | android:layout_marginTop="56dp" |
111 | - android:layout_below="@+id/tv_expired_title" | ||
112 | android:text="@string/cos_empty_expired_coupons" | 141 | android:text="@string/cos_empty_expired_coupons" |
113 | android:textColor="@color/cos_light_grey2" | 142 | android:textColor="@color/cos_light_grey2" |
114 | android:textSize="16sp" | 143 | android:textSize="16sp" |
115 | - android:visibility="gone"/> | 144 | + android:visibility="gone" /> |
116 | </RelativeLayout> | 145 | </RelativeLayout> |
117 | 146 | ||
118 | <RelativeLayout | 147 | <RelativeLayout |
... | @@ -136,23 +165,52 @@ | ... | @@ -136,23 +165,52 @@ |
136 | <androidx.recyclerview.widget.RecyclerView | 165 | <androidx.recyclerview.widget.RecyclerView |
137 | android:id="@+id/rv_shared_coupons" | 166 | android:id="@+id/rv_shared_coupons" |
138 | android:layout_width="match_parent" | 167 | android:layout_width="match_parent" |
139 | - android:layout_height="match_parent" | 168 | + android:layout_height="wrap_content" |
140 | android:layout_below="@+id/tv_shared_title" | 169 | android:layout_below="@+id/tv_shared_title" |
141 | android:layout_marginHorizontal="8dp" | 170 | android:layout_marginHorizontal="8dp" |
142 | android:layout_marginTop="24dp" | 171 | android:layout_marginTop="24dp" |
143 | android:orientation="vertical" /> | 172 | android:orientation="vertical" /> |
144 | 173 | ||
174 | + <LinearLayout | ||
175 | + android:id="@+id/ll_show_more_shared" | ||
176 | + android:layout_width="wrap_content" | ||
177 | + android:layout_height="wrap_content" | ||
178 | + android:layout_below="@+id/rv_shared_coupons" | ||
179 | + android:layout_centerHorizontal="true" | ||
180 | + android:layout_marginTop="20dp" | ||
181 | + android:gravity="center" | ||
182 | + android:orientation="horizontal" | ||
183 | + android:visibility="gone" | ||
184 | + tools:visibility="visible"> | ||
185 | + | ||
186 | + <TextView | ||
187 | + android:id="@+id/tv_barcode" | ||
188 | + fontPath="fonts/pf_square_sans_pro_medium.ttf" | ||
189 | + android:layout_width="wrap_content" | ||
190 | + android:layout_height="wrap_content" | ||
191 | + android:text="@string/cos_see_more" | ||
192 | + android:textColor="@color/grey" | ||
193 | + android:textSize="16sp" /> | ||
194 | + | ||
195 | + <ImageView | ||
196 | + android:id="@+id/iv_barcode_arrow" | ||
197 | + android:layout_width="14dp" | ||
198 | + android:layout_height="14dp" | ||
199 | + android:layout_marginStart="6dp" | ||
200 | + android:src="@drawable/ic_down_dark" /> | ||
201 | + </LinearLayout> | ||
202 | + | ||
145 | <TextView | 203 | <TextView |
146 | android:id="@+id/tv_shared_empty" | 204 | android:id="@+id/tv_shared_empty" |
147 | fontPath="fonts/pf_square_sans_pro_regular.ttf" | 205 | fontPath="fonts/pf_square_sans_pro_regular.ttf" |
148 | android:layout_width="wrap_content" | 206 | android:layout_width="wrap_content" |
149 | android:layout_height="wrap_content" | 207 | android:layout_height="wrap_content" |
208 | + android:layout_below="@+id/tv_shared_title" | ||
150 | android:layout_centerHorizontal="true" | 209 | android:layout_centerHorizontal="true" |
151 | android:layout_marginTop="56dp" | 210 | android:layout_marginTop="56dp" |
152 | - android:layout_below="@+id/tv_shared_title" | ||
153 | android:text="@string/cos_empty_shared_coupons" | 211 | android:text="@string/cos_empty_shared_coupons" |
154 | android:textColor="@color/cos_light_grey2" | 212 | android:textColor="@color/cos_light_grey2" |
155 | android:textSize="16sp" | 213 | android:textSize="16sp" |
156 | - android:visibility="gone"/> | 214 | + android:visibility="gone" /> |
157 | </RelativeLayout> | 215 | </RelativeLayout> |
158 | </RelativeLayout> | 216 | </RelativeLayout> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment