Showing
12 changed files
with
188 additions
and
58 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("7000000826"), //6012049321, 6012049322, 6012049323, 7000000831 history | 39 | + .setGuid("7000000831"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons |
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-cosbeta63' | 5 | + PUBLISH_VERSION = '4.5.4-cosbeta65' |
6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
7 | } | 7 | } |
8 | 8 | ||
... | @@ -55,6 +55,7 @@ dependencies { | ... | @@ -55,6 +55,7 @@ dependencies { |
55 | api group: 'com.google.zxing', name: 'javase', version: '3.4.1' | 55 | api group: 'com.google.zxing', name: 'javase', version: '3.4.1' |
56 | api 'com.github.siyamed:android-shape-imageview:0.9.3' | 56 | api 'com.github.siyamed:android-shape-imageview:0.9.3' |
57 | implementation 'org.greenrobot:eventbus:3.3.1' | 57 | implementation 'org.greenrobot:eventbus:3.3.1' |
58 | + api 'com.google.android.flexbox:flexbox:3.0.0' | ||
58 | 59 | ||
59 | //------------------------------ Firebase -----------------------------// | 60 | //------------------------------ Firebase -----------------------------// |
60 | api platform('com.google.firebase:firebase-bom:29.0.3') | 61 | api platform('com.google.firebase:firebase-bom:29.0.3') | ... | ... |
... | @@ -155,19 +155,14 @@ public enum Warply { | ... | @@ -155,19 +155,14 @@ public enum Warply { |
155 | */ | 155 | */ |
156 | private void isInitializedOrThrow() { | 156 | private void isInitializedOrThrow() { |
157 | if (mContext == null) | 157 | if (mContext == null) |
158 | - throw (new RuntimeException( | 158 | + WarpUtils.log("Warply has not been initialized, call init(Context) first"); |
159 | - "Warply has not been initialized, call init(Context) first")); | ||
160 | if (mContext.get() == null) | 159 | if (mContext.get() == null) |
161 | - throw (new RuntimeException( | 160 | + WarpUtils.log("Warply has not been initialized, call init(Context) first"); |
162 | - "Warply has not been initialized, call init(Context) first")); | ||
163 | String apiKey = WarplyProperty.getAppUuid(mContext.get()); | 161 | String apiKey = WarplyProperty.getAppUuid(mContext.get()); |
164 | if (apiKey == null) | 162 | if (apiKey == null) |
165 | - throw (new RuntimeException( | 163 | + WarpUtils.log("Warply application UUID has not been set in the Manifest"); |
166 | - "Warply application UUID has not been set in the Manifest")); | ||
167 | if ((apiKey.length() != 32) && (apiKey.length() != 36)) | 164 | if ((apiKey.length() != 32) && (apiKey.length() != 36)) |
168 | - throw (new RuntimeException( | 165 | + WarpUtils.log("Warply application UUID has not been set correclty in the Manifest, key got: " + apiKey); |
169 | - "Warply application UUID has not been set correclty in the Manifest, key got: " | ||
170 | - + apiKey)); | ||
171 | } | 166 | } |
172 | 167 | ||
173 | /** | 168 | /** | ... | ... |
... | @@ -75,13 +75,13 @@ public class ContextualActivity extends Activity implements View.OnClickListener | ... | @@ -75,13 +75,13 @@ public class ContextualActivity extends Activity implements View.OnClickListener |
75 | public void onResume() { | 75 | public void onResume() { |
76 | super.onResume(); | 76 | super.onResume(); |
77 | 77 | ||
78 | - new Thread(() -> { | 78 | +// new Thread(() -> { |
79 | - if (!Thread.currentThread().isInterrupted()) { | 79 | +// if (!Thread.currentThread().isInterrupted()) { |
80 | - WarplyManager.getConsumer(new WarplyConsumerRequest() | 80 | +// WarplyManager.getConsumer(new WarplyConsumerRequest() |
81 | - , mConsumerCallback); | 81 | +// , mConsumerCallback); |
82 | - } | 82 | +// } |
83 | - Thread.currentThread().interrupt(); | 83 | +// Thread.currentThread().interrupt(); |
84 | - }).start(); | 84 | +// }).start(); |
85 | } | 85 | } |
86 | 86 | ||
87 | @Override | 87 | @Override |
... | @@ -131,18 +131,41 @@ public class ContextualActivity extends Activity implements View.OnClickListener | ... | @@ -131,18 +131,41 @@ public class ContextualActivity extends Activity implements View.OnClickListener |
131 | ImageView dialogClose = (ImageView) bottomSheetDialog.findViewById(R.id.iv_sender_list_close); | 131 | ImageView dialogClose = (ImageView) bottomSheetDialog.findViewById(R.id.iv_sender_list_close); |
132 | dialogClose.setOnClickListener(view -> bottomSheetDialog.dismiss()); | 132 | dialogClose.setOnClickListener(view -> bottomSheetDialog.dismiss()); |
133 | 133 | ||
134 | - if (mConsumer != null) { | 134 | +// if (mConsumer != null) { |
135 | - try { | 135 | +// try { |
136 | - JSONObject profMeta = new JSONObject(mConsumer.getProfileMetadata()); | 136 | +// JSONObject profMeta = new JSONObject(mConsumer.getProfileMetadata()); |
137 | - if (profMeta != null) { | 137 | +// if (profMeta != null) { |
138 | - JSONArray msisdnList = new JSONArray(); | 138 | +// JSONArray msisdnList = new JSONArray(); |
139 | - msisdnList = profMeta.optJSONArray(MSISDN_LIST); | 139 | +// msisdnList = profMeta.optJSONArray(MSISDN_LIST); |
140 | - if (msisdnList != null && msisdnList.length() > 0) { | 140 | +// if (msisdnList != null && msisdnList.length() > 0) { |
141 | - for (int i = 0; i < msisdnList.length(); i++) { | 141 | +// for (int i = 0; i < msisdnList.length(); i++) { |
142 | +// LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); | ||
143 | +// LinearLayout v = (LinearLayout) vi.inflate(R.layout.item_share, null); | ||
144 | +// TextView textView = (TextView) v.findViewById(R.id.tv_phone_share); | ||
145 | +// textView.setText(msisdnList.optString(i)); | ||
146 | +// textView.setOnClickListener(view -> { | ||
147 | +// TextView tv = (TextView) view; | ||
148 | +// mSender = tv.getText().toString(); | ||
149 | +// bottomSheetDialog.dismiss(); | ||
150 | +// askActivateDialog(); | ||
151 | +// }); | ||
152 | +// parent.addView(v, 0, new ViewGroup.LayoutParams( | ||
153 | +// ViewGroup.LayoutParams.MATCH_PARENT, | ||
154 | +// ViewGroup.LayoutParams.WRAP_CONTENT)); | ||
155 | +// } | ||
156 | +// } | ||
157 | +// } | ||
158 | +// } catch (JSONException e) { | ||
159 | +// e.printStackTrace(); | ||
160 | +// } | ||
161 | +// } | ||
162 | + | ||
163 | + if (mCCMS.getEligibleAssets() != null && mCCMS.getEligibleAssets().size() > 0) { | ||
164 | + for (int i = 0; i < mCCMS.getEligibleAssets().size(); i++) { | ||
142 | LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); | 165 | LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); |
143 | LinearLayout v = (LinearLayout) vi.inflate(R.layout.item_share, null); | 166 | LinearLayout v = (LinearLayout) vi.inflate(R.layout.item_share, null); |
144 | TextView textView = (TextView) v.findViewById(R.id.tv_phone_share); | 167 | TextView textView = (TextView) v.findViewById(R.id.tv_phone_share); |
145 | - textView.setText(msisdnList.optString(i)); | 168 | + textView.setText(mCCMS.getEligibleAssets().get(i)); |
146 | textView.setOnClickListener(view -> { | 169 | textView.setOnClickListener(view -> { |
147 | TextView tv = (TextView) view; | 170 | TextView tv = (TextView) view; |
148 | mSender = tv.getText().toString(); | 171 | mSender = tv.getText().toString(); |
... | @@ -154,11 +177,6 @@ public class ContextualActivity extends Activity implements View.OnClickListener | ... | @@ -154,11 +177,6 @@ public class ContextualActivity extends Activity implements View.OnClickListener |
154 | ViewGroup.LayoutParams.WRAP_CONTENT)); | 177 | ViewGroup.LayoutParams.WRAP_CONTENT)); |
155 | } | 178 | } |
156 | } | 179 | } |
157 | - } | ||
158 | - } catch (JSONException e) { | ||
159 | - e.printStackTrace(); | ||
160 | - } | ||
161 | - } | ||
162 | 180 | ||
163 | bottomSheetDialog.show(); | 181 | bottomSheetDialog.show(); |
164 | } | 182 | } | ... | ... |
... | @@ -217,7 +217,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis | ... | @@ -217,7 +217,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis |
217 | mTvCouponsValueAll.setText(sBuilder, TextView.BufferType.SPANNABLE); | 217 | mTvCouponsValueAll.setText(sBuilder, TextView.BufferType.SPANNABLE); |
218 | 218 | ||
219 | if (WarplyManagerHelper.getCouponExpiredList() != null && WarplyManagerHelper.getCouponExpiredList().size() > 0) { | 219 | if (WarplyManagerHelper.getCouponExpiredList() != null && WarplyManagerHelper.getCouponExpiredList().size() > 0) { |
220 | - if (WarplyManagerHelper.getCouponExpiredList().size() >= 3) { | 220 | + if (WarplyManagerHelper.getCouponExpiredList().size() > 3) { |
221 | ArrayList<Coupon> tempList = new ArrayList<>(WarplyManagerHelper.getCouponExpiredList().subList(0, 3)); | 221 | ArrayList<Coupon> tempList = new ArrayList<>(WarplyManagerHelper.getCouponExpiredList().subList(0, 3)); |
222 | 222 | ||
223 | mRvExpiredCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); | 223 | mRvExpiredCoupons.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); |
... | @@ -260,7 +260,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis | ... | @@ -260,7 +260,7 @@ public class LoyaltyAnalysisActivity extends Activity implements View.OnClickLis |
260 | 260 | ||
261 | runOnUiThread(() -> { | 261 | runOnUiThread(() -> { |
262 | if (mSharedCoupons != null && mSharedCoupons.size() > 0) { | 262 | if (mSharedCoupons != null && mSharedCoupons.size() > 0) { |
263 | - if (mSharedCoupons.size() >= 3) { | 263 | + if (mSharedCoupons.size() > 3) { |
264 | ArrayList<SharingCoupon> tempList = new ArrayList<>(mSharedCoupons.subList(0, 3)); | 264 | ArrayList<SharingCoupon> tempList = new ArrayList<>(mSharedCoupons.subList(0, 3)); |
265 | 265 | ||
266 | mRvSharedCoupons.setLayoutManager(new LinearLayoutManager(LoyaltyAnalysisActivity.this, LinearLayoutManager.VERTICAL, false)); | 266 | mRvSharedCoupons.setLayoutManager(new LinearLayoutManager(LoyaltyAnalysisActivity.this, LinearLayoutManager.VERTICAL, false)); | ... | ... |
... | @@ -7,7 +7,9 @@ import android.os.Bundle; | ... | @@ -7,7 +7,9 @@ import android.os.Bundle; |
7 | import android.text.SpannableStringBuilder; | 7 | import android.text.SpannableStringBuilder; |
8 | import android.text.Spanned; | 8 | import android.text.Spanned; |
9 | import android.text.TextUtils; | 9 | import android.text.TextUtils; |
10 | +import android.view.LayoutInflater; | ||
10 | import android.view.View; | 11 | import android.view.View; |
12 | +import android.view.ViewGroup; | ||
11 | import android.widget.ImageView; | 13 | import android.widget.ImageView; |
12 | import android.widget.LinearLayout; | 14 | import android.widget.LinearLayout; |
13 | import android.widget.TextView; | 15 | import android.widget.TextView; |
... | @@ -19,6 +21,7 @@ import androidx.recyclerview.widget.RecyclerView; | ... | @@ -19,6 +21,7 @@ import androidx.recyclerview.widget.RecyclerView; |
19 | 21 | ||
20 | import com.bumptech.glide.Glide; | 22 | import com.bumptech.glide.Glide; |
21 | import com.bumptech.glide.load.engine.DiskCacheStrategy; | 23 | import com.bumptech.glide.load.engine.DiskCacheStrategy; |
24 | +import com.google.android.flexbox.FlexboxLayout; | ||
22 | 25 | ||
23 | import org.greenrobot.eventbus.EventBus; | 26 | import org.greenrobot.eventbus.EventBus; |
24 | import org.greenrobot.eventbus.Subscribe; | 27 | import org.greenrobot.eventbus.Subscribe; |
... | @@ -26,6 +29,7 @@ import org.greenrobot.eventbus.Subscribe; | ... | @@ -26,6 +29,7 @@ import org.greenrobot.eventbus.Subscribe; |
26 | import java.io.Serializable; | 29 | import java.io.Serializable; |
27 | import java.text.ParseException; | 30 | import java.text.ParseException; |
28 | import java.text.SimpleDateFormat; | 31 | import java.text.SimpleDateFormat; |
32 | +import java.util.ArrayList; | ||
29 | import java.util.Collections; | 33 | import java.util.Collections; |
30 | import java.util.Comparator; | 34 | import java.util.Comparator; |
31 | import java.util.Date; | 35 | import java.util.Date; |
... | @@ -63,6 +67,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { | ... | @@ -63,6 +67,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { |
63 | private ConstraintLayout mClDealsBanner, mClDealsView, | 67 | private ConstraintLayout mClDealsBanner, mClDealsView, |
64 | mClGiftsBanner; | 68 | mClGiftsBanner; |
65 | private LinearLayout mLlQuestionnaire, mLlUserBadge, mLlEmptyWallet; | 69 | private LinearLayout mLlQuestionnaire, mLlUserBadge, mLlEmptyWallet; |
70 | + FlexboxLayout mLlActiveCodesView; | ||
66 | private float couponDfyValue = 0.0f; | 71 | private float couponDfyValue = 0.0f; |
67 | private RecyclerView mRecyclerCoupons; | 72 | private RecyclerView mRecyclerCoupons; |
68 | private ActiveCouponAdapter mAdapterCoupons; | 73 | private ActiveCouponAdapter mAdapterCoupons; |
... | @@ -96,6 +101,45 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { | ... | @@ -96,6 +101,45 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { |
96 | mTvActiveTitle = findViewById(R.id.tv_active_gifts); | 101 | mTvActiveTitle = findViewById(R.id.tv_active_gifts); |
97 | mTvActiveCouponsHeader = findViewById(R.id.tv_active_coupons_header); | 102 | mTvActiveCouponsHeader = findViewById(R.id.tv_active_coupons_header); |
98 | mLlEmptyWallet = findViewById(R.id.ll_empty_wallet); | 103 | mLlEmptyWallet = findViewById(R.id.ll_empty_wallet); |
104 | + mLlActiveCodesView = findViewById(R.id.ll_active_deals_codes_view); | ||
105 | + | ||
106 | + ArrayList<ActiveDFYCouponModel> dlist = new ArrayList<>(); | ||
107 | + ActiveDFYCouponModel model = new ActiveDFYCouponModel(); | ||
108 | + model.setCode("123456789"); | ||
109 | + model.setValue("10"); | ||
110 | + model.setDate("2022-09-14 20:20"); | ||
111 | + dlist.add(model); | ||
112 | + model = new ActiveDFYCouponModel(); | ||
113 | + model.setCode("123456780"); | ||
114 | + model.setValue("10"); | ||
115 | + model.setDate("2022-09-14 20:20"); | ||
116 | + dlist.add(model); | ||
117 | + model = new ActiveDFYCouponModel(); | ||
118 | + model.setCode("123456781"); | ||
119 | + model.setValue("10"); | ||
120 | + model.setDate("2022-09-14 20:20"); | ||
121 | + dlist.add(model); | ||
122 | + model = new ActiveDFYCouponModel(); | ||
123 | + model.setCode("123456782"); | ||
124 | + model.setValue("10"); | ||
125 | + model.setDate("2022-09-14 20:20"); | ||
126 | + dlist.add(model); | ||
127 | + model = new ActiveDFYCouponModel(); | ||
128 | + model.setCode("123456783"); | ||
129 | + model.setValue("10"); | ||
130 | + model.setDate("2022-09-14 20:20"); | ||
131 | + dlist.add(model); | ||
132 | + model = new ActiveDFYCouponModel(); | ||
133 | + model.setCode("123456784"); | ||
134 | + model.setValue("10"); | ||
135 | + model.setDate("2022-09-14 20:20"); | ||
136 | + dlist.add(model); | ||
137 | + model = new ActiveDFYCouponModel(); | ||
138 | + model.setCode("123456785"); | ||
139 | + model.setValue("10"); | ||
140 | + model.setDate("2022-09-14 20:20"); | ||
141 | + dlist.add(model); | ||
142 | + WarplyManagerHelper.setActiveDFYCoupons(dlist); | ||
99 | 143 | ||
100 | if (WarplyManagerHelper.getActiveDFYCoupons() != null) { | 144 | if (WarplyManagerHelper.getActiveDFYCoupons() != null) { |
101 | Collections.sort(WarplyManagerHelper.getActiveDFYCoupons(), new Comparator<ActiveDFYCouponModel>() { | 145 | Collections.sort(WarplyManagerHelper.getActiveDFYCoupons(), new Comparator<ActiveDFYCouponModel>() { |
... | @@ -338,6 +382,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { | ... | @@ -338,6 +382,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { |
338 | String date1 = WarplyManagerHelper.getActiveDFYCoupons().get(0).getDate(); | 382 | String date1 = WarplyManagerHelper.getActiveDFYCoupons().get(0).getDate(); |
339 | String date2 = dateFormat.format(new Date()); | 383 | String date2 = dateFormat.format(new Date()); |
340 | 384 | ||
385 | + mTvActiveCode.setText(codes); | ||
386 | + | ||
341 | try { | 387 | try { |
342 | Date toDate = dateFormat.parse(date2); | 388 | Date toDate = dateFormat.parse(date2); |
343 | Date fromDate = dateFormat.parse(date1); | 389 | Date fromDate = dateFormat.parse(date1); |
... | @@ -348,14 +394,30 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { | ... | @@ -348,14 +394,30 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener { |
348 | e.printStackTrace(); | 394 | e.printStackTrace(); |
349 | } | 395 | } |
350 | } else { | 396 | } else { |
351 | - for (ActiveDFYCouponModel coupon : WarplyManagerHelper.getActiveDFYCoupons()) { | 397 | +// for (ActiveDFYCouponModel coupon : WarplyManagerHelper.getActiveDFYCoupons()) { |
352 | - codes = codes + coupon.getCode() + ","; | 398 | +// codes = codes + coupon.getCode() + ","; |
353 | - } | 399 | +// } |
354 | - codes = codes.substring(0, codes.length() - 1); | 400 | +// codes = codes.substring(0, codes.length() - 1); |
355 | 401 | ||
356 | mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals_plural), String.valueOf(WarplyManagerHelper.getActiveDFYCoupons().size()))); | 402 | mTvActiveTitle.setText(String.format(getString(R.string.cos_active_deals_plural), String.valueOf(WarplyManagerHelper.getActiveDFYCoupons().size()))); |
403 | + mTvActiveCode.setVisibility(View.GONE); | ||
404 | + | ||
405 | + for (ActiveDFYCouponModel dealsItem : WarplyManagerHelper.getActiveDFYCoupons()) { | ||
406 | + LayoutInflater vi = (LayoutInflater) getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); | ||
407 | + LinearLayout v = (LinearLayout) vi.inflate(R.layout.item_selectable, null); | ||
408 | + TextView textView = (TextView) v.findViewById(R.id.tv_code_copy); | ||
409 | + TextView textViewComma = (TextView) v.findViewById(R.id.tv_code_comma); | ||
410 | + textView.setText(dealsItem.getCode()); | ||
411 | + textView.setTextIsSelectable(true); | ||
412 | + textViewComma.setText(getString(R.string.cos_comma)); | ||
413 | + mLlActiveCodesView.addView(v, 0, new ViewGroup.LayoutParams( | ||
414 | + ViewGroup.LayoutParams.WRAP_CONTENT, | ||
415 | + ViewGroup.LayoutParams.WRAP_CONTENT)); | ||
357 | } | 416 | } |
358 | - mTvActiveCode.setText(codes); | 417 | + |
418 | + mLlActiveCodesView.setVisibility(View.VISIBLE); | ||
419 | + } | ||
420 | +// mTvActiveCode.setText(codes); | ||
359 | } else { | 421 | } else { |
360 | mIvDealsLogo.setVisibility(View.GONE); | 422 | mIvDealsLogo.setVisibility(View.GONE); |
361 | mClDealsView.setVisibility(View.GONE); | 423 | mClDealsView.setVisibility(View.GONE); | ... | ... |
... | @@ -88,13 +88,13 @@ public class TelcoActivity extends Activity implements View.OnClickListener { | ... | @@ -88,13 +88,13 @@ public class TelcoActivity extends Activity implements View.OnClickListener { |
88 | public void onResume() { | 88 | public void onResume() { |
89 | super.onResume(); | 89 | super.onResume(); |
90 | 90 | ||
91 | - new Thread(() -> { | 91 | +// new Thread(() -> { |
92 | - if (!Thread.currentThread().isInterrupted()) { | 92 | +// if (!Thread.currentThread().isInterrupted()) { |
93 | - WarplyManager.getConsumer(new WarplyConsumerRequest() | 93 | +// WarplyManager.getConsumer(new WarplyConsumerRequest() |
94 | - , mConsumerCallback); | 94 | +// , mConsumerCallback); |
95 | - } | 95 | +// } |
96 | - Thread.currentThread().interrupt(); | 96 | +// Thread.currentThread().interrupt(); |
97 | - }).start(); | 97 | +// }).start(); |
98 | } | 98 | } |
99 | 99 | ||
100 | @Override | 100 | @Override | ... | ... |
... | @@ -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 TITLE = "title"; | ||
52 | private static final String SHORTCUT_ENABLED = "shortcut_enabled"; | 53 | private static final String SHORTCUT_ENABLED = "shortcut_enabled"; |
53 | 54 | ||
54 | /* Member variables of the Campaign object */ | 55 | /* Member variables of the Campaign object */ |
... | @@ -57,6 +58,7 @@ public class PacingDetails { | ... | @@ -57,6 +58,7 @@ public class PacingDetails { |
57 | private boolean enabled = false; | 58 | private boolean enabled = false; |
58 | private boolean goal_reached = false; | 59 | private boolean goal_reached = false; |
59 | private String msg = ""; | 60 | private String msg = ""; |
61 | + private String title = ""; | ||
60 | private boolean shortcut_enabled = false; | 62 | private boolean shortcut_enabled = false; |
61 | 63 | ||
62 | /** | 64 | /** |
... | @@ -90,6 +92,7 @@ public class PacingDetails { | ... | @@ -90,6 +92,7 @@ public class PacingDetails { |
90 | this.goal_reached = result.optBoolean(GOAL_REACHED); | 92 | this.goal_reached = result.optBoolean(GOAL_REACHED); |
91 | this.msg = result.optString(MESSAGE); | 93 | this.msg = result.optString(MESSAGE); |
92 | this.shortcut_enabled = result.optBoolean(SHORTCUT_ENABLED); | 94 | this.shortcut_enabled = result.optBoolean(SHORTCUT_ENABLED); |
95 | + this.title = result.optString(TITLE); | ||
93 | } | 96 | } |
94 | } | 97 | } |
95 | } | 98 | } |
... | @@ -108,6 +111,7 @@ public class PacingDetails { | ... | @@ -108,6 +111,7 @@ public class PacingDetails { |
108 | jObj.putOpt(GOAL_REACHED, this.goal_reached); | 111 | jObj.putOpt(GOAL_REACHED, this.goal_reached); |
109 | jObj.putOpt(MESSAGE, this.msg); | 112 | jObj.putOpt(MESSAGE, this.msg); |
110 | jObj.putOpt(SHORTCUT_ENABLED, this.shortcut_enabled); | 113 | jObj.putOpt(SHORTCUT_ENABLED, this.shortcut_enabled); |
114 | + jObj.putOpt(TITLE, this.title); | ||
111 | } catch (JSONException e) { | 115 | } catch (JSONException e) { |
112 | if (WarpConstants.DEBUG) { | 116 | if (WarpConstants.DEBUG) { |
113 | e.printStackTrace(); | 117 | e.printStackTrace(); |
... | @@ -360,4 +364,12 @@ public class PacingDetails { | ... | @@ -360,4 +364,12 @@ public class PacingDetails { |
360 | public void setShortcut_enabled(boolean shortcut_enabled) { | 364 | public void setShortcut_enabled(boolean shortcut_enabled) { |
361 | this.shortcut_enabled = shortcut_enabled; | 365 | this.shortcut_enabled = shortcut_enabled; |
362 | } | 366 | } |
367 | + | ||
368 | + public String getTitle() { | ||
369 | + return title; | ||
370 | + } | ||
371 | + | ||
372 | + public void setTitle(String title) { | ||
373 | + this.title = title; | ||
374 | + } | ||
363 | } | 375 | } | ... | ... |
... | @@ -2165,7 +2165,7 @@ public class WarplyManager { | ... | @@ -2165,7 +2165,7 @@ public class WarplyManager { |
2165 | }); | 2165 | }); |
2166 | } | 2166 | } |
2167 | 2167 | ||
2168 | - public static void getPacingDetails(Context context, PacingDetailsRequest request, final CallbackReceiver<PacingDetails> receiver) { | 2168 | + public static void getPacingDetails(PacingDetailsRequest request, final CallbackReceiver<PacingDetails> receiver) { |
2169 | WarpUtils.log("************* WARPLY Pacing Details Request ********************"); | 2169 | WarpUtils.log("************* WARPLY Pacing Details Request ********************"); |
2170 | WarpUtils.log("[WARP Trace] WARPLY Pacing Details Request is active"); | 2170 | WarpUtils.log("[WARP Trace] WARPLY Pacing Details Request is active"); |
2171 | WarpUtils.log("**************************************************"); | 2171 | WarpUtils.log("**************************************************"); |
... | @@ -2173,15 +2173,17 @@ public class WarplyManager { | ... | @@ -2173,15 +2173,17 @@ public class WarplyManager { |
2173 | Warply.postReceiveMicroappData(true, "context", request.toJson(), new PacingDetailsHook(new CallbackReceiver<PacingDetails>() { | 2173 | Warply.postReceiveMicroappData(true, "context", request.toJson(), new PacingDetailsHook(new CallbackReceiver<PacingDetails>() { |
2174 | @Override | 2174 | @Override |
2175 | public void onSuccess(PacingDetails result) { | 2175 | public void onSuccess(PacingDetails result) { |
2176 | - if (result.isGoal_reached()) { | 2176 | +// if (context != null) { |
2177 | - new AlertDialog.Builder(context) | 2177 | +// if (result.isGoal_reached()) { |
2178 | - .setTitle(R.string.cos_dlg_success_title) | 2178 | +// new AlertDialog.Builder(context) |
2179 | - .setMessage(result.getMsg()) | 2179 | +// .setTitle(R.string.cos_dlg_success_title) |
2180 | - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { | 2180 | +// .setMessage(result.getMsg()) |
2181 | - dialogPositive.dismiss(); | 2181 | +// .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { |
2182 | - }) | 2182 | +// dialogPositive.dismiss(); |
2183 | - .show(); | 2183 | +// }) |
2184 | - } | 2184 | +// .show(); |
2185 | +// } | ||
2186 | +// } | ||
2185 | 2187 | ||
2186 | receiver.onSuccess(result); | 2188 | receiver.onSuccess(result); |
2187 | } | 2189 | } |
... | @@ -2194,7 +2196,7 @@ public class WarplyManager { | ... | @@ -2194,7 +2196,7 @@ public class WarplyManager { |
2194 | public void onSuccess(JSONObject result) { | 2196 | public void onSuccess(JSONObject result) { |
2195 | int status = result.optInt("status", 2); | 2197 | int status = result.optInt("status", 2); |
2196 | if (status == 1) | 2198 | if (status == 1) |
2197 | - getPacingDetails(context, request, receiver); | 2199 | + getPacingDetails(request, receiver); |
2198 | else | 2200 | else |
2199 | receiver.onFailure(status); | 2201 | receiver.onFailure(status); |
2200 | } | 2202 | } | ... | ... |
... | @@ -329,8 +329,20 @@ | ... | @@ -329,8 +329,20 @@ |
329 | android:ellipsize="end" | 329 | android:ellipsize="end" |
330 | android:maxLines="2" | 330 | android:maxLines="2" |
331 | android:textColor="@color/blue_dark" | 331 | android:textColor="@color/blue_dark" |
332 | + android:textIsSelectable="true" | ||
332 | android:textSize="18sp" | 333 | android:textSize="18sp" |
333 | - tools:text="961544809" /> | 334 | + tools:text="961544809" |
335 | + tools:visibility="gone" /> | ||
336 | + | ||
337 | + <com.google.android.flexbox.FlexboxLayout | ||
338 | + android:id="@+id/ll_active_deals_codes_view" | ||
339 | + android:layout_width="match_parent" | ||
340 | + android:layout_height="wrap_content" | ||
341 | + app:layout_maxHeight="60dp" | ||
342 | + android:visibility="gone" | ||
343 | + app:alignContent="flex_start" | ||
344 | + app:alignItems="flex_start" | ||
345 | + app:flexWrap="wrap"></com.google.android.flexbox.FlexboxLayout> | ||
334 | 346 | ||
335 | <TextView | 347 | <TextView |
336 | android:id="@+id/tv_active_deals_date_text" | 348 | android:id="@+id/tv_active_deals_date_text" | ... | ... |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:tools="http://schemas.android.com/tools" | ||
4 | + android:layout_width="wrap_content" | ||
5 | + android:layout_height="wrap_content" | ||
6 | + android:orientation="horizontal"> | ||
7 | + | ||
8 | + <TextView | ||
9 | + android:id="@+id/tv_code_copy" | ||
10 | + fontPath="fonts/pf_square_sans_pro_medium.ttf" | ||
11 | + android:layout_width="wrap_content" | ||
12 | + android:layout_height="wrap_content" | ||
13 | + android:background="@android:color/transparent" | ||
14 | + android:textColor="@color/grey" | ||
15 | + android:textSize="16sp" | ||
16 | + tools:text="6987654322" /> | ||
17 | + | ||
18 | + <TextView | ||
19 | + android:id="@+id/tv_code_comma" | ||
20 | + fontPath="fonts/pf_square_sans_pro_medium.ttf" | ||
21 | + android:layout_width="wrap_content" | ||
22 | + android:layout_height="wrap_content" | ||
23 | + android:background="@android:color/transparent" | ||
24 | + android:textColor="@color/grey" | ||
25 | + android:textSize="16sp" | ||
26 | + tools:text="@string/cos_comma" /> | ||
27 | +</LinearLayout> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -135,6 +135,7 @@ | ... | @@ -135,6 +135,7 @@ |
135 | <string name="cos_mfy_other">ΆΛΛΕΣ</string> | 135 | <string name="cos_mfy_other">ΆΛΛΕΣ</string> |
136 | <string name="cos_coupon_share_telco">Επιλογή σύνδεσης</string> | 136 | <string name="cos_coupon_share_telco">Επιλογή σύνδεσης</string> |
137 | <string name="cos_steps_for_good_notification_subtitle">Περπάτησε κάθε μέρα περισσότερο για να ολοκληρώσεις το στόχο του μήνα και να ξεκλειδώσεις μοναδικές προσφορές!</string> | 137 | <string name="cos_steps_for_good_notification_subtitle">Περπάτησε κάθε μέρα περισσότερο για να ολοκληρώσεις το στόχο του μήνα και να ξεκλειδώσεις μοναδικές προσφορές!</string> |
138 | + <string name="cos_comma">,</string> | ||
138 | 139 | ||
139 | <string-array name="coupons_array"> | 140 | <string-array name="coupons_array"> |
140 | <item>Κουπόνια</item> | 141 | <item>Κουπόνια</item> | ... | ... |
-
Please register or login to post a comment