|
|
@ -19,9 +19,9 @@ import mozilla.components.browser.state.selector.selectedTab
|
|
|
|
import mozilla.components.browser.state.state.CustomTabSessionState
|
|
|
|
import mozilla.components.browser.state.state.CustomTabSessionState
|
|
|
|
import mozilla.components.browser.state.state.ExternalAppType
|
|
|
|
import mozilla.components.browser.state.state.ExternalAppType
|
|
|
|
import mozilla.components.browser.toolbar.BrowserToolbar
|
|
|
|
import mozilla.components.browser.toolbar.BrowserToolbar
|
|
|
|
import mozilla.components.browser.toolbar.behavior.BrowserToolbarBehavior
|
|
|
|
|
|
|
|
import mozilla.components.browser.toolbar.display.DisplayToolbar
|
|
|
|
import mozilla.components.browser.toolbar.display.DisplayToolbar
|
|
|
|
import mozilla.components.support.ktx.util.URLStringUtils
|
|
|
|
import mozilla.components.support.ktx.util.URLStringUtils
|
|
|
|
|
|
|
|
import mozilla.components.ui.widgets.behavior.EngineViewScrollingBehavior
|
|
|
|
import org.mozilla.fenix.R
|
|
|
|
import org.mozilla.fenix.R
|
|
|
|
import org.mozilla.fenix.components.toolbar.interactor.BrowserToolbarInteractor
|
|
|
|
import org.mozilla.fenix.components.toolbar.interactor.BrowserToolbarInteractor
|
|
|
|
import org.mozilla.fenix.customtabs.CustomTabToolbarIntegration
|
|
|
|
import org.mozilla.fenix.customtabs.CustomTabToolbarIntegration
|
|
|
@ -32,7 +32,7 @@ import org.mozilla.fenix.theme.ThemeManager
|
|
|
|
import org.mozilla.fenix.utils.Settings
|
|
|
|
import org.mozilla.fenix.utils.Settings
|
|
|
|
import org.mozilla.fenix.utils.ToolbarPopupWindow
|
|
|
|
import org.mozilla.fenix.utils.ToolbarPopupWindow
|
|
|
|
import java.lang.ref.WeakReference
|
|
|
|
import java.lang.ref.WeakReference
|
|
|
|
import mozilla.components.browser.toolbar.behavior.ToolbarPosition as MozacToolbarPosition
|
|
|
|
import mozilla.components.ui.widgets.behavior.ViewPosition as MozacToolbarPosition
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("LargeClass")
|
|
|
|
@SuppressWarnings("LargeClass")
|
|
|
|
class BrowserToolbarView(
|
|
|
|
class BrowserToolbarView(
|
|
|
@ -53,8 +53,7 @@ class BrowserToolbarView(
|
|
|
|
private val layout = LayoutInflater.from(context)
|
|
|
|
private val layout = LayoutInflater.from(context)
|
|
|
|
.inflate(toolbarLayout, container, true)
|
|
|
|
.inflate(toolbarLayout, container, true)
|
|
|
|
|
|
|
|
|
|
|
|
@VisibleForTesting
|
|
|
|
var view: BrowserToolbar = layout
|
|
|
|
internal var view: BrowserToolbar = layout
|
|
|
|
|
|
|
|
.findViewById(R.id.toolbar)
|
|
|
|
.findViewById(R.id.toolbar)
|
|
|
|
|
|
|
|
|
|
|
|
val toolbarIntegration: ToolbarIntegration
|
|
|
|
val toolbarIntegration: ToolbarIntegration
|
|
|
@ -191,7 +190,7 @@ class BrowserToolbarView(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
(view.layoutParams as? CoordinatorLayout.LayoutParams)?.apply {
|
|
|
|
(view.layoutParams as? CoordinatorLayout.LayoutParams)?.apply {
|
|
|
|
(behavior as? BrowserToolbarBehavior)?.forceExpand(view)
|
|
|
|
(behavior as? EngineViewScrollingBehavior)?.forceExpand(view)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -202,7 +201,7 @@ class BrowserToolbarView(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
(view.layoutParams as? CoordinatorLayout.LayoutParams)?.apply {
|
|
|
|
(view.layoutParams as? CoordinatorLayout.LayoutParams)?.apply {
|
|
|
|
(behavior as? BrowserToolbarBehavior)?.forceCollapse(view)
|
|
|
|
(behavior as? EngineViewScrollingBehavior)?.forceCollapse(view)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -255,7 +254,7 @@ class BrowserToolbarView(
|
|
|
|
@VisibleForTesting
|
|
|
|
@VisibleForTesting
|
|
|
|
internal fun setDynamicToolbarBehavior(toolbarPosition: MozacToolbarPosition) {
|
|
|
|
internal fun setDynamicToolbarBehavior(toolbarPosition: MozacToolbarPosition) {
|
|
|
|
(view.layoutParams as? CoordinatorLayout.LayoutParams)?.apply {
|
|
|
|
(view.layoutParams as? CoordinatorLayout.LayoutParams)?.apply {
|
|
|
|
behavior = BrowserToolbarBehavior(view.context, null, toolbarPosition)
|
|
|
|
behavior = EngineViewScrollingBehavior(view.context, null, toolbarPosition)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|