Loading src/com/android/launcher3/PagedView.java +17 −4 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ import com.android.launcher3.util.Thunk; import com.android.launcher3.views.ActivityContext; import java.util.ArrayList; import java.util.List; /** * An abstraction of the original Workspace which supports browsing through a Loading Loading @@ -303,6 +304,21 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou return 1; } /** * Returns the currently visible pages. */ protected Iterable<View> getVisiblePages() { int panelCount = getPanelCount(); List<View> visiblePages = new ArrayList<>(panelCount); for (int i = mCurrentPage; i < mCurrentPage + panelCount; i++) { View page = getPageAt(i); if (page != null) { visiblePages.add(page); } } return visiblePages; } /** * Returns true if the view is on one of the current pages, false otherwise. */ Loading Loading @@ -1052,10 +1068,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou // Try canceling the long press. It could also have been scheduled // by a distant descendant, so use the mAllowLongPress flag to block // everything final View currentPage = getPageAt(mCurrentPage); if (currentPage != null) { currentPage.cancelLongPress(); } getVisiblePages().forEach(View::cancelLongPress); } protected float getScrollProgress(int screenCenter, View v, int page) { Loading Loading
src/com/android/launcher3/PagedView.java +17 −4 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ import com.android.launcher3.util.Thunk; import com.android.launcher3.views.ActivityContext; import java.util.ArrayList; import java.util.List; /** * An abstraction of the original Workspace which supports browsing through a Loading Loading @@ -303,6 +304,21 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou return 1; } /** * Returns the currently visible pages. */ protected Iterable<View> getVisiblePages() { int panelCount = getPanelCount(); List<View> visiblePages = new ArrayList<>(panelCount); for (int i = mCurrentPage; i < mCurrentPage + panelCount; i++) { View page = getPageAt(i); if (page != null) { visiblePages.add(page); } } return visiblePages; } /** * Returns true if the view is on one of the current pages, false otherwise. */ Loading Loading @@ -1052,10 +1068,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou // Try canceling the long press. It could also have been scheduled // by a distant descendant, so use the mAllowLongPress flag to block // everything final View currentPage = getPageAt(mCurrentPage); if (currentPage != null) { currentPage.cancelLongPress(); } getVisiblePages().forEach(View::cancelLongPress); } protected float getScrollProgress(int screenCenter, View v, int page) { Loading