Apply the expand animation on Private Space

- Using the refactoring that took place in ag/25414154

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: ACONFIG com.android.launcher3.Flags.private_space_animation DEVELOPMENT

Change-Id: Ib6229b404b48616966f3e6ab6884099b6e4b4023
This commit is contained in:
Brandon Dayauon
2023-11-17 15:55:37 -08:00
parent 96901c4541
commit 98bf9f7532
5 changed files with 94 additions and 68 deletions
@@ -15,6 +15,12 @@
*/
package com.android.launcher3.allapps;
import static com.android.launcher3.allapps.SectionDecorationInfo.ROUND_BOTTOM_LEFT;
import static com.android.launcher3.allapps.SectionDecorationInfo.ROUND_BOTTOM_RIGHT;
import static com.android.launcher3.allapps.SectionDecorationInfo.ROUND_TOP_LEFT;
import static com.android.launcher3.allapps.SectionDecorationInfo.ROUND_TOP_RIGHT;
import static com.android.launcher3.allapps.UserProfileManager.STATE_DISABLED;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
@@ -108,6 +114,13 @@ public abstract class BaseAllAppsAdapter<T extends Context & ActivityContext> ex
return item;
}
public static AdapterItem asAppWithDecorationInfo(AppInfo appInfo,
SectionDecorationInfo decorationInfo) {
AdapterItem item = asApp(appInfo);
item.decorationInfo = decorationInfo;
return item;
}
protected boolean isCountedForAccessibility() {
return viewType == VIEW_TYPE_ICON;
}
@@ -259,6 +272,15 @@ public abstract class BaseAllAppsAdapter<T extends Context & ActivityContext> ex
assert mPrivateSpaceHeaderViewController != null;
assert psHeaderLayout != null;
mPrivateSpaceHeaderViewController.addPrivateSpaceHeaderViewElements(psHeaderLayout);
AdapterItem adapterItem = mApps.getAdapterItems().get(position);
int roundRegions = ROUND_TOP_LEFT | ROUND_TOP_RIGHT;
if (mPrivateSpaceHeaderViewController.getPrivateProfileManager().getCurrentState()
== STATE_DISABLED) {
roundRegions |= (ROUND_BOTTOM_LEFT | ROUND_BOTTOM_RIGHT);
}
adapterItem.decorationInfo =
new SectionDecorationInfo(mActivityContext, roundRegions,
false /* decorateTogether */);
break;
case VIEW_TYPE_ALL_APPS_DIVIDER:
case VIEW_TYPE_WORK_DISABLED_CARD: