Panagiotis Triantafyllou

new keys

...@@ -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.6rc4' 5 + PUBLISH_VERSION = '4.5.4.6rc5'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 7 }
8 8
...@@ -45,7 +45,8 @@ dependencies { ...@@ -45,7 +45,8 @@ dependencies {
45 implementation 'androidx.appcompat:appcompat:1.4.1' 45 implementation 'androidx.appcompat:appcompat:1.4.1'
46 implementation 'androidx.recyclerview:recyclerview:1.2.1' 46 implementation 'androidx.recyclerview:recyclerview:1.2.1'
47 implementation 'androidx.cardview:cardview:1.0.0' 47 implementation 'androidx.cardview:cardview:1.0.0'
48 - api "androidx.security:security-crypto:1.1.0-alpha03" // For minSDK 23 use 1.0.0, for minSDK 21 use 1.1.0 that is currently in alpha 48 + api "androidx.security:security-crypto:1.1.0-alpha03"
49 + // For minSDK 23 use 1.0.0, for minSDK 21 use 1.1.0 that is currently in alpha
49 api 'org.altbeacon:android-beacon-library:2.19.3' 50 api 'org.altbeacon:android-beacon-library:2.19.3'
50 api 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' 51 api 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
51 implementation 'de.hdodenhof:circleimageview:3.1.0' 52 implementation 'de.hdodenhof:circleimageview:3.1.0'
...@@ -59,12 +60,14 @@ dependencies { ...@@ -59,12 +60,14 @@ dependencies {
59 60
60 //------------------------------ Firebase -----------------------------// 61 //------------------------------ Firebase -----------------------------//
61 api platform('com.google.firebase:firebase-bom:29.0.3') 62 api platform('com.google.firebase:firebase-bom:29.0.3')
62 - implementation 'com.google.firebase:firebase-messaging' 63 + implementation('com.google.firebase:firebase-messaging') {
64 + exclude group: 'com.google.android.gms', module: 'play-services-location'
65 + }
63 66
64 //------------------------------ GMS -----------------------------// 67 //------------------------------ GMS -----------------------------//
65 api 'com.google.android.gms:play-services-base:18.1.0' 68 api 'com.google.android.gms:play-services-base:18.1.0'
66 - implementation 'com.google.android.gms:play-services-location:21.0.0' 69 + implementation 'com.google.android.gms:play-services-location:19.0.1'
67 - implementation 'com.google.android.gms:play-services-maps:18.1.0' 70 + implementation 'com.google.android.gms:play-services-maps:18.0.2'
68 api 'com.google.maps.android:android-maps-utils:0.5' 71 api 'com.google.maps.android:android-maps-utils:0.5'
69 72
70 //------------------------------ Work Manager -----------------------------// 73 //------------------------------ Work Manager -----------------------------//
......
...@@ -225,16 +225,18 @@ public class ContextualActivity extends Activity implements View.OnClickListener ...@@ -225,16 +225,18 @@ public class ContextualActivity extends Activity implements View.OnClickListener
225 } 225 }
226 226
227 private void askActivateDialog() { 227 private void askActivateDialog() {
228 - mAlertDialogAskActivate = new AlertDialog.Builder(this) 228 + if (!isFinishing()) {
229 - .setTitle(R.string.cos_dlg_activate_telco_title) 229 + mAlertDialogAskActivate = new AlertDialog.Builder(this)
230 - .setMessage(R.string.cos_dlg_activate_telco_subtitle) 230 + .setTitle(R.string.cos_dlg_activate_telco_title)
231 - .setPositiveButton(R.string.cos_dlg_positive_button, (dialogPositive, whichPositive) -> { 231 + .setMessage(R.string.cos_dlg_activate_telco_subtitle)
232 - activateGift(); 232 + .setPositiveButton(R.string.cos_dlg_positive_button, (dialogPositive, whichPositive) -> {
233 - }) 233 + activateGift();
234 - .setNegativeButton(R.string.cos_dlg_negative_button2, (dialogNegative, whichNegative) -> { 234 + })
235 - dialogNegative.dismiss(); 235 + .setNegativeButton(R.string.cos_dlg_negative_button2, (dialogNegative, whichNegative) -> {
236 - }) 236 + dialogNegative.dismiss();
237 - .show(); 237 + })
238 + .show();
239 + }
238 } 240 }
239 241
240 private void errorActivatingDialog() { 242 private void errorActivatingDialog() {
...@@ -264,13 +266,15 @@ public class ContextualActivity extends Activity implements View.OnClickListener ...@@ -264,13 +266,15 @@ public class ContextualActivity extends Activity implements View.OnClickListener
264 analyticsEvent.setParameter("successful", "true"); 266 analyticsEvent.setParameter("successful", "true");
265 EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); 267 EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
266 268
267 - mAlertDialogSuccessActivating = new AlertDialog.Builder(this) 269 + if (!isFinishing()) {
268 - .setTitle(R.string.cos_dlg_activate_success_title) 270 + mAlertDialogSuccessActivating = new AlertDialog.Builder(this)
269 - .setMessage(R.string.cos_dlg_activate_success_subtitle) 271 + .setTitle(R.string.cos_dlg_activate_success_title)
270 - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { 272 + .setMessage(R.string.cos_dlg_activate_success_subtitle)
271 - dialogPositive.dismiss(); 273 + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
272 - }) 274 + dialogPositive.dismiss();
273 - .show(); 275 + })
276 + .show();
277 + }
274 } 278 }
275 279
276 // =========================================================== 280 // ===========================================================
......
...@@ -216,84 +216,96 @@ public class CouponShareActivity extends Activity implements View.OnClickListene ...@@ -216,84 +216,96 @@ public class CouponShareActivity extends Activity implements View.OnClickListene
216 } 216 }
217 217
218 private void acceptSharingDialog() { 218 private void acceptSharingDialog() {
219 - mAlertDialogSuccessSharing = new AlertDialog.Builder(this) 219 + if (!isFinishing()) {
220 - .setTitle(R.string.cos_dlg_success_title) 220 + mAlertDialogSuccessSharing = new AlertDialog.Builder(this)
221 - .setMessage(R.string.cos_dlg_positive_coupon_text) 221 + .setTitle(R.string.cos_dlg_success_title)
222 - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { 222 + .setMessage(R.string.cos_dlg_positive_coupon_text)
223 - dialogPositive.dismiss(); 223 + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
224 - if (mIsFromWallet) { 224 + dialogPositive.dismiss();
225 - setResult(RESULT_OK, new Intent()); 225 + if (mIsFromWallet) {
226 - onBackPressed(); 226 + setResult(RESULT_OK, new Intent());
227 - } 227 + onBackPressed();
228 - }) 228 + }
229 - .show(); 229 + })
230 + .show();
231 + }
230 } 232 }
231 233
232 private void errorSharingDialog() { 234 private void errorSharingDialog() {
233 - mAlertDialogErrorSharing = new AlertDialog.Builder(this) 235 + if (!isFinishing()) {
234 - .setTitle(R.string.cos_dlg_error_title) 236 + mAlertDialogErrorSharing = new AlertDialog.Builder(this)
235 - .setMessage(R.string.cos_dlg_error_subtitle) 237 + .setTitle(R.string.cos_dlg_error_title)
236 - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { 238 + .setMessage(R.string.cos_dlg_error_subtitle)
237 - dialogPositive.dismiss(); 239 + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
238 - }) 240 + dialogPositive.dismiss();
239 - .show(); 241 + })
242 + .show();
243 + }
240 } 244 }
241 245
242 private void wrongNumberDialog(String message) { 246 private void wrongNumberDialog(String message) {
243 - mAlertDialogWrongNumberSharing = new AlertDialog.Builder(this) 247 + if (!isFinishing()) {
244 - .setTitle(R.string.cos_dlg_error_title) 248 + mAlertDialogWrongNumberSharing = new AlertDialog.Builder(this)
245 - .setMessage(message) 249 + .setTitle(R.string.cos_dlg_error_title)
246 - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { 250 + .setMessage(message)
247 - dialogPositive.dismiss(); 251 + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
248 - }) 252 + dialogPositive.dismiss();
249 - .show(); 253 + })
254 + .show();
255 + }
250 } 256 }
251 257
252 private void errorSharingDialog2() { 258 private void errorSharingDialog2() {
253 - mAlertDialogErrorSharing = new AlertDialog.Builder(this) 259 + if (!isFinishing()) {
254 - .setTitle(R.string.cos_dlg_error_title2) 260 + mAlertDialogErrorSharing = new AlertDialog.Builder(this)
255 - .setMessage(R.string.cos_dlg_error_subtitle2) 261 + .setTitle(R.string.cos_dlg_error_title2)
256 - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { 262 + .setMessage(R.string.cos_dlg_error_subtitle2)
257 - dialogPositive.dismiss(); 263 + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
258 - }) 264 + dialogPositive.dismiss();
259 - .show(); 265 + })
266 + .show();
267 + }
260 } 268 }
261 269
262 private void showNoAssetsDialog() { 270 private void showNoAssetsDialog() {
263 - mAlertDialogNoAssets = new AlertDialog.Builder(this) 271 + if (!isFinishing()) {
264 - .setTitle(R.string.cos_coupon_gift) 272 + mAlertDialogNoAssets = new AlertDialog.Builder(this)
265 - .setMessage(R.string.cos_share_no_assets) 273 + .setTitle(R.string.cos_coupon_gift)
266 - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { 274 + .setMessage(R.string.cos_share_no_assets)
267 - dialogPositive.dismiss(); 275 + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
268 - onBackPressed(); 276 + dialogPositive.dismiss();
269 - }) 277 + onBackPressed();
270 - .show(); 278 + })
279 + .show();
280 + }
271 } 281 }
272 282
273 private void askSharingDialog() { 283 private void askSharingDialog() {
274 - mAlertDialogCouponAskSharing = new AlertDialog.Builder(this) 284 + if (!isFinishing()) {
275 - .setTitle(R.string.cos_dlg_positive_coupon_title) 285 + mAlertDialogCouponAskSharing = new AlertDialog.Builder(this)
276 - .setMessage(R.string.cos_dlg_positive_coupon_subtitle) 286 + .setTitle(R.string.cos_dlg_positive_coupon_title)
277 - .setPositiveButton(R.string.cos_dlg_negative_button3, (dialogPositive, whichPositive) -> { 287 + .setMessage(R.string.cos_dlg_positive_coupon_subtitle)
278 - WarplyAnalyticsManager.logTrackersEvent(this, "click", ("ShareCoupon") 288 + .setPositiveButton(R.string.cos_dlg_negative_button3, (dialogPositive, whichPositive) -> {
279 - .concat(":") 289 + WarplyAnalyticsManager.logTrackersEvent(this, "click", ("ShareCoupon")
280 - .concat(mCoupon.getName())); 290 + .concat(":")
281 - 291 + .concat(mCoupon.getName()));
282 - new Thread(() -> { 292 +
283 - if (!Thread.currentThread().isInterrupted()) { 293 + new Thread(() -> {
284 - WarplyManager.cosmoteCouponSharing(new CosmoteCouponSharingRequest() 294 + if (!Thread.currentThread().isInterrupted()) {
285 - .setCoupon(mCoupon.getCoupon()) 295 + WarplyManager.cosmoteCouponSharing(new CosmoteCouponSharingRequest()
286 - .setSender(mSender) 296 + .setCoupon(mCoupon.getCoupon())
287 - .setReceiver(mEdtReceiver.getText().toString()) 297 + .setSender(mSender)
288 - , mCouponSharingCallback); 298 + .setReceiver(mEdtReceiver.getText().toString())
289 - } 299 + , mCouponSharingCallback);
290 - Thread.currentThread().interrupt(); 300 + }
291 - }).start(); 301 + Thread.currentThread().interrupt();
292 - }) 302 + }).start();
293 - .setNegativeButton(R.string.cos_dlg_negative_button2, (dialogNegative, whichNegative) -> { 303 + })
294 - dialogNegative.dismiss(); 304 + .setNegativeButton(R.string.cos_dlg_negative_button2, (dialogNegative, whichNegative) -> {
295 - }) 305 + dialogNegative.dismiss();
296 - .show(); 306 + })
307 + .show();
308 + }
297 } 309 }
298 310
299 private final CallbackReceiver<Consumer> mConsumerCallback = new CallbackReceiver<Consumer>() { 311 private final CallbackReceiver<Consumer> mConsumerCallback = new CallbackReceiver<Consumer>() {
......
...@@ -236,17 +236,19 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe ...@@ -236,17 +236,19 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
236 analyticsEvent.setParameter("successful", "true"); 236 analyticsEvent.setParameter("successful", "true");
237 EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); 237 EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
238 238
239 - mAlertDialogCouponset = new AlertDialog.Builder(this) 239 + if (!isFinishing()) {
240 - .setTitle(R.string.cos_dlg_success_couponset_title) 240 + mAlertDialogCouponset = new AlertDialog.Builder(this)
241 - .setMessage(R.string.cos_dlg_success_couponset_subtitle) 241 + .setTitle(R.string.cos_dlg_success_couponset_title)
242 - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { 242 + .setMessage(R.string.cos_dlg_success_couponset_subtitle)
243 - dialogPositive.dismiss(); 243 + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
244 - if (success) { 244 + dialogPositive.dismiss();
245 + if (success) {
245 // setResult(RESULT_OK, new Intent()); 246 // setResult(RESULT_OK, new Intent());
246 - onBackPressed(); 247 + onBackPressed();
247 - } 248 + }
248 - }) 249 + })
249 - .show(); 250 + .show();
251 + }
250 } else { 252 } else {
251 LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel(); 253 LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
252 analyticsEvent.setEventName("loyalty_offer_activated"); 254 analyticsEvent.setEventName("loyalty_offer_activated");
...@@ -256,51 +258,61 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe ...@@ -256,51 +258,61 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
256 EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); 258 EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
257 259
258 if (status == 3) { 260 if (status == 3) {
259 - mAlertDialogCouponset = new AlertDialog.Builder(this) 261 + if (!isFinishing()) {
260 - .setTitle(R.string.cos_dlg_error_title) 262 + mAlertDialogCouponset = new AlertDialog.Builder(this)
261 - .setMessage(R.string.cos_dlg_error_subtitle_non_buyable) 263 + .setTitle(R.string.cos_dlg_error_title)
262 - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { 264 + .setMessage(R.string.cos_dlg_error_subtitle_non_buyable)
263 - dialogPositive.dismiss(); 265 + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
264 - }) 266 + dialogPositive.dismiss();
265 - .show(); 267 + })
268 + .show();
269 + }
266 } else if (status == 5) { 270 } else if (status == 5) {
267 - mAlertDialogCouponset = new AlertDialog.Builder(this) 271 + if (!isFinishing()) {
268 - .setTitle(R.string.cos_dlg_error_title) 272 + mAlertDialogCouponset = new AlertDialog.Builder(this)
269 - .setMessage(R.string.cos_dlg_error_subtitle_no_points) 273 + .setTitle(R.string.cos_dlg_error_title)
270 - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { 274 + .setMessage(R.string.cos_dlg_error_subtitle_no_points)
271 - dialogPositive.dismiss(); 275 + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
272 - }) 276 + dialogPositive.dismiss();
273 - .show(); 277 + })
278 + .show();
279 + }
274 } else if (status == 6) { 280 } else if (status == 6) {
275 - mAlertDialogCouponset = new AlertDialog.Builder(this) 281 + if (!isFinishing()) {
276 - .setTitle(R.string.cos_dlg_coupon_depleted_title) 282 + mAlertDialogCouponset = new AlertDialog.Builder(this)
277 - .setMessage(R.string.cos_dlg_coupon_depleted_message) 283 + .setTitle(R.string.cos_dlg_coupon_depleted_title)
278 - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { 284 + .setMessage(R.string.cos_dlg_coupon_depleted_message)
279 - dialogPositive.dismiss(); 285 + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
280 - }) 286 + dialogPositive.dismiss();
281 - .show(); 287 + })
288 + .show();
289 + }
282 } else { 290 } else {
283 - mAlertDialogCouponset = new AlertDialog.Builder(this) 291 + if (!isFinishing()) {
284 - .setTitle(R.string.cos_dlg_error_title) 292 + mAlertDialogCouponset = new AlertDialog.Builder(this)
285 - .setMessage(R.string.cos_dlg_error_subtitle) 293 + .setTitle(R.string.cos_dlg_error_title)
286 - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { 294 + .setMessage(R.string.cos_dlg_error_subtitle)
287 - dialogPositive.dismiss(); 295 + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
288 - }) 296 + dialogPositive.dismiss();
289 - .show(); 297 + })
298 + .show();
299 + }
290 } 300 }
291 } 301 }
292 } 302 }
293 303
294 private void nonTelcoDialog() { 304 private void nonTelcoDialog() {
295 - mAlertDialogNonTelco = new AlertDialog.Builder(this) 305 + if (!isFinishing()) {
296 - .setTitle(R.string.cos_dlg_non_telco_title) 306 + mAlertDialogNonTelco = new AlertDialog.Builder(this)
297 - .setMessage(R.string.cos_dlg_non_telco) 307 + .setTitle(R.string.cos_dlg_non_telco_title)
298 - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { 308 + .setMessage(R.string.cos_dlg_non_telco)
299 - dialogPositive.dismiss(); 309 + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
300 - onBackPressed(); 310 + dialogPositive.dismiss();
301 - }) 311 + onBackPressed();
302 - .setCancelable(false) 312 + })
303 - .show(); 313 + .setCancelable(false)
314 + .show();
315 + }
304 } 316 }
305 317
306 // =========================================================== 318 // ===========================================================
......
...@@ -514,15 +514,17 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -514,15 +514,17 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
514 } 514 }
515 515
516 private void nonTelcoDialog() { 516 private void nonTelcoDialog() {
517 - mAlertDialogNonTelco = new AlertDialog.Builder(this) 517 + if (!isFinishing()) {
518 - .setTitle(R.string.cos_dlg_non_telco_title) 518 + mAlertDialogNonTelco = new AlertDialog.Builder(this)
519 - .setMessage(R.string.cos_dlg_non_telco) 519 + .setTitle(R.string.cos_dlg_non_telco_title)
520 - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { 520 + .setMessage(R.string.cos_dlg_non_telco)
521 - dialogPositive.dismiss(); 521 + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
522 - onBackPressed(); 522 + dialogPositive.dismiss();
523 - }) 523 + onBackPressed();
524 - .setCancelable(false) 524 + })
525 - .show(); 525 + .setCancelable(false)
526 + .show();
527 + }
526 } 528 }
527 529
528 // =========================================================== 530 // ===========================================================
......
...@@ -265,20 +265,22 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe ...@@ -265,20 +265,22 @@ public class ShopsActivity extends FragmentActivity implements View.OnClickListe
265 // =========================================================== 265 // ===========================================================
266 266
267 private void showNoShopsAvailableDialog() { 267 private void showNoShopsAvailableDialog() {
268 - mAlertDialogNoShopsAvailable = new AlertDialog.Builder(this) 268 + if (!isFinishing()) {
269 - .setTitle(R.string.cos_dlg_no_shops_title) 269 + mAlertDialogNoShopsAvailable = new AlertDialog.Builder(this)
270 - .setMessage(R.string.cos_dlg_no_shops) 270 + .setTitle(R.string.cos_dlg_no_shops_title)
271 - .setCancelable(false) 271 + .setMessage(R.string.cos_dlg_no_shops)
272 - .setPositiveButton(R.string.cos_dlg_no_shops_positive, (dialogPositive, whichPositive) -> { 272 + .setCancelable(false)
273 - dialogPositive.dismiss(); 273 + .setPositiveButton(R.string.cos_dlg_no_shops_positive, (dialogPositive, whichPositive) -> {
274 - openWebsite(); 274 + dialogPositive.dismiss();
275 - 275 + openWebsite();
276 - }) 276 +
277 - .setNegativeButton(R.string.cos_dlg_negative_button2, (dialogNegative, whichNegative) -> { 277 + })
278 - dialogNegative.dismiss(); 278 + .setNegativeButton(R.string.cos_dlg_negative_button2, (dialogNegative, whichNegative) -> {
279 - onBackPressed(); 279 + dialogNegative.dismiss();
280 - }) 280 + onBackPressed();
281 - .show(); 281 + })
282 + .show();
283 + }
282 } 284 }
283 285
284 private void openWebsite() { 286 private void openWebsite() {
......
...@@ -259,16 +259,18 @@ public class TelcoActivity extends Activity implements View.OnClickListener { ...@@ -259,16 +259,18 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
259 } 259 }
260 260
261 private void askActivateDialog() { 261 private void askActivateDialog() {
262 - mAlertDialogAskActivate = new AlertDialog.Builder(this) 262 + if (!isFinishing()) {
263 - .setTitle(R.string.cos_dlg_activate_telco_title) 263 + mAlertDialogAskActivate = new AlertDialog.Builder(this)
264 - .setMessage(R.string.cos_dlg_activate_telco_subtitle) 264 + .setTitle(R.string.cos_dlg_activate_telco_title)
265 - .setPositiveButton(R.string.cos_dlg_positive_button, (dialogPositive, whichPositive) -> { 265 + .setMessage(R.string.cos_dlg_activate_telco_subtitle)
266 - activateGift(); 266 + .setPositiveButton(R.string.cos_dlg_positive_button, (dialogPositive, whichPositive) -> {
267 - }) 267 + activateGift();
268 - .setNegativeButton(R.string.cos_dlg_negative_button2, (dialogNegative, whichNegative) -> { 268 + })
269 - dialogNegative.dismiss(); 269 + .setNegativeButton(R.string.cos_dlg_negative_button2, (dialogNegative, whichNegative) -> {
270 - }) 270 + dialogNegative.dismiss();
271 - .show(); 271 + })
272 + .show();
273 + }
272 } 274 }
273 275
274 private void errorActivatingDialog() { 276 private void errorActivatingDialog() {
...@@ -279,13 +281,15 @@ public class TelcoActivity extends Activity implements View.OnClickListener { ...@@ -279,13 +281,15 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
279 analyticsEvent.setParameter("successful", "false"); 281 analyticsEvent.setParameter("successful", "false");
280 EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); 282 EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
281 283
282 - mAlertDialogErrorActivating = new AlertDialog.Builder(this) 284 + if (!isFinishing()) {
283 - .setTitle(R.string.cos_dlg_error_title) 285 + mAlertDialogErrorActivating = new AlertDialog.Builder(this)
284 - .setMessage(R.string.cos_dlg_error_subtitle) 286 + .setTitle(R.string.cos_dlg_error_title)
285 - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { 287 + .setMessage(R.string.cos_dlg_error_subtitle)
286 - dialogPositive.dismiss(); 288 + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
287 - }) 289 + dialogPositive.dismiss();
288 - .show(); 290 + })
291 + .show();
292 + }
289 } 293 }
290 294
291 private void successActivatingDialog() { 295 private void successActivatingDialog() {
...@@ -296,13 +300,15 @@ public class TelcoActivity extends Activity implements View.OnClickListener { ...@@ -296,13 +300,15 @@ public class TelcoActivity extends Activity implements View.OnClickListener {
296 analyticsEvent.setParameter("successful", "true"); 300 analyticsEvent.setParameter("successful", "true");
297 EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); 301 EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
298 302
299 - mAlertDialogSuccessActivating = new AlertDialog.Builder(this) 303 + if (!isFinishing()) {
300 - .setTitle(R.string.cos_dlg_activate_success_title) 304 + mAlertDialogSuccessActivating = new AlertDialog.Builder(this)
301 - .setMessage(R.string.cos_dlg_activate_success_subtitle) 305 + .setTitle(R.string.cos_dlg_activate_success_title)
302 - .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> { 306 + .setMessage(R.string.cos_dlg_activate_success_subtitle)
303 - dialogPositive.dismiss(); 307 + .setPositiveButton(R.string.cos_dlg_positive_button2, (dialogPositive, whichPositive) -> {
304 - }) 308 + dialogPositive.dismiss();
305 - .show(); 309 + })
310 + .show();
311 + }
306 } 312 }
307 313
308 // =========================================================== 314 // ===========================================================
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
16 android:layout_width="48dp" 16 android:layout_width="48dp"
17 android:layout_height="48dp" 17 android:layout_height="48dp"
18 android:layout_marginStart="16dp" 18 android:layout_marginStart="16dp"
19 - android:src="@drawable/ic_back"
20 android:scaleType="centerInside" 19 android:scaleType="centerInside"
20 + android:src="@drawable/ic_back"
21 app:layout_constraintBottom_toBottomOf="parent" 21 app:layout_constraintBottom_toBottomOf="parent"
22 app:layout_constraintStart_toStartOf="parent" 22 app:layout_constraintStart_toStartOf="parent"
23 app:layout_constraintTop_toTopOf="parent" /> 23 app:layout_constraintTop_toTopOf="parent" />
...@@ -39,160 +39,134 @@ ...@@ -39,160 +39,134 @@
39 android:layout_width="match_parent" 39 android:layout_width="match_parent"
40 android:layout_height="match_parent" 40 android:layout_height="match_parent"
41 android:layout_below="@+id/cl_loyalty_wallet_header" 41 android:layout_below="@+id/cl_loyalty_wallet_header"
42 + android:background="@android:color/white"
42 android:fillViewport="true"> 43 android:fillViewport="true">
43 44
44 - <RelativeLayout 45 + <LinearLayout
46 + android:id="@+id/cl_loyalty_info_view_inner"
45 android:layout_width="match_parent" 47 android:layout_width="match_parent"
46 - android:layout_height="match_parent" 48 + android:layout_height="wrap_content"
47 - android:background="@android:color/white"> 49 + android:background="@android:color/white"
50 + android:gravity="center_horizontal"
51 + android:orientation="vertical"
52 + android:paddingBottom="48dp">
48 53
49 - <!-- android:background="@drawable/shape_cos_loyalty_white"--> 54 + <ImageView
50 - <androidx.constraintlayout.widget.ConstraintLayout 55 + android:id="@+id/imageView6"
51 - android:id="@+id/cl_loyalty_info_view_inner"
52 android:layout_width="match_parent" 56 android:layout_width="match_parent"
53 - android:layout_height="match_parent" 57 + android:layout_height="253dp"
54 - app:layout_constraintEnd_toEndOf="parent" 58 + android:layout_marginTop="0.5dp"
55 - app:layout_constraintStart_toStartOf="parent" 59 + android:scaleType="centerCrop"
56 - app:layout_constraintTop_toTopOf="parent"> 60 + tools:src="@drawable/carousel_banner" />
57 - 61 +
58 - <ImageView 62 + <TextView
59 - android:id="@+id/imageView6" 63 + android:id="@+id/textView13"
60 - android:layout_width="match_parent" 64 + fontPath="fonts/pf_square_sans_pro_medium.ttf"
61 - android:layout_height="253dp" 65 + android:layout_width="match_parent"
62 - android:layout_marginTop="0.5dp" 66 + android:layout_height="wrap_content"
63 - android:scaleType="centerCrop" 67 + android:layout_marginTop="32dp"
64 - app:layout_constraintStart_toStartOf="parent" 68 + android:gravity="center"
65 - app:layout_constraintTop_toTopOf="parent" 69 + android:paddingHorizontal="32dp"
66 - tools:src="@drawable/carousel_banner" /> 70 + android:textColor="#415564"
67 - 71 + android:textSize="18sp"
68 - <LinearLayout 72 + tools:text="Πάρε δωρεάν μηνιαία πακέτα με πάνες στα supermarket Σκλαβενίτης!" />
69 - android:layout_width="match_parent" 73 +
70 - android:layout_height="wrap_content" 74 + <TextView
71 - android:background="@drawable/ic_line" 75 + android:id="@+id/textView14"
72 - app:layout_constraintEnd_toEndOf="parent" 76 + fontPath="fonts/pf_square_sans_pro_regular.ttf"
73 - app:layout_constraintStart_toStartOf="parent" 77 + android:layout_width="match_parent"
74 - app:layout_constraintTop_toTopOf="@+id/imageView6"> 78 + android:layout_height="wrap_content"
75 - 79 + android:layout_marginTop="16dp"
76 - </LinearLayout> 80 + android:gravity="center"
81 + android:paddingHorizontal="32dp"
82 + android:textColor="#415564"
83 + android:textSize="16sp"
84 + tools:text="Χρησιμοποίησε τον παρακάτω κωδικό και πάρε δωρεάν πακέτο πάνες Pampers αποκλειστικά στα Supermarket Σκλαβενίτης" />
85 +
86 + <LinearLayout
87 + android:id="@+id/ll_get_gift"
88 + android:layout_width="240dp"
89 + android:layout_height="50dp"
90 + android:layout_marginHorizontal="32dp"
91 + android:layout_marginTop="@dimen/marginTop"
92 + android:background="@drawable/selector_button_green"
93 + android:gravity="center"
94 + android:orientation="horizontal">
77 95
78 <TextView 96 <TextView
79 - android:id="@+id/textView13"
80 fontPath="fonts/pf_square_sans_pro_medium.ttf" 97 fontPath="fonts/pf_square_sans_pro_medium.ttf"
81 - android:layout_width="match_parent" 98 + android:layout_width="wrap_content"
82 - android:layout_height="wrap_content"
83 - android:layout_marginTop="32dp"
84 - android:gravity="center"
85 - android:paddingHorizontal="32dp"
86 - android:textColor="#415564"
87 - android:textSize="18sp"
88 - app:layout_constraintEnd_toEndOf="parent"
89 - app:layout_constraintHorizontal_bias="0.509"
90 - app:layout_constraintStart_toStartOf="parent"
91 - app:layout_constraintTop_toBottomOf="@+id/imageView6"
92 - tools:text="Πάρε δωρεάν μηνιαία πακέτα με πάνες στα supermarket Σκλαβενίτης!" />
93 -
94 - <TextView
95 - android:id="@+id/textView14"
96 - fontPath="fonts/pf_square_sans_pro_regular.ttf"
97 - android:layout_width="match_parent"
98 android:layout_height="wrap_content" 99 android:layout_height="wrap_content"
99 - android:layout_marginTop="16dp"
100 android:gravity="center" 100 android:gravity="center"
101 - android:paddingHorizontal="32dp" 101 + android:text="@string/cos_redeem_coupon"
102 - android:textColor="#415564" 102 + android:textColor="@color/white"
103 - android:textSize="16sp" 103 + android:textSize="17dp" />
104 - app:layout_constraintEnd_toEndOf="parent" 104 + </LinearLayout>
105 - app:layout_constraintStart_toStartOf="parent" 105 +
106 - app:layout_constraintTop_toBottomOf="@+id/textView13" 106 + <RelativeLayout
107 - tools:text="Χρησιμοποίησε τον παρακάτω κωδικό και πάρε δωρεάν πακέτο πάνες Pampers αποκλειστικά στα Supermarket Σκλαβενίτης" /> 107 + android:id="@+id/rl_terms"
108 + android:layout_width="wrap_content"
109 + android:layout_height="wrap_content"
110 + android:layout_marginTop="32dp"
111 + android:gravity="center">
108 112
109 <LinearLayout 113 <LinearLayout
110 - android:id="@+id/ll_get_gift" 114 + android:id="@+id/ll_terms_inner"
111 - android:layout_width="240dp" 115 + android:layout_width="wrap_content"
112 - android:layout_height="50dp" 116 + android:layout_height="wrap_content"
113 - android:layout_marginHorizontal="32dp" 117 + android:layout_centerHorizontal="true"
114 - android:layout_marginBottom="32dp"
115 - android:background="@drawable/selector_button_green"
116 android:gravity="center" 118 android:gravity="center"
117 - android:orientation="horizontal" 119 + android:orientation="horizontal">
118 - app:layout_constraintBottom_toTopOf="@+id/rl_terms"
119 - app:layout_constraintEnd_toEndOf="parent"
120 - app:layout_constraintStart_toStartOf="parent">
121 120
122 <TextView 121 <TextView
122 + android:id="@+id/tv_terms"
123 fontPath="fonts/pf_square_sans_pro_medium.ttf" 123 fontPath="fonts/pf_square_sans_pro_medium.ttf"
124 android:layout_width="wrap_content" 124 android:layout_width="wrap_content"
125 android:layout_height="wrap_content" 125 android:layout_height="wrap_content"
126 - android:gravity="center" 126 + android:text="@string/cos_coupon_terms_title"
127 - android:text="@string/cos_redeem_coupon" 127 + android:textColor="@color/grey"
128 - android:textColor="@color/white" 128 + android:textSize="16sp" />
129 - android:textSize="17dp" /> 129 +
130 + <ImageView
131 + android:id="@+id/iv_terms_arrow"
132 + android:layout_width="14dp"
133 + android:layout_height="14dp"
134 + android:layout_marginStart="6dp"
135 + android:src="@drawable/ic_down_dark_new" />
130 </LinearLayout> 136 </LinearLayout>
131 137
132 - <RelativeLayout 138 + <TextView
133 - android:id="@+id/rl_terms" 139 + android:id="@+id/tv_terms_value"
140 + fontPath="fonts/pf_square_sans_pro_regular.ttf"
134 android:layout_width="wrap_content" 141 android:layout_width="wrap_content"
135 android:layout_height="wrap_content" 142 android:layout_height="wrap_content"
136 - android:layout_marginVertical="32dp" 143 + android:layout_below="@+id/ll_terms_inner"
137 - android:gravity="center" 144 + android:layout_marginHorizontal="64dp"
138 - app:layout_constraintBottom_toBottomOf="parent" 145 + android:layout_marginTop="16dp"
139 - app:layout_constraintEnd_toEndOf="parent" 146 + android:textColor="@color/grey"
140 - app:layout_constraintStart_toStartOf="parent">
141 -
142 - <LinearLayout
143 - android:id="@+id/ll_terms_inner"
144 - android:layout_width="wrap_content"
145 - android:layout_height="wrap_content"
146 - android:layout_centerHorizontal="true"
147 - android:gravity="center"
148 - android:orientation="horizontal">
149 -
150 - <TextView
151 - android:id="@+id/tv_terms"
152 - fontPath="fonts/pf_square_sans_pro_medium.ttf"
153 - android:layout_width="wrap_content"
154 - android:layout_height="wrap_content"
155 - android:text="@string/cos_coupon_terms_title"
156 - android:textColor="@color/grey"
157 - android:textSize="16sp" />
158 -
159 - <ImageView
160 - android:id="@+id/iv_terms_arrow"
161 - android:layout_width="14dp"
162 - android:layout_height="14dp"
163 - android:layout_marginStart="6dp"
164 - android:layout_marginTop="2dp"
165 - android:src="@drawable/ic_down_dark_new" />
166 - </LinearLayout>
167 -
168 - <TextView
169 - android:id="@+id/tv_terms_value"
170 - fontPath="fonts/pf_square_sans_pro_regular.ttf"
171 - android:layout_width="wrap_content"
172 - android:layout_height="wrap_content"
173 - android:layout_below="@+id/ll_terms_inner"
174 - android:layout_marginTop="16dp"
175 - android:layout_marginHorizontal="64dp"
176 - android:textColor="@color/grey"
177 - android:visibility="gone"
178 - tools:text="@string/cos_coupon_date"
179 - tools:visibility="visible" />
180 - </RelativeLayout>
181 -
182 - <ProgressBar
183 - android:id="@+id/pb_loading"
184 - android:layout_width="48dp"
185 - android:layout_height="48dp"
186 - android:indeterminate="true"
187 - android:indeterminateTint="@color/cos_green5"
188 - android:indeterminateTintMode="src_atop"
189 android:visibility="gone" 147 android:visibility="gone"
190 - app:layout_constraintBottom_toBottomOf="parent" 148 + tools:text="@string/cos_coupon_date"
191 - app:layout_constraintEnd_toEndOf="parent" 149 + tools:visibility="gone" />
192 - app:layout_constraintStart_toStartOf="parent" 150 + </RelativeLayout>
193 - app:layout_constraintTop_toTopOf="parent" 151 + </LinearLayout>
194 - tools:visibility="visible" />
195 - </androidx.constraintlayout.widget.ConstraintLayout>
196 - </RelativeLayout>
197 </ScrollView> 152 </ScrollView>
153 +
154 + <LinearLayout
155 + android:layout_width="match_parent"
156 + android:layout_height="wrap_content"
157 + android:layout_marginTop="48dp"
158 + android:background="@drawable/ic_line">
159 +
160 + </LinearLayout>
161 +
162 + <ProgressBar
163 + android:id="@+id/pb_loading"
164 + android:layout_width="48dp"
165 + android:layout_height="48dp"
166 + android:layout_centerInParent="true"
167 + android:indeterminate="true"
168 + android:indeterminateTint="@color/cos_green5"
169 + android:indeterminateTintMode="src_atop"
170 + android:visibility="gone"
171 + tools:visibility="visible" />
198 </RelativeLayout> 172 </RelativeLayout>
......
1 <resources> 1 <resources>
2 <dimen name="width_full">360dp</dimen> 2 <dimen name="width_full">360dp</dimen>
3 <dimen name="height_carousel">240dp</dimen> 3 <dimen name="height_carousel">240dp</dimen>
4 - 4 + <dimen name="marginTop">52dp</dimen>
5 5
6 </resources> 6 </resources>
......
1 <resources> 1 <resources>
2 <dimen name="width_full">320dp</dimen> 2 <dimen name="width_full">320dp</dimen>
3 <dimen name="height_carousel">220dp</dimen> 3 <dimen name="height_carousel">220dp</dimen>
4 + <dimen name="marginTop">140dp</dimen>
4 </resources> 5 </resources>
......
1 +<resources>
2 + <dimen name="width_full">320dp</dimen>
3 + <dimen name="height_carousel">220dp</dimen>
4 + <dimen name="marginTop">240dp</dimen>
5 +</resources>