I have a scrollView that needs to hide a keyboard when I drag certain Y offset , currently it will always close my keyboard when I enter an edittext but what I want to do is to execute the hideKeyboard() when for example the view has been scrolled Y units
binding.scrollView.setOnScrollChangeListener { view, i, i2, i3, i4 ->
hideKeyboard()
}
I want to add a condition like this
binding.scrollView.setOnScrollChangeListener { view, i, i2, i3, i4 ->
if(position_dragged_in_Y > some_value)
hideKeyboard()
}
How do I do this ? thanks