Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add DefaultBrowserBottomSheetDialog #5388

Merged

Conversation

LukasPaczos
Copy link
Contributor

@LukasPaczos LukasPaczos commented Dec 13, 2024

Task/Issue URL: https://app.asana.com/0/72649045549333/1208944504536341/f

Description

Adds a promotion dialog that advertises setting DuckDuckGo as the default browser.

The introduced dialog is not yet used anywhere and click listeners/handlers will be added in following PRs.

Steps to test this PR

As an example, apply below diff which opens the bottom sheet when the fire button is clicked.

diff --git a/app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt b/app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
index d0e5ef7f8..28abbd21f 100644
--- a/app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
+++ b/app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
@@ -118,6 +118,7 @@ import com.duckduckgo.app.browser.customtabs.CustomTabPixelNames
 import com.duckduckgo.app.browser.customtabs.CustomTabViewModel.Companion.CUSTOM_TAB_NAME_PREFIX
 import com.duckduckgo.app.browser.databinding.FragmentBrowserTabBinding
 import com.duckduckgo.app.browser.databinding.HttpAuthenticationBinding
+import com.duckduckgo.app.browser.defaultbrowsing.prompts.ui.DefaultBrowserBottomSheetDialog
 import com.duckduckgo.app.browser.downloader.BlobConverterInjector
 import com.duckduckgo.app.browser.favicon.FaviconManager
 import com.duckduckgo.app.browser.filechooser.FileChooserIntentBuilder
@@ -2368,7 +2369,10 @@ class BrowserTabFragment :
                 }
 
                 override fun onFireButtonPressed(isPulseAnimationPlaying: Boolean) {
-                    onOmnibarFireButtonPressed(isPulseAnimationPlaying)
+                    // onOmnibarFireButtonPressed(isPulseAnimationPlaying)
+
+                    val dialogDefault = DefaultBrowserBottomSheetDialog(requireContext())
+                    dialogDefault.show()
                 }
 
                 override fun onBrowserMenuPressed() {
  • Test portrait
  • Test landscape and ensure all content can be accessed when scrolled.

UI changes

Light Dark
Screenshot_20241213_121320 Screenshot_20241213_121339

Video of usage in landscape:

Screen_recording_20241213_121602.mp4

@LukasPaczos LukasPaczos force-pushed the feature/lukasz-p/default-browser-bottom-sheet-dialog branch from 1d75bc7 to 19c0de8 Compare December 13, 2024 11:30
Copy link
Contributor

@malmstein malmstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple nits about file location and translations. Rest looks good @LukasPaczos !

@LukasPaczos LukasPaczos force-pushed the feature/lukasz-p/default-browser-bottom-sheet-dialog branch from 19c0de8 to af792e6 Compare December 13, 2024 14:03
@LukasPaczos
Copy link
Contributor Author

Ready for another round!

@malmstein malmstein self-assigned this Dec 13, 2024
Adds a promotion dialog that advertises setting DuckDuckGo as the default browser.
@LukasPaczos LukasPaczos force-pushed the feature/lukasz-p/default-browser-bottom-sheet-dialog branch from af792e6 to 912476f Compare December 13, 2024 14:17
@LukasPaczos LukasPaczos enabled auto-merge (squash) December 13, 2024 14:18
@LukasPaczos LukasPaczos merged commit 47e27c4 into develop Dec 13, 2024
5 checks passed
@LukasPaczos LukasPaczos deleted the feature/lukasz-p/default-browser-bottom-sheet-dialog branch December 13, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants