OSDN Git Service

all apps should pull down when there isn't scrollable thumb
authorHyunyoung Song <hyunyoungs@google.com>
Wed, 13 Jul 2016 00:10:38 +0000 (17:10 -0700)
committerHyunyoung Song <hyunyoungs@google.com>
Wed, 13 Jul 2016 00:10:38 +0000 (17:10 -0700)
b/30059445

Change-Id: I4d28b9718746398b078e329cb5a92d5991bc0102

src/com/android/launcher3/allapps/AllAppsContainerView.java

index 717ce74..7b1aaa9 100644 (file)
@@ -269,8 +269,9 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
         if (mAppsRecyclerView.getScrollBar().isNearThumb(point[0], point[1])) {
             return false;
         }
-        // If scroller is at the very top, then it's okay for the container to be pulled down.
-        if (Float.compare(0f, mAppsRecyclerView.getScrollBar().getThumbOffset().y) == 0) {
+        // IF scroller is at the very top OR there is no scroll bar because there is probably not
+        // enough items to scroll, THEN it's okay for the container to be pulled down.
+        if (mAppsRecyclerView.getScrollBar().getThumbOffset().y <= 0) {
             return true;
         }
         return false;