Removed exclusive usage of 29 level API

This commit is contained in:
Viktor De Pasquale 2019-12-13 14:41:49 +01:00
parent 85a350b6c8
commit 3bda7cb26b
3 changed files with 4 additions and 25 deletions

View File

@ -82,12 +82,8 @@ class HideViewModel(
// --- // ---
override fun submitQuery() { override fun submitQuery() {
if (!queryHandler.hasCallbacks(queryRunnable)) { queryHandler.removeCallbacks(queryRunnable)
queryHandler.post(queryRunnable) queryHandler.postDelayed(queryRunnable, queryDelay)
} else {
queryHandler.removeCallbacks(queryRunnable)
queryHandler.postDelayed(queryRunnable, queryDelay)
}
} }
private fun query( private fun query(

View File

@ -165,12 +165,8 @@ class ModuleViewModel(
// --- // ---
override fun submitQuery() { override fun submitQuery() {
if (!queryHandler.hasCallbacks(queryRunnable)) { queryHandler.removeCallbacks(queryRunnable)
queryHandler.post(queryRunnable) queryHandler.postDelayed(queryRunnable, queryDelay)
} else {
queryHandler.removeCallbacks(queryRunnable)
queryHandler.postDelayed(queryRunnable, queryDelay)
}
} }
private fun queryInternal(query: String, offset: Int): Single<List<RepoItem>> { private fun queryInternal(query: String, offset: Int): Single<List<RepoItem>> {

View File

@ -17,7 +17,6 @@ import androidx.appcompat.widget.AppCompatImageView
import androidx.appcompat.widget.Toolbar import androidx.appcompat.widget.Toolbar
import androidx.core.animation.doOnEnd import androidx.core.animation.doOnEnd
import androidx.core.view.* import androidx.core.view.*
import androidx.core.widget.NestedScrollView
import androidx.databinding.BindingAdapter import androidx.databinding.BindingAdapter
import androidx.databinding.InverseBindingAdapter import androidx.databinding.InverseBindingAdapter
import androidx.databinding.InverseBindingListener import androidx.databinding.InverseBindingListener
@ -427,18 +426,6 @@ fun Chip.setOnCloseClickedListenerBinding(listener: View.OnClickListener) {
setOnCloseIconClickListener(listener) setOnCloseIconClickListener(listener)
} }
@BindingAdapter("onScrollStateChanged")
fun NestedScrollView.setOnScrollStateChangeListener(listener: Runnable) {
setOnScrollChangeListener { _: NestedScrollView?, _: Int, _: Int, _: Int, _: Int ->
if (!handler.hasCallbacks(listener)) {
listener.run()
} else {
handler.removeCallbacksAndMessages(null)
}
handler.postDelayed(listener, 1000)
}
}
@BindingAdapter("progressAnimated") @BindingAdapter("progressAnimated")
fun ProgressBar.setProgressAnimated(newProgress: Int) { fun ProgressBar.setProgressAnimated(newProgress: Int) {
val animator = tag as? ValueAnimator val animator = tag as? ValueAnimator