1
0
Fork 0

for #7032 add scroll listener to make the keyboard disappear on scroll.

touch listener was blocking the scroll
master
sraturi 2020-05-19 15:35:04 -07:00 committed by Emily Kager
parent 4ee65755dc
commit 29d1893430
2 changed files with 5 additions and 11 deletions

View File

@ -16,13 +16,13 @@ import android.speech.RecognizerIntent
import android.speech.RecognizerIntent.EXTRA_RESULTS
import android.text.style.StyleSpan
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import android.view.ViewStub
import androidx.appcompat.app.AlertDialog
import androidx.core.content.ContextCompat
import androidx.core.view.isVisible
import androidx.core.widget.NestedScrollView
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import androidx.navigation.fragment.findNavController
@ -130,14 +130,11 @@ class SearchFragment : Fragment(), UserInteractionHandler {
awesomeBarView = AwesomeBarView(view.scrollable_area, searchInteractor)
view.scrollView.setOnTouchListener { _, event ->
when (event?.action) {
MotionEvent.ACTION_SCROLL, MotionEvent.ACTION_MOVE -> {
view.hideKeyboard()
}
}
true
view.scrollView.setOnScrollChangeListener {
_: NestedScrollView, _: Int, _: Int, _: Int, _: Int ->
view.hideKeyboard()
}
toolbarView = ToolbarView(
view.toolbar_component_wrapper,
searchInteractor,

View File

@ -11,9 +11,7 @@ import androidx.appcompat.content.res.AppCompatResources.getDrawable
import androidx.core.graphics.BlendModeColorFilterCompat.createBlendModeColorFilterCompat
import androidx.core.graphics.BlendModeCompat.SRC_IN
import androidx.core.graphics.drawable.toBitmap
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.extensions.LayoutContainer
import kotlinx.android.synthetic.main.fragment_search.*
import mozilla.components.browser.awesomebar.BrowserAwesomeBar
import mozilla.components.browser.search.SearchEngine
import mozilla.components.browser.session.Session
@ -27,7 +25,6 @@ import mozilla.components.feature.search.SearchUseCases
import mozilla.components.feature.session.SessionUseCases
import mozilla.components.feature.tabs.TabsUseCases
import mozilla.components.support.ktx.android.content.getColorFromAttr
import mozilla.components.support.ktx.android.view.hideKeyboard
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.asActivity