Adding AppsStore for handling various app updates

Change-Id: Ia2242ce583576ace0924ef7142793ba37f4adcb9
This commit is contained in:
Sunny Goyal
2018-01-23 15:40:50 -08:00
parent 0680895528
commit 426345bfc4
11 changed files with 257 additions and 461 deletions

View File

@@ -37,6 +37,7 @@ import com.android.launcher3.ExtendedEditText;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
import com.android.launcher3.allapps.AllAppsContainerView;
import com.android.launcher3.allapps.AllAppsStore;
import com.android.launcher3.allapps.AlphabeticalAppsList;
import com.android.launcher3.allapps.SearchUiManager;
import com.android.launcher3.graphics.TintedDrawableSpan;
@@ -48,7 +49,8 @@ import java.util.ArrayList;
* Layout to contain the All-apps search UI.
*/
public class AppsSearchContainerLayout extends FrameLayout
implements SearchUiManager, AllAppsSearchBarController.Callbacks {
implements SearchUiManager, AllAppsSearchBarController.Callbacks,
AllAppsStore.OnUpdateListener {
private final Launcher mLauncher;
private final int mMinHeight;
@@ -110,6 +112,18 @@ public class AppsSearchContainerLayout extends FrameLayout
}
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
mLauncher.getAppsView().getAppsStore().addUpdateListener(this);
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
mLauncher.getAppsView().getAppsStore().removeUpdateListener(this);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (!mLauncher.getDeviceProfile().isVerticalBarLayout()) {
@@ -134,7 +148,7 @@ public class AppsSearchContainerLayout extends FrameLayout
}
@Override
public void refreshSearchResult() {
public void onAppsUpdated() {
mSearchBarController.refreshSearchResult();
}