Adding SecondaryDisplayLauncher in Launcher using common listener

Bug: 141596722
Change-Id: I480bfadf592f7d0309f17c33a3fe14bb77fb5586
This commit is contained in:
Sunny Goyal
2020-01-07 13:07:55 -08:00
parent ae5e991f5e
commit 9c2b96090b
33 changed files with 1369 additions and 255 deletions

View File

@@ -28,14 +28,13 @@ import android.view.View;
import androidx.recyclerview.widget.RecyclerView;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.BaseRecyclerView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.R;
import com.android.launcher3.allapps.AllAppsGridAdapter.AppsGridLayoutManager;
import com.android.launcher3.compat.AccessibilityManagerCompat;
import com.android.launcher3.logging.StatsLogUtils.LogContainerProvider;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
@@ -84,7 +83,7 @@ public class AllAppsRecyclerView extends BaseRecyclerView implements LogContaine
/**
* Sets the list of apps in this view, used to determine the fastscroll position.
*/
public void setApps(AlphabeticalAppsList apps, boolean usingTabs) {
public void setApps(AlphabeticalAppsList apps) {
mApps = apps;
mFastScrollHelper = new AllAppsFastScrollHelper(this, apps);
}
@@ -94,7 +93,7 @@ public class AllAppsRecyclerView extends BaseRecyclerView implements LogContaine
}
private void updatePoolSize() {
DeviceProfile grid = Launcher.getLauncher(getContext()).getDeviceProfile();
DeviceProfile grid = BaseDraggingActivity.fromContext(getContext()).getDeviceProfile();
RecyclerView.RecycledViewPool pool = getRecycledViewPool();
int approxRows = (int) Math.ceil(grid.availableHeightPx / grid.allAppsIconSizePx);
pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_EMPTY_SEARCH, 1);