mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
Refactoring all apps search to support external search bar.
- Adding support for an external search bar that can be used to search a container view. This adds a new interface AllAppsSearchController which manages the external search bar. Each controller will have its own search implementation which means that we no longer need a common AppSearchManager interface. - Removing elevation controller as we no longer have a builtin search bar in all apps - Refactoring container view insets so that they behave the same in all containers. - Refactoring apps view to ensure that we only update the number of columns with the available width - Cleaning up LauncherCallbacks interface Bug: 20127840 Bug: 21494973 Change-Id: I710b8e18196961d77d8a29f0c345531d480936fe
This commit is contained in:
@@ -223,26 +223,22 @@ public class DeviceProfile {
|
||||
folderCellHeightPx = cellHeightPx + edgeMarginPx;
|
||||
folderBackgroundOffset = -edgeMarginPx;
|
||||
folderIconSizePx = iconSizePx + 2 * -folderBackgroundOffset;
|
||||
|
||||
updateAppsViewNumCols(res, 0);
|
||||
}
|
||||
|
||||
public boolean updateAppsViewNumCols(Resources res, int containerWidth) {
|
||||
/**
|
||||
* @param recyclerViewWidth the available width of the AllAppsRecyclerView
|
||||
*/
|
||||
public void updateAppsViewNumCols(Resources res, int recyclerViewWidth) {
|
||||
int appsViewLeftMarginPx =
|
||||
res.getDimensionPixelSize(R.dimen.all_apps_grid_view_start_margin);
|
||||
int allAppsCellWidthGap =
|
||||
res.getDimensionPixelSize(R.dimen.all_apps_icon_width_gap);
|
||||
int availableAppsWidthPx = (containerWidth > 0) ? containerWidth : availableWidthPx;
|
||||
int availableAppsWidthPx = (recyclerViewWidth > 0) ? recyclerViewWidth : availableWidthPx;
|
||||
int numAppsCols = (availableAppsWidthPx - appsViewLeftMarginPx) /
|
||||
(allAppsIconSizePx + allAppsCellWidthGap);
|
||||
int numPredictiveAppCols = Math.max(inv.minAllAppsPredictionColumns, numAppsCols);
|
||||
if ((numAppsCols != allAppsNumCols) ||
|
||||
(numPredictiveAppCols != allAppsNumPredictiveCols)) {
|
||||
allAppsNumCols = numAppsCols;
|
||||
allAppsNumPredictiveCols = numPredictiveAppCols;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
allAppsNumCols = numAppsCols;
|
||||
allAppsNumPredictiveCols = numPredictiveAppCols;
|
||||
}
|
||||
|
||||
/** Returns the search bar top offset */
|
||||
|
||||
Reference in New Issue
Block a user