@@ -1144,6 +1144,8 @@ sealed class DaxBubbleCta(
1144
1144
) : Cta, ViewCta, DaxCta {
1145
1145
1146
1146
var isModifiedControlOnboardingExperimentEnabled: Boolean? = null
1147
+ private var buckAnimators: List <ViewPropertyAnimator > = emptyList()
1148
+ private var bbAnimators: List <ViewPropertyAnimator > = emptyList()
1147
1149
1148
1150
protected var ctaView: View ? = null
1149
1151
@@ -1326,13 +1328,13 @@ sealed class DaxBubbleCta(
1326
1328
val afterAnimation = {
1327
1329
daxBubbleDialogTitle.finishAnimation()
1328
1330
dialogTextCta.finishAnimation()
1329
- placeholder?.let { placeholderImageView.fadeIn() }
1330
- primaryCta.fadeIn()
1331
- secondaryCta.fadeIn()
1331
+ placeholder?.let { bbAnimators + = placeholderImageView.fadeIn() }
1332
+ bbAnimators + = primaryCta.fadeIn()
1333
+ bbAnimators + = secondaryCta.fadeIn()
1332
1334
options?.let {
1333
1335
optionsViews.forEachIndexed { index, buttonView ->
1334
1336
if (it.size > index) {
1335
- buttonView.fadeIn()
1337
+ bbAnimators + = buttonView.fadeIn()
1336
1338
}
1337
1339
}
1338
1340
}
@@ -1357,9 +1359,9 @@ sealed class DaxBubbleCta(
1357
1359
}
1358
1360
}
1359
1361
1360
- root.fadeIn().setStartDelay(500 ).withEndAction {
1362
+ bbAnimators + = root.fadeIn().setStartDelay(500 ).withEndAction {
1361
1363
if (configuration is DaxEndCta ) {
1362
- headerImage.fadeIn().withEndAction {
1364
+ bbAnimators + = headerImage.fadeIn().withEndAction {
1363
1365
runTypingAnimations()
1364
1366
}
1365
1367
} else {
@@ -1455,13 +1457,13 @@ sealed class DaxBubbleCta(
1455
1457
1456
1458
val afterAnimation = {
1457
1459
dialogTextCta.finishAnimation()
1458
- placeholder?.let { placeholderImageView.fadeIn() }
1459
- primaryCta.fadeIn()
1460
- secondaryCta.fadeIn()
1460
+ placeholder?.let { buckAnimators + = placeholderImageView.fadeIn() }
1461
+ buckAnimators + = primaryCta.fadeIn()
1462
+ buckAnimators + = secondaryCta.fadeIn()
1461
1463
options?.let {
1462
1464
optionsViews.forEachIndexed { index, buttonView ->
1463
1465
if (it.size > index) {
1464
- buttonView.fadeIn()
1466
+ buckAnimators + = buttonView.fadeIn()
1465
1467
}
1466
1468
}
1467
1469
}
@@ -1472,8 +1474,8 @@ sealed class DaxBubbleCta(
1472
1474
with (buckOnboardingDialogView) {
1473
1475
animateEntrance(
1474
1476
onAnimationEnd = {
1475
- daxDialogDismissButton.fadeIn()
1476
- daxBubbleDialogTitle.fadeIn()
1477
+ buckAnimators + = daxDialogDismissButton.fadeIn()
1478
+ buckAnimators + = daxBubbleDialogTitle.fadeIn()
1477
1479
.withEndAction {
1478
1480
dialogTextCta.startTypingAnimation(daxText, true ) {
1479
1481
afterAnimation()
@@ -1508,17 +1510,33 @@ sealed class DaxBubbleCta(
1508
1510
1509
1511
private fun clearBubbleBuckDialog (binding : IncludeOnboardingBubbleBuckDialogBinding ) {
1510
1512
binding.apply {
1513
+ buckAnimators.forEach { it.cancel() }
1514
+ buckAnimators = emptyList()
1515
+ daxBubbleDialogTitle.text = " "
1516
+ dialogTextCta.cancelAnimation()
1517
+ dialogTextCta.text = " "
1511
1518
this .daxDialogDismissButton.alpha = 0f
1512
1519
this .primaryCta.gone()
1520
+ this .primaryCta.alpha = 0f
1513
1521
this .secondaryCta.gone()
1522
+ this .secondaryCta.alpha = 0f
1523
+ this .daxDialogOption1.alpha = 0f
1514
1524
this .daxDialogOption1.gone()
1525
+ this .daxDialogOption2.alpha = 0f
1515
1526
this .daxDialogOption2.gone()
1527
+ this .daxDialogOption3.alpha = 0f
1516
1528
this .daxDialogOption3.gone()
1517
1529
}
1518
1530
}
1519
1531
1520
1532
private fun clearBubbleBBDialog (binding : IncludeOnboardingBubbleBbDialogBinding ) {
1521
1533
binding.apply {
1534
+ bbAnimators.forEach { it.cancel() }
1535
+ bbAnimators = emptyList()
1536
+ daxBubbleDialogTitle.cancelAnimation()
1537
+ daxBubbleDialogTitle.text = " "
1538
+ dialogTextCta.cancelAnimation()
1539
+ dialogTextCta.text = " "
1522
1540
primaryCta.alpha = 0f
1523
1541
primaryCta.gone()
1524
1542
secondaryCta.alpha = 0f
0 commit comments