Changing the overviewState to show appsearch and floating header

Change-Id: I2cfd61cfc9978e4c8e4520f0f7217e49e7344c79
This commit is contained in:
Sunny Goyal
2018-03-14 17:51:49 -07:00
parent 9d69c8da9a
commit 7185dd63eb
35 changed files with 860 additions and 1292 deletions

View File

@@ -217,14 +217,14 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
/**
* Resets the state of AllApps.
*/
public void reset() {
public void reset(boolean animate) {
for (int i = 0; i < mAH.length; i++) {
if (mAH[i].recyclerView != null) {
mAH[i].recyclerView.scrollToTop();
}
}
if (isHeaderVisible()) {
mHeader.reset();
mHeader.reset(animate);
}
// Reset the search bar and base recycler view after transitioning home
mSearchUiManager.resetSearch();
@@ -360,7 +360,7 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
public void onTabChanged(int pos) {
mHeader.setMainActive(pos == 0);
reset();
reset(true /* animate */);
if (mAH[pos].recyclerView != null) {
mAH[pos].recyclerView.bindFastScrollbar();
@@ -383,6 +383,18 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
return mHeader;
}
public View getSearchView() {
return mSearchContainer;
}
public View getContentView() {
return mViewPager == null ? getActiveRecyclerView() : mViewPager;
}
public RecyclerViewFastScroller getScrollBar() {
return getActiveRecyclerView().getScrollbar();
}
public void setupHeader() {
mHeader.setVisibility(View.VISIBLE);
mHeader.setup(mAH, mAH[AllAppsContainerView.AdapterHolder.WORK].recyclerView == null);