Commit efe29011 authored by MozLando's avatar MozLando
Browse files

Merge #6695



6695: Closes #6659: Awesomebar causes content resize which delays pageload r=jonalmeida a=csadilek

See description below.

Co-authored-by: default avatarChristian Sadilek <christian.sadilek@gmail.com>
parents 70ca599a 5f62634f
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -204,4 +204,13 @@ class GeckoEngineView @JvmOverloads constructor(
    override fun clearSelection() {
        currentSelection?.clearSelection()
    }

    override fun setVisibility(visibility: Int) {
        // GeckoView doesn't react to onVisibilityChanged so we need to propagate ourselves for now:
        // https://bugzilla.mozilla.org/show_bug.cgi?id=1630775
        // We do this to prevent the content from resizing when the view is not visible:
        // https://github.com/mozilla-mobile/android-components/issues/6664
        currentGeckoView.visibility = visibility
        super.setVisibility(visibility)
    }
}
+10 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ package mozilla.components.browser.engine.gecko
import android.app.Activity
import android.content.Context
import android.graphics.Bitmap
import android.view.View
import androidx.test.ext.junit.runners.AndroidJUnit4
import mozilla.components.browser.engine.gecko.selection.GeckoSelectionActionDelegate
import mozilla.components.concept.engine.selection.SelectionActionDelegate
@@ -280,4 +281,13 @@ class GeckoEngineViewTest {

        verify(geckoSession).selectionActionDelegate = null
    }

    @Test
    fun `setVisibility is propagated to gecko view`() {
        val engineView = GeckoEngineView(context)
        engineView.currentGeckoView = mock()

        engineView.visibility = View.GONE
        verify(engineView.currentGeckoView)?.visibility = View.GONE
    }
}
+9 −0
Original line number Diff line number Diff line
@@ -204,4 +204,13 @@ class GeckoEngineView @JvmOverloads constructor(
    override fun clearSelection() {
        currentSelection?.clearSelection()
    }

    override fun setVisibility(visibility: Int) {
        // GeckoView doesn't react to onVisibilityChanged so we need to propagate ourselves for now:
        // https://bugzilla.mozilla.org/show_bug.cgi?id=1630775
        // We do this to prevent the content from resizing when the view is not visible:
        // https://github.com/mozilla-mobile/android-components/issues/6664
        currentGeckoView.visibility = visibility
        super.setVisibility(visibility)
    }
}
+10 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ package mozilla.components.browser.engine.gecko
import android.app.Activity
import android.content.Context
import android.graphics.Bitmap
import android.view.View
import androidx.test.ext.junit.runners.AndroidJUnit4
import mozilla.components.browser.engine.gecko.selection.GeckoSelectionActionDelegate
import mozilla.components.concept.engine.selection.SelectionActionDelegate
@@ -280,4 +281,13 @@ class GeckoEngineViewTest {

        verify(geckoSession).selectionActionDelegate = null
    }

    @Test
    fun `setVisibility is propagated to gecko view`() {
        val engineView = GeckoEngineView(context)
        engineView.currentGeckoView = mock()

        engineView.visibility = View.GONE
        verify(engineView.currentGeckoView)?.visibility = View.GONE
    }
}
+9 −0
Original line number Diff line number Diff line
@@ -202,4 +202,13 @@ class GeckoEngineView @JvmOverloads constructor(
    override fun clearSelection() {
        currentSelection?.clearSelection()
    }

    override fun setVisibility(visibility: Int) {
        // GeckoView doesn't react to onVisibilityChanged so we need to propagate ourselves for now:
        // https://bugzilla.mozilla.org/show_bug.cgi?id=1630775
        // We do this to prevent the content from resizing when the view is not visible:
        // https://github.com/mozilla-mobile/android-components/issues/6664
        currentGeckoView.visibility = visibility
        super.setVisibility(visibility)
    }
}
Loading