mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Merge "Fix NPE in FolderPagedView" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6597d5ec3c
@@ -31,6 +31,8 @@ import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.ViewDebug;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.AbstractFloatingView;
|
||||
import com.android.launcher3.BubbleTextView;
|
||||
import com.android.launcher3.CellLayout;
|
||||
@@ -230,11 +232,13 @@ public class FolderPagedView extends PagedView<PageIndicatorDots> implements Cli
|
||||
return textView;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CellLayout getPageAt(int index) {
|
||||
return (CellLayout) getChildAt(index);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public CellLayout getCurrentCellLayout() {
|
||||
return getPageAt(getNextPage());
|
||||
}
|
||||
@@ -381,7 +385,7 @@ public class FolderPagedView extends PagedView<PageIndicatorDots> implements Cli
|
||||
}
|
||||
|
||||
private View getViewInCurrentPage(ToIntFunction<ShortcutAndWidgetContainer> rankProvider) {
|
||||
if (getChildCount() < 1) {
|
||||
if (getChildCount() < 1 || getCurrentCellLayout() == null) {
|
||||
return null;
|
||||
}
|
||||
ShortcutAndWidgetContainer container = getCurrentCellLayout().getShortcutsAndWidgets();
|
||||
|
||||
Reference in New Issue
Block a user