diff options
author | Mario Bertschler <bmario@google.com> | 2017-10-18 10:31:36 -0700 |
---|---|---|
committer | Mario Bertschler <bmario@google.com> | 2017-11-14 10:28:54 -0800 |
commit | ac9408a5cd7744a8dbc66a61114665ab6e4051de (patch) | |
tree | edb48150310dde96c444ec64952fd9678d825a13 /src/com/android/launcher3/allapps/search | |
parent | f405f507b70c0bd54adcfd69cc2c7a2b245d10d6 (diff) | |
download | android_packages_apps_Trebuchet-ac9408a5cd7744a8dbc66a61114665ab6e4051de.tar.gz android_packages_apps_Trebuchet-ac9408a5cd7744a8dbc66a61114665ab6e4051de.tar.bz2 android_packages_apps_Trebuchet-ac9408a5cd7744a8dbc66a61114665ab6e4051de.zip |
Enable work profile tab in all apps.
This CL will bring two tabs to all apps: Personal and Work,
currently only if the user has a workfile set up and
behind a feature flag defaulting to disabled.
Bug: 68713881
Change-Id: Ib5a558281ef3593359db3ad593ee1d0cf279f547
Diffstat (limited to 'src/com/android/launcher3/allapps/search')
-rw-r--r-- | src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java index ddf6e5849..e65a2c4ea 100644 --- a/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java +++ b/src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java @@ -31,19 +31,19 @@ import android.util.AttributeSet; import android.view.KeyEvent; import android.view.View; import android.widget.FrameLayout; + import com.android.launcher3.DeviceProfile; import com.android.launcher3.ExtendedEditText; import com.android.launcher3.Launcher; import com.android.launcher3.R; -import com.android.launcher3.allapps.AllAppsGridAdapter; -import com.android.launcher3.allapps.AllAppsRecyclerView; +import com.android.launcher3.allapps.AllAppsContainerView; import com.android.launcher3.allapps.AlphabeticalAppsList; import com.android.launcher3.allapps.SearchUiManager; -import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.discovery.AppDiscoveryItem; import com.android.launcher3.discovery.AppDiscoveryUpdateState; import com.android.launcher3.graphics.TintedDrawableSpan; import com.android.launcher3.util.ComponentKey; + import java.util.ArrayList; /** @@ -60,11 +60,9 @@ public class AppsSearchContainerLayout extends FrameLayout private ExtendedEditText mSearchInput; private AlphabeticalAppsList mApps; - private AllAppsRecyclerView mAppsRecyclerView; - private AllAppsGridAdapter mAdapter; private View mDivider; private HeaderElevationController mElevationController; - + private AllAppsContainerView mAppsView; private SpringAnimation mSpring; public AppsSearchContainerLayout(Context context) { @@ -124,14 +122,12 @@ public class AppsSearchContainerLayout extends FrameLayout @Override - public void initialize( - AlphabeticalAppsList appsList, AllAppsRecyclerView recyclerView) { - mApps = appsList; - mAppsRecyclerView = recyclerView; - mAppsRecyclerView.addOnScrollListener(mElevationController); - mAdapter = (AllAppsGridAdapter) mAppsRecyclerView.getAdapter(); + public void initialize(AllAppsContainerView appsView) { + mApps = appsView.getApps(); + mAppsView = appsView; + appsView.addElevationController(mElevationController); mSearchBarController.initialize( - new DefaultAppSearchAlgorithm(appsList.getApps()), mSearchInput, mLauncher, this); + new DefaultAppSearchAlgorithm(mApps.getApps()), mSearchInput, mLauncher, this); } @Override @@ -174,7 +170,7 @@ public class AppsSearchContainerLayout extends FrameLayout if (apps != null) { mApps.setOrderedFilter(apps); notifyResultChanged(); - mAdapter.setLastSearchQuery(query); + mAppsView.setLastSearchQuery(query); } } @@ -201,7 +197,7 @@ public class AppsSearchContainerLayout extends FrameLayout private void notifyResultChanged() { mElevationController.reset(); - mAppsRecyclerView.onSearchResultsChanged(); + mAppsView.onSearchResultsChanged(); } @Override |