[AllAppsHeader] Add override system for implementer to add plugin rows to the header of all apps grid
Bug: b/352346748 Flag: com.google.android.apps.nexuslauncher.zero_state_tile Test: Manual: http://recall/clips/395e9e4f-c20b-4a2b-bff1-a1ca9d5487d4 Change-Id: I65e2e9c68f05a6a387c05d5402ae3f5b2e2fcdba
This commit is contained in:
1 parent
2eea74b623
commit
82222b61c2
2 files changed
+22
-2
No files matched your search
@@ -96,6 +96,7 @@ import com.android.launcher3.views.RecyclerViewFastScroller;
|
||||
import com.android.launcher3.views.ScrimView;
|
||||
import com.android.launcher3.views.SpringRelativeLayout;
|
||||
import com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip;
|
||||
import com.android.systemui.plugins.AllAppsRow;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -166,6 +167,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
private final RectF mTmpRectF = new RectF();
|
||||
protected AllAppsPagedView mViewPager;
|
||||
protected FloatingHeaderView mHeader;
|
||||
protected final List<AllAppsRow> mAdditionalHeaderRows = new ArrayList<>();
|
||||
protected View mBottomSheetBackground;
|
||||
protected RecyclerViewFastScroller mFastScroller;
|
||||
private ConstraintLayout mFastScrollLetterLayout;
|
||||
@@ -278,6 +280,8 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
|
||||
getLayoutInflater().inflate(R.layout.all_apps_content, this);
|
||||
mHeader = findViewById(R.id.all_apps_header);
|
||||
mAdditionalHeaderRows.clear();
|
||||
mAdditionalHeaderRows.addAll(getAdditionalHeaderRows());
|
||||
mBottomSheetBackground = findViewById(R.id.bottom_sheet_background);
|
||||
mBottomSheetHandleArea = findViewById(R.id.bottom_sheet_handle_area);
|
||||
mSearchRecyclerView = findViewById(R.id.search_results_list_view);
|
||||
@@ -300,6 +304,10 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
mSearchUiManager = (SearchUiManager) mSearchContainer;
|
||||
}
|
||||
|
||||
public List<AllAppsRow> getAdditionalHeaderRows() {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
@@ -740,6 +748,8 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
}
|
||||
|
||||
void setupHeader() {
|
||||
mAdditionalHeaderRows.forEach(row -> mHeader.onPluginDisconnected(row));
|
||||
|
||||
mHeader.setVisibility(View.VISIBLE);
|
||||
boolean tabsHidden = !mUsingTabs;
|
||||
mHeader.setup(
|
||||
@@ -757,6 +767,7 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
adapterHolder.mRecyclerView.scrollToTop();
|
||||
}
|
||||
});
|
||||
mAdditionalHeaderRows.forEach(row -> mHeader.onPluginConnected(row, mActivityContext));
|
||||
|
||||
removeCustomRules(mHeader);
|
||||
if (isSearchBarFloating()) {
|
||||
|
||||
Reference in new issue
Block a user