Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b6c5feaf authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Fix IndexOutOfBoundsException in grid span lookup

Bug: 262747378
Test: Presubmit
Change-Id: I3ac4f0208874c0b7f41f6d02ee99db660dc04f23
parent 618df8b3
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -203,8 +203,12 @@ public class AllAppsGridAdapter<T extends Context & ActivityContext> extends

        @Override
        public int getSpanSize(int position) {
            int viewType = mApps.getAdapterItems().get(position).viewType;
            int totalSpans = mGridLayoutMgr.getSpanCount();
            List<AdapterItem> items = mApps.getAdapterItems();
            if (position >= items.size()) {
                return totalSpans;
            }
            int viewType = items.get(position).viewType;
            if (isIconViewType(viewType)) {
                return totalSpans / mAppsPerRow;
            } else {