Refactored section names to only draw when there is space.
- This CL removes all space for section names in both phones and tablets. And when there are no section names, the layout will automatically fully merge the sections. Bug: 20222023 Change-Id: Ic7c751d86f095e5cbd690bfd4f94bb5b00ff8ae4
This commit is contained in:
1 parent
c332934e27
commit
fbc5b18626
6 files changed
+134
-108
No files matched your search
@@ -39,6 +39,7 @@ public class AllAppsRecyclerView extends BaseRecyclerView
|
||||
private int mNumAppsPerRow;
|
||||
private int mNumPredictedAppsPerRow;
|
||||
private int mPredictionBarHeight;
|
||||
private int mLastFastscrollPosition = -1;
|
||||
|
||||
private Launcher mLauncher;
|
||||
|
||||
@@ -131,6 +132,11 @@ public class AllAppsRecyclerView extends BaseRecyclerView
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFastScrollingEnd() {
|
||||
mLastFastscrollPosition = -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps the touch (from 0..1) to the adapter position that should be visible.
|
||||
*/
|
||||
@@ -174,12 +180,14 @@ public class AllAppsRecyclerView extends BaseRecyclerView
|
||||
|
||||
// Scroll to the view at the position, anchored at the top of the screen. We call the scroll
|
||||
// method on the LayoutManager directly since it is not exposed by RecyclerView.
|
||||
layoutManager.scrollToPositionWithOffset(lastScrollSection.appItem.position, 0);
|
||||
if (mLastFastscrollPosition != lastScrollSection.appItem.position) {
|
||||
mLastFastscrollPosition = lastScrollSection.appItem.position;
|
||||
layoutManager.scrollToPositionWithOffset(lastScrollSection.appItem.position, 0);
|
||||
}
|
||||
|
||||
return lastScrollSection.sectionName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the row index for a app index in the list.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user