diff options
Diffstat (limited to 'java/com/android/dialer/contactsfragment')
-rw-r--r-- | java/com/android/dialer/contactsfragment/ContactsFragment.java | 6 | ||||
-rw-r--r-- | java/com/android/dialer/contactsfragment/FastScroller.java | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/java/com/android/dialer/contactsfragment/ContactsFragment.java b/java/com/android/dialer/contactsfragment/ContactsFragment.java index 759897f91..a8daa546a 100644 --- a/java/com/android/dialer/contactsfragment/ContactsFragment.java +++ b/java/com/android/dialer/contactsfragment/ContactsFragment.java @@ -93,7 +93,7 @@ public class ContactsFragment extends Fragment /** Listener for contacts list scroll state. */ public interface OnContactsListScrolledListener { - void onContactsListScrolled(int scrollState); + void onContactsListScrolled(boolean isDragging); } /** @@ -248,7 +248,9 @@ public class ContactsFragment extends Fragment String anchoredHeaderString = adapter.getHeaderString(firstCompletelyVisible); FragmentUtils.getParentUnsafe(this, OnContactsListScrolledListener.class) - .onContactsListScrolled(recyclerView.getScrollState()); + .onContactsListScrolled( + recyclerView.getScrollState() == RecyclerView.SCROLL_STATE_DRAGGING + || fastScroller.isDragStarted()); // If the user swipes to the top of the list very quickly, there is some strange behavior // between this method updating headers and adapter#onBindViewHolder updating headers. diff --git a/java/com/android/dialer/contactsfragment/FastScroller.java b/java/com/android/dialer/contactsfragment/FastScroller.java index 2a86a3bb6..2bd07ac5d 100644 --- a/java/com/android/dialer/contactsfragment/FastScroller.java +++ b/java/com/android/dialer/contactsfragment/FastScroller.java @@ -81,8 +81,13 @@ public class FastScroller extends RelativeLayout { container.setVisibility(INVISIBLE); scrollBar.setSelected(false); return true; + default: + return super.onTouchEvent(event); } - return super.onTouchEvent(event); + } + + public boolean isDragStarted() { + return dragStarted; } private void setRecyclerViewPosition(float y) { |