From 5e7c29a1069a8d85ea5ffd2f8e70b7d55bcc4766 Mon Sep 17 00:00:00 2001 From: kunalapk Date: Mon, 11 Jan 2021 23:11:17 +0530 Subject: [PATCH] added currentVisibileItemPosition to -1 when dragging recyclerview --- .../com/kunalapk/smartrecyclerview/view/SmartRecyclerView.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/smartrecyclerview/src/main/java/com/kunalapk/smartrecyclerview/view/SmartRecyclerView.kt b/smartrecyclerview/src/main/java/com/kunalapk/smartrecyclerview/view/SmartRecyclerView.kt index 7bcd35d..1aa9a93 100644 --- a/smartrecyclerview/src/main/java/com/kunalapk/smartrecyclerview/view/SmartRecyclerView.kt +++ b/smartrecyclerview/src/main/java/com/kunalapk/smartrecyclerview/view/SmartRecyclerView.kt @@ -3,6 +3,7 @@ package com.kunalapk.smartrecyclerview.view import android.content.Context import android.graphics.Point import android.util.AttributeSet +import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -245,6 +246,8 @@ class SmartRecyclerView : SwipeRefreshLayout { }else{ calculateCurrentVisibleItemPosition(false, recyclerView, recyclerView.layoutManager!!) } + }else if(newState == RecyclerView.SCROLL_STATE_DRAGGING){ + smartRecyclerViewListener.setCurrentItemPosition(-1) } }