2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

For #1211 - Hide keyboard on fling suggestions list

This commit is contained in:
ekager 2019-06-03 15:59:11 -07:00 committed by Emily Kager
parent eb54d7c97f
commit 61a8795576

View File

@ -9,6 +9,7 @@ import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.core.graphics.drawable.toBitmap
import androidx.recyclerview.widget.RecyclerView
import io.reactivex.Observable
import io.reactivex.Observer
import io.reactivex.functions.Consumer
@ -21,6 +22,7 @@ import mozilla.components.feature.awesomebar.provider.SearchSuggestionProvider
import mozilla.components.feature.awesomebar.provider.SessionSuggestionProvider
import mozilla.components.feature.search.SearchUseCases
import mozilla.components.feature.session.SessionUseCases
import mozilla.components.support.ktx.android.view.hideKeyboard
import org.mozilla.fenix.R
import org.mozilla.fenix.ThemeManager
import org.mozilla.fenix.ext.components
@ -151,6 +153,15 @@ class AwesomeBarUIView(
)
shortcutEngineManager.shortcutsEnginePickerProvider = shortcutsEnginePickerProvider
val listener = object : RecyclerView.OnFlingListener() {
override fun onFling(velocityX: Int, velocityY: Int): Boolean {
view.hideKeyboard()
return false
}
}
view.onFlingListener = listener
}
}