Skip to content

Commit 7bb62c4

Browse files
committed
Merge branch 'hotfix/5.208.1'
2 parents 38c80c3 + 328e289 commit 7bb62c4

File tree

4 files changed

+33
-18
lines changed

4 files changed

+33
-18
lines changed

app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,6 @@ class BrowserTabFragment :
830830
configureOmnibarTextInput()
831831
configureFindInPage()
832832
configureAutoComplete()
833-
configureFocusedView()
834833
configureNewTab()
835834
initPrivacyProtectionsPopup()
836835

@@ -2128,18 +2127,6 @@ class BrowserTabFragment :
21282127
binding.autoCompleteSuggestionsList.adapter = autoCompleteSuggestionsAdapter
21292128
}
21302129

2131-
private fun configureFocusedView() {
2132-
focusedViewProvider.provideFocusedViewVersion().onEach { focusedView ->
2133-
binding.focusedViewContainerLayout.addView(
2134-
focusedView.getView(requireContext()),
2135-
LayoutParams(
2136-
LayoutParams.MATCH_PARENT,
2137-
LayoutParams.MATCH_PARENT,
2138-
),
2139-
)
2140-
}.launchIn(lifecycleScope)
2141-
}
2142-
21432130
private fun configureNewTab() {
21442131
newBrowserTab.newTabLayout.setOnScrollChangeListener { v, scrollX, scrollY, oldScrollX, oldScrollY ->
21452132
if (omnibar.omniBarContainer.isPressed) {
@@ -3563,20 +3550,43 @@ class BrowserTabFragment :
35633550
// viewState.showFavourites needs to be moved to FocusedViewModel
35643551
if (viewState.showSuggestions || viewState.showFavorites) {
35653552
if (viewState.favorites.isNotEmpty() && viewState.showFavorites) {
3553+
showFocusedView()
35663554
binding.autoCompleteSuggestionsList.gone()
3567-
binding.focusedViewContainerLayout.show()
35683555
} else {
35693556
binding.autoCompleteSuggestionsList.show()
3570-
binding.focusedViewContainerLayout.gone()
35713557
autoCompleteSuggestionsAdapter.updateData(viewState.searchResults.query, viewState.searchResults.suggestions)
3558+
hideFocusedView()
35723559
}
35733560
} else {
35743561
binding.autoCompleteSuggestionsList.gone()
3575-
binding.focusedViewContainerLayout.gone()
3562+
hideFocusedView()
35763563
}
35773564
}
35783565
}
35793566

3567+
private fun showFocusedView() {
3568+
binding.focusedViewContainerLayout.show()
3569+
configureFocusedView()
3570+
}
3571+
3572+
private fun configureFocusedView() {
3573+
if (binding.focusedViewContainerLayout.childCount == 0) {
3574+
focusedViewProvider.provideFocusedViewVersion().onEach { focusedView ->
3575+
binding.focusedViewContainerLayout.addView(
3576+
focusedView.getView(requireContext()),
3577+
LayoutParams(
3578+
LayoutParams.MATCH_PARENT,
3579+
LayoutParams.MATCH_PARENT,
3580+
),
3581+
)
3582+
}.launchIn(lifecycleScope)
3583+
}
3584+
}
3585+
3586+
private fun hideFocusedView() {
3587+
binding.focusedViewContainerLayout.gone()
3588+
}
3589+
35803590
fun renderOmnibar(viewState: OmnibarViewState) {
35813591
renderIfChanged(viewState, lastSeenOmnibarViewState) {
35823592
lastSeenOmnibarViewState = viewState

app/src/main/res/layout/fragment_browser_tab.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
android:id="@+id/focusedViewContainerLayout"
5252
android:clipToPadding="false"
5353
android:elevation="4dp"
54+
android:background="?attr/daxColorSurface"
5455
android:layout_width="match_parent"
5556
android:layout_height="match_parent"
5657
app:layout_behavior="@string/appbar_scrolling_view_behavior" />

app/version/release-notes

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
Bug fixes and other improvements
1+
Added the ability to import passwords from the desktop version of the browser via Sync & Backup.
2+
3+
For Privacy Pro subscribers:
4+
Fixed an issue that prevented some users from connecting to a U.S. server location.
5+
Privacy Pro is currently available to U.S. residents only.

app/version/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION=5.208.0
1+
VERSION=5.208.1

0 commit comments

Comments
 (0)