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 // ===========================================================
......
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>