Merge "Remove old recyclerview layout logic" into ub-launcher3-master
diff --git a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
index 09d5ae6..ec02e9d 100644
--- a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
+++ b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
@@ -19,7 +19,6 @@
 
 import static com.android.quickstep.TaskAdapter.CHANGE_EVENT_TYPE_EMPTY_TO_CONTENT;
 import static com.android.quickstep.TaskAdapter.TASKS_START_POSITION;
-import static com.android.quickstep.views.TaskLayoutUtils.getTaskListHeight;
 
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
@@ -33,7 +32,6 @@
 import android.util.FloatProperty;
 import android.view.View;
 import android.view.ViewDebug;
-import android.view.ViewGroup;
 import android.view.ViewTreeObserver;
 import android.widget.FrameLayout;
 
@@ -47,7 +45,6 @@
 import androidx.recyclerview.widget.RecyclerView.OnChildAttachStateChangeListener;
 
 import com.android.launcher3.BaseActivity;
-import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.R;
 import com.android.quickstep.ContentFillItemAnimator;
 import com.android.quickstep.RecentsModel;
@@ -106,7 +103,6 @@
     private final DefaultItemAnimator mDefaultItemAnimator = new DefaultItemAnimator();
     private final ContentFillItemAnimator mLoadingContentItemAnimator =
             new ContentFillItemAnimator();
-    private final DeviceProfile mDeviceProfile;
 
     private RecentsToActivityHelper mActivityHelper;
     private RecyclerView mTaskRecyclerView;
@@ -137,7 +133,6 @@
         super(context, attrs);
         BaseActivity activity = BaseActivity.fromContext(context);
         mContext = context;
-        mDeviceProfile = activity.getDeviceProfile();
         mTaskLoader = new TaskListLoader(mContext);
         mTaskAdapter = new TaskAdapter(mTaskLoader);
         mTaskAdapter.setOnClearAllClickListener(view -> animateClearAllTasks());
@@ -151,8 +146,6 @@
         super.onFinishInflate();
         if (mTaskRecyclerView == null) {
             mTaskRecyclerView = findViewById(R.id.recent_task_recycler_view);
-            ViewGroup.LayoutParams recyclerViewParams = mTaskRecyclerView.getLayoutParams();
-            recyclerViewParams.height = getTaskListHeight(mDeviceProfile);
             mTaskRecyclerView.setAdapter(mTaskAdapter);
             mTaskRecyclerView.setLayoutManager(
                     new LinearLayoutManager(mContext, VERTICAL, true /* reverseLayout */));
diff --git a/go/quickstep/src/com/android/quickstep/views/TaskLayoutUtils.java b/go/quickstep/src/com/android/quickstep/views/TaskLayoutUtils.java
index bda3e4d..f7d6495 100644
--- a/go/quickstep/src/com/android/quickstep/views/TaskLayoutUtils.java
+++ b/go/quickstep/src/com/android/quickstep/views/TaskLayoutUtils.java
@@ -19,7 +19,6 @@
 
 import android.content.Context;
 
-import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.InvariantDeviceProfile;
 
 /**
@@ -27,18 +26,8 @@
  */
 public final class TaskLayoutUtils {
 
-    private static final float BUTTON_TO_DEVICE_HEIGHT_RATIO = 36.0f/569;
-    private static final float BUTTON_WIDTH_TO_HEIGHT_RATIO = 53.0f/18;
-    private static final float BUTTON_MARGIN_TO_BUTTON_HEIGHT_RATIO = 5.0f/9;
-
     private TaskLayoutUtils() {}
 
-    public static int getTaskListHeight(DeviceProfile dp) {
-        // TODO: Remove this as task height is determined directly from device height.
-        int clearAllSpace = getClearAllButtonHeight(dp) + 2 * getClearAllButtonTopBottomMargin(dp);
-        return getDeviceLongWidth(dp) - clearAllSpace;
-    }
-
     /**
      * Calculate task height based off the available height in portrait mode such that when the
      * recents list is full, the total height fills in the available device height perfectly. In
@@ -54,19 +43,8 @@
         return (int) (availableHeight * 1.0f / MAX_TASKS_TO_DISPLAY);
     }
 
-    public static int getClearAllButtonHeight(DeviceProfile dp) {
-        return (int) (BUTTON_TO_DEVICE_HEIGHT_RATIO * getDeviceLongWidth(dp));
-    }
-
-    public static int getClearAllButtonWidth(DeviceProfile dp) {
-        return (int) (BUTTON_WIDTH_TO_HEIGHT_RATIO * getClearAllButtonHeight(dp));
-    }
-
-    public static int getClearAllButtonTopBottomMargin(DeviceProfile dp) {
-        return (int) (BUTTON_MARGIN_TO_BUTTON_HEIGHT_RATIO * getClearAllButtonHeight(dp));
-    }
-
-    private static int getDeviceLongWidth(DeviceProfile dp) {
-        return Math.max(dp.availableHeightPx, dp.availableWidthPx);
+    public static int getClearAllButtonHeight(Context context) {
+        // TODO: Implement this
+        return 0;
     }
 }