mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Revert "Revert "Updating the scroll calculation from recyclerView to avoid view inflation""
Test: ABTD
https://android-build.googleplex.com/builds/abtd/run/L52600000956969786
This reverts commit cee6ddf3de.
Reason for revert: Fixed in ag/20239136
Change-Id: I0e8446e66d9a86a94b40fcbd6de14da07abe8e5c
This commit is contained in:
@@ -26,7 +26,9 @@ 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;
|
||||
@@ -66,10 +68,10 @@ public class AllAppsGridAdapter<T extends Context & ActivityContext> extends
|
||||
/**
|
||||
* A subclass of GridLayoutManager that overrides accessibility values during app search.
|
||||
*/
|
||||
public class AppsGridLayoutManager extends GridLayoutManager {
|
||||
public class AppsGridLayoutManager extends ScrollableLayoutManager {
|
||||
|
||||
public AppsGridLayoutManager(Context context) {
|
||||
super(context, 1, GridLayoutManager.VERTICAL, false);
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -129,6 +131,15 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user