Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ class BrowserTabFragment :
private lateinit var popupMenu: BrowserMenu
private lateinit var ctaBottomSheet: PromoBottomSheetDialog
private lateinit var widgetBottomSheetDialog: AlternativeHomeScreenWidgetBottomSheetDialog
private val widgetBottomSheetDialogJob: ConflatedJob = ConflatedJob()

private lateinit var autoCompleteSuggestionsAdapter: BrowserAutoCompleteSuggestionsAdapter

Expand Down Expand Up @@ -4076,6 +4077,7 @@ class BrowserTabFragment :
dismissAppLinkSnackBar()
supervisorJob.cancel()
if (::popupMenu.isInitialized) popupMenu.dismiss()
widgetBottomSheetDialogJob?.cancel()
loginDetectionDialog?.dismiss()
automaticFireproofDialog?.dismiss()
browserAutofill.removeJsInterface()
Expand Down Expand Up @@ -4349,6 +4351,7 @@ class BrowserTabFragment :
const val KEYBOARD_DELAY = 200L
private const val NAVIGATION_DELAY = 100L
private const val POPUP_MENU_DELAY = 200L
private const val WIDGET_PROMPT_DELAY = 200L

private const val REQUEST_CODE_CHOOSE_FILE = 100
private const val PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE = 200
Expand Down Expand Up @@ -4840,10 +4843,13 @@ class BrowserTabFragment :
}

private fun showBottomSheetCta(configuration: HomePanelCta) {
if (configuration is AddWidgetAutoOnboardingExperiment) {
showAlternativeHomeWidgetPrompt(configuration)
} else {
showHomeCta(configuration)
widgetBottomSheetDialogJob += viewLifecycleOwner.lifecycleScope.launch {
delay(WIDGET_PROMPT_DELAY)
if (configuration is AddWidgetAutoOnboardingExperiment) {
showAlternativeHomeWidgetPrompt(configuration)
} else {
showHomeCta(configuration)
}
}
}

Expand Down
Loading