Fixed version update.

This commit is contained in:
Amine 2018-09-25 20:56:25 +02:00
parent 377c5518f7
commit 2be872e61e

View File

@ -114,7 +114,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
private lateinit var appColors: AppColors
private var offset: Int = 0
private var firstVisible: Int = 0
private var recyclerViewScrollListener: RecyclerView.OnScrollListener? = null
private lateinit var recyclerViewScrollListener: RecyclerView.OnScrollListener
private lateinit var settings: SharedPreferences
private var recyclerAdapter: RecyclerView.Adapter<*>? = null
@ -209,8 +209,8 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
ItemTouchHelper.LEFT or ItemTouchHelper.RIGHT
) {
override fun getSwipeDirs(
recyclerView: RecyclerView?,
viewHolder: RecyclerView.ViewHolder?
recyclerView: RecyclerView,
viewHolder: RecyclerView.ViewHolder
): Int =
if (elementsShown != UNREAD_SHOWN) {
0
@ -805,9 +805,8 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
}
private fun handleInfiniteScroll() {
if (recyclerViewScrollListener == null) {
recyclerViewScrollListener = object : RecyclerView.OnScrollListener() {
override fun onScrolled(localRecycler: RecyclerView?, dx: Int, dy: Int) {
override fun onScrolled(localRecycler: RecyclerView, dx: Int, dy: Int) {
if (localRecycler != null && dy > 0) {
val manager = recyclerView.layoutManager
val lastVisibleItem: Int = when (manager) {
@ -824,7 +823,6 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
}
}
}
}
recyclerView.clearOnScrollListeners()
recyclerView.addOnScrollListener(recyclerViewScrollListener)