File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
java/com/duckduckgo/app/browser/omnibar Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -589,13 +589,23 @@ class OmnibarLayout @JvmOverloads constructor(
589589
590590 omnibarCardShadow.isGone = viewState.viewMode is ViewMode .CustomTab && ! isFindInPageVisible
591591
592+ renderOmnibarButtonContainer(viewState.showButtons)
593+
592594 renderButtons(viewState)
593595
594596 omniBarButtonTransitionSet.doOnEnd {
595597 omnibarTextInput.requestLayout()
596598 }
597599 }
598600
601+ private fun renderOmnibarButtonContainer (showButtons : Boolean ) {
602+ if (showButtons) {
603+ iconsContainer.show()
604+ } else {
605+ iconsContainer.gone()
606+ }
607+ }
608+
599609 private fun renderPosition (isTopPosition : Boolean ) {
600610 if (isTopPosition) {
601611 if (Build .VERSION .SDK_INT < 28 ) {
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ import com.duckduckgo.app.statistics.pixels.Pixel.PixelType.Unique
5555import com.duckduckgo.app.tabs.model.TabRepository
5656import com.duckduckgo.app.trackerdetection.model.Entity
5757import com.duckduckgo.browser.api.UserBrowserProperties
58+ import com.duckduckgo.browser.ui.omnibar.OmnibarType
5859import com.duckduckgo.common.utils.DispatcherProvider
5960import com.duckduckgo.di.scopes.FragmentScope
6061import com.duckduckgo.duckchat.api.DuckAiFeatureState
@@ -106,6 +107,7 @@ class OmnibarLayoutViewModel @Inject constructor(
106107 private val _viewState = MutableStateFlow (
107108 ViewState (
108109 showChatMenu = duckAiFeatureState.showOmnibarShortcutInAllStates.value,
110+ showButtons = settingsDataStore.omnibarType != OmnibarType .SPLIT ,
109111 ),
110112 )
111113
@@ -175,6 +177,7 @@ class OmnibarLayoutViewModel @Inject constructor(
175177 val showShadows : Boolean = false ,
176178 val showTextInputClickCatcher : Boolean = false ,
177179 val showFindInPage : Boolean = false ,
180+ val showButtons : Boolean = true ,
178181 ) {
179182 fun shouldUpdateOmnibarText (isFullUrlEnabled : Boolean ): Boolean {
180183 return this .viewMode is Browser || this .viewMode is MaliciousSiteWarning || (! isFullUrlEnabled && omnibarText.isNotEmpty())
Original file line number Diff line number Diff line change 3636 android : id =" @+id/toolbarContainer"
3737 android : layout_width =" match_parent"
3838 android : layout_height =" wrap_content"
39+ android : layout_marginEnd =" @dimen/keyline_1"
3940 android : background =" ?attr/daxColorToolbar" >
4041
4142 <androidx .appcompat.widget.Toolbar
404405 android : layout_width =" wrap_content"
405406 android : layout_height =" @dimen/toolbarIcon"
406407 android : layout_marginTop =" @dimen/omnibarCardMarginTop"
407- android : layout_marginEnd =" @dimen/keyline_1"
408408 android : layout_marginBottom =" @dimen/omnibarCardMarginBottom"
409409 app : layout_constraintBottom_toBottomOf =" parent"
410410 app : layout_constraintEnd_toEndOf =" parent"
You can’t perform that action at this time.
0 commit comments