Move UnionDecorationHandler to Launcher

- Create base SectionDecorationInfo.java and RecyclerViewAnimationController.java
- SearchTransitionController now inherits from RecyclerViewAnimationController where RecyclerViewAnimationController will control
animation for private space

Bug: 299294792
Test: Verified SearchTransitionController didn't regress by turning off BACKGROUND_DRAWABLES flag.
- Verified QL highlight still works
- video: https://drive.google.com/file/d/15yjBWofebn6m7VgEnLK6kEYqhC_adJQ3/view?usp=sharing

Flag: None
Change-Id: If34f4bb199be0e113485279931d2927cb9fad397
This commit is contained in:
Brandon Dayauon
2023-11-17 15:05:58 -08:00
parent aa84ba761e
commit 763e40d747
9 changed files with 657 additions and 263 deletions
@@ -36,7 +36,11 @@ import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.util.Consumer;
import androidx.recyclerview.widget.RecyclerView;
import com.android.launcher3.DeviceProfile;
@@ -57,6 +61,7 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
protected static final String TAG = "AllAppsRecyclerView";
private static final boolean DEBUG = false;
private static final boolean DEBUG_LATENCY = Utilities.isPropertyEnabled(SEARCH_LOGGING);
private Consumer<View> mChildAttachedConsumer;
protected final int mNumAppsPerRow;
private final AllAppsFastScrollHelper mFastScrollHelper;
@@ -282,6 +287,22 @@ public class AllAppsRecyclerView extends FastScrollRecyclerView {
}
}
/**
* This will be called just before a new child is attached to the window. Passing in null will
* remove the consumer.
*/
protected void setChildAttachedConsumer(@Nullable Consumer<View> childAttachedConsumer) {
mChildAttachedConsumer = childAttachedConsumer;
}
@Override
public void onChildAttachedToWindow(@NonNull View child) {
if (mChildAttachedConsumer != null) {
mChildAttachedConsumer.accept(child);
}
super.onChildAttachedToWindow(child);
}
@Override
public int getScrollBarTop() {
return ActivityContext.lookupContext(getContext()).getAppsView().isSearchSupported()