Merge "Revert "Updating the scroll calculation from recyclerView to avoid view inflation"" into tm-qpr-dev

This commit is contained in:
Hui Kang
2022-10-17 21:20:09 +00:00
committed by Android (Google) Code Review
12 changed files with 211 additions and 212 deletions

View File

@@ -26,9 +26,7 @@ import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
import androidx.core.view.accessibility.AccessibilityRecordCompat;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.Adapter;
import com.android.launcher3.util.ScrollableLayoutManager;
import com.android.launcher3.views.ActivityContext;
import java.util.List;
@@ -68,10 +66,10 @@ public class AllAppsGridAdapter<T extends Context & ActivityContext> extends
/**
* A subclass of GridLayoutManager that overrides accessibility values during app search.
*/
public class AppsGridLayoutManager extends ScrollableLayoutManager {
public class AppsGridLayoutManager extends GridLayoutManager {
public AppsGridLayoutManager(Context context) {
super(context);
super(context, 1, GridLayoutManager.VERTICAL, false);
}
@Override
@@ -131,15 +129,6 @@ public class AllAppsGridAdapter<T extends Context & ActivityContext> extends
}
return extraRows;
}
@Override
protected int incrementTotalHeight(Adapter adapter, int position, int heightUntilLastPos) {
AllAppsGridAdapter.AdapterItem item = mApps.getAdapterItems().get(position);
// only account for the first icon in the row since they are the same size within a row
return (isIconViewType(item.viewType) && item.rowAppIndex != 0)
? heightUntilLastPos
: (heightUntilLastPos + mCachedSizes.get(item.viewType));
}
}
@Override