Skip to content

Commit

Permalink
NTP: Clean up FocusedView (#4984)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/0/1208220396571848/f

### Description
Clean up of the FocusedView and the FavouritesView for use in both NTP
and legacy NTP

### Steps to test this PR

_Pixels_
- [x] Add a Favourite
- [x] Open Focused View
- [x] Long press on a favourite and tap on Edit
- [x] Verify m_edit_favourite_dialog_shown sent
- [x] Verify m_edit_favourite_dialog_shown_daily sent
- [x] Navigate back
- [x] Long press on a favourite and tap on Remote Favourite
- [x] Wait for favourite to be removed (snackbar dissappear)
- [x] Verify m_favorite_removed sent
- [x] Add another favourite
- [x] Long press on a favourite and tap on Delete
- [x] Wait for favourite to be deleted (snackbar dissappear)
- [x] Verify m_favorite_deleted sent
- [x] Repeat same actions but this time from New Tab Page
- [x] Verify pixels are still sent

_Legacy NTP_
Use https://www.jsonblob.com/api/1280863591262445568 so you’re not part
of the experiment
Make sure you are not a reinstaller and using playDebug flavour
- [x] Open New Tab
- [x] Verify Dax Logo is visible
- [x] Add a favourite and open New Tab again
- [x] Verify favourites are visible
- [x] Verify sections are not visible (this verifies you see the legacy
NTP)
- [x] Remove favourite (wait for the snackbar to disappear)
- [x] Verify Dax Logo is visible

_New NTP_
Use https://www.jsonblob.com/api/1270091613312245760 in Remote Config so
you’re part of the experiment
Make sure you are not a reinstaller and using playDebug flavour
- [x] Open New Tab
- [x] Verify Favourites placeholders and shortcuts are visible
- [x] Add a favourite and open New Tab again
- [x] Verify favourites are visible
- [x] Remove favourite (wait for the snackbar to disappear)
- [x] Verify Favourites placeholders and shortcuts are visible
- [x] Verify Dax logo is not visible
  • Loading branch information
malmstein authored Sep 12, 2024
1 parent f0f9677 commit 715d842
Show file tree
Hide file tree
Showing 17 changed files with 60 additions and 1,100 deletions.
23 changes: 2 additions & 21 deletions app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ import com.duckduckgo.app.browser.menu.BrowserPopupMenu
import com.duckduckgo.app.browser.model.BasicAuthenticationCredentials
import com.duckduckgo.app.browser.model.BasicAuthenticationRequest
import com.duckduckgo.app.browser.model.LongPressTarget
import com.duckduckgo.app.browser.newtab.FocusedViewProvider
import com.duckduckgo.app.browser.newtab.NewTabPageProvider
import com.duckduckgo.app.browser.omnibar.OmnibarScrolling
import com.duckduckgo.app.browser.omnibar.animations.BrowserTrackersAnimatorHelper
Expand Down Expand Up @@ -534,9 +533,6 @@ class BrowserTabFragment :
@Inject
lateinit var newTabPageProvider: NewTabPageProvider

@Inject
lateinit var focusedViewProvider: FocusedViewProvider

@Inject
lateinit var singlePrintSafeguardFeature: SinglePrintSafeguardFeature

Expand Down Expand Up @@ -3752,26 +3748,11 @@ class BrowserTabFragment :
}

private fun showFocusedView() {
binding.focusedViewContainerLayout.show()
configureFocusedView()
}

private fun configureFocusedView() {
if (binding.focusedViewContainerLayout.childCount == 0) {
focusedViewProvider.provideFocusedViewVersion().onEach { focusedView ->
binding.focusedViewContainerLayout.addView(
focusedView.getView(requireContext()),
LayoutParams(
LayoutParams.MATCH_PARENT,
LayoutParams.MATCH_PARENT,
),
)
}.launchIn(lifecycleScope)
}
binding.focusedView.show()
}

private fun hideFocusedView() {
binding.focusedViewContainerLayout.gone()
binding.focusedView.gone()
}

fun renderOmnibar(viewState: OmnibarViewState) {
Expand Down

This file was deleted.

Loading

0 comments on commit 715d842

Please sign in to comment.