mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 15:56:49 +00:00
Removing Launcher dependency from Folders
This allows opening/closing folders without a Launcher context Bug: 187353581 Test: Manual Change-Id: Id73a40445a23004eb554f0422d286aa0ff6b3c41
This commit is contained in:
@@ -59,7 +59,7 @@ import com.android.launcher3.util.Thunk;
|
||||
import com.android.launcher3.views.ActivityContext;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* An abstraction of the original Workspace which supports browsing through a
|
||||
@@ -295,18 +295,16 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently visible pages.
|
||||
* Executes the callback against each visible page
|
||||
*/
|
||||
public Iterable<View> getVisiblePages() {
|
||||
public void forEachVisiblePage(Consumer<View> callback) {
|
||||
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);
|
||||
callback.accept(page);
|
||||
}
|
||||
}
|
||||
return visiblePages;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1034,7 +1032,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
|
||||
getVisiblePages().forEach(View::cancelLongPress);
|
||||
forEachVisiblePage(View::cancelLongPress);
|
||||
}
|
||||
|
||||
protected float getScrollProgress(int screenCenter, View v, int page) {
|
||||
|
||||
Reference in New Issue
Block a user