Merge "[AllAppsHeader] Add override system for implementer to add plugin rows to the header of all apps grid" into main
This commit is contained in:
commit
1e154280fd
2 files changed
+22
-2
No files matched your search
@@ -95,6 +95,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;
|
||||
@@ -152,6 +153,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;
|
||||
@@ -262,6 +264,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);
|
||||
@@ -288,6 +292,10 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
mSearchUiManager = (SearchUiManager) mSearchContainer;
|
||||
}
|
||||
|
||||
public List<AllAppsRow> getAdditionalHeaderRows() {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
@@ -714,6 +722,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(
|
||||
@@ -731,6 +741,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