Skip to content

Commit

Permalink
Trebuchet: Fix measuring error when reloading app drawer
Browse files Browse the repository at this point in the history
Issue-id: CYNGNOS-1883

Change-Id: I77705be7020120bc58a45f507b288838a5eba2bb
  • Loading branch information
cretin45 committed Feb 15, 2016
1 parent 84fb9c9 commit 577d342
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/com/android/launcher3/Launcher.java
Expand Up @@ -1885,7 +1885,7 @@ public void reloadAppDrawer() {
setupSearchBar(this);
mAppsView.addApps(addedApps);
tryAndUpdatePredictedApps();
mAppsView.reset();
mAppsView.onReloadAppDrawer();
sRemoteFolderManager.onReloadAppDrawer();
}

Expand Down
12 changes: 10 additions & 2 deletions src/com/android/launcher3/allapps/AllAppsContainerView.java
Expand Up @@ -98,6 +98,8 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
// This coordinate is relative to its parent
private final Point mIconLastTouchPos = new Point();

private boolean mReloadDrawer = false;

private View.OnClickListener mSearchClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down Expand Up @@ -178,11 +180,13 @@ public void addApps(List<AppInfo> apps) {
}

/**
* Resets the existing apps in the list
* Reloads the existing apps in the list
*/
public void reset() {
public void onReloadAppDrawer() {
mReloadDrawer = true;
List<AppInfo> apps = mApps.getApps();
updateApps(apps);
requestLayout();
}

/**
Expand Down Expand Up @@ -378,6 +382,10 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
}

super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if (mReloadDrawer) {
updateBackgroundAndPaddings(true);
mReloadDrawer = false;
}
}

/**
Expand Down

0 comments on commit 577d342

Please sign in to comment.