File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
app/src/main/java/com/duckduckgo/app/onboarding/ui/page Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -587,10 +587,10 @@ class BbWelcomePage : OnboardingPageFragment(R.layout.content_onboarding_welcome
587
587
}
588
588
589
589
private fun scheduleTypingAnimation (textView : TypeAnimationTextView , text : String , afterAnimation : () -> Unit = {}) {
590
- textView.postDelayed(
591
- { textView.startTypingAnimation(text, afterAnimation = afterAnimation) },
592
- ANIMATION_DURATION ,
593
- )
590
+ viewLifecycleOwner.lifecycleScope.launch {
591
+ delay( ANIMATION_DURATION )
592
+ textView.startTypingAnimation(text, afterAnimation = afterAnimation)
593
+ }
594
594
}
595
595
596
596
private fun showDefaultBrowserDialog (intent : Intent ) {
Original file line number Diff line number Diff line change @@ -73,8 +73,10 @@ import com.duckduckgo.common.utils.extensions.html
73
73
import com.duckduckgo.common.utils.extensions.preventWidows
74
74
import com.duckduckgo.di.scopes.FragmentScope
75
75
import javax.inject.Inject
76
+ import kotlinx.coroutines.delay
76
77
import kotlinx.coroutines.flow.launchIn
77
78
import kotlinx.coroutines.flow.onEach
79
+ import kotlinx.coroutines.launch
78
80
79
81
@InjectWith(FragmentScope ::class )
80
82
class BuckWelcomePage : OnboardingPageFragment (R .layout.content_onboarding_welcome_page_buck) {
@@ -458,10 +460,10 @@ class BuckWelcomePage : OnboardingPageFragment(R.layout.content_onboarding_welco
458
460
}
459
461
460
462
private fun scheduleTypingAnimation (textView : TypeAnimationTextView , text : String , afterAnimation : () -> Unit = {}) {
461
- textView.postDelayed(
462
- { textView.startTypingAnimation(text, afterAnimation = afterAnimation) },
463
- ANIMATION_DURATION ,
464
- )
463
+ viewLifecycleOwner.lifecycleScope.launch {
464
+ delay( ANIMATION_DURATION )
465
+ textView.startTypingAnimation(text, afterAnimation = afterAnimation)
466
+ }
465
467
}
466
468
467
469
private fun showDefaultBrowserDialog (intent : Intent ) {
You can’t perform that action at this time.
0 commit comments