Bug 1917138 - Avoid a dependencies chain in placing browser screen views r=android-reviewers,pollymce

A recent change introduced returning `true` in DynamicDownloadDialogBehavior's
`layoutDependsOn` method to signal to the framework that the download finished dialog
depends on the bottom toolbar.
While technically correct given the complexity of the entire layout the download finished
dialog had it's own View depending on it - the snackbar which may show when users would
tap to open a link in a new tab. And in this scenario we would get a crash.

The approach here comes to restore the previous behavior - return `false` from the
`layoutDependsOn` method, written exactly as it was before.

Differential Revision: https://phabricator.services.mozilla.com/D221469
This commit is contained in:
Mugurell 2024-09-09 13:48:30 +00:00
Родитель e97797e660
Коммит 6c9b0ea28c
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -180,7 +180,7 @@ class DynamicDownloadDialogBehavior<V : View>(
): Boolean {
engineView = parent.findViewInHierarchy { it is EngineView } as? EngineView
anchor = findAnchorInParent(parent)
return anchor != null
return super.layoutDependsOn(parent, child, dependency)
}
fun forceExpand(view: View) {

Просмотреть файл

@ -278,7 +278,7 @@ class DynamicDownloadDialogBehaviorTest {
val result = behavior.layoutDependsOn(rootLayout, mockk(), mockk())
assertTrue(result)
assertFalse(result)
assertSame(anchor, behavior.anchor)
}
@ -320,7 +320,7 @@ class DynamicDownloadDialogBehaviorTest {
val result = behavior.layoutDependsOn(rootLayout, mockk(), mockk())
assertTrue(result)
assertFalse(result)
assertSame(anchor, behavior.anchor)
}