Loading go/quickstep/src/com/android/quickstep/views/IconRecentsView.java +0 −7 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ import static androidx.recyclerview.widget.LinearLayoutManager.VERTICAL; 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; Loading @@ -33,7 +32,6 @@ import android.util.AttributeSet; import android.util.FloatProperty; import android.view.View; import android.view.ViewDebug; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.widget.FrameLayout; Loading @@ -47,7 +45,6 @@ import androidx.recyclerview.widget.RecyclerView.AdapterDataObserver; 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; Loading Loading @@ -106,7 +103,6 @@ public final class IconRecentsView extends FrameLayout { private final DefaultItemAnimator mDefaultItemAnimator = new DefaultItemAnimator(); private final ContentFillItemAnimator mLoadingContentItemAnimator = new ContentFillItemAnimator(); private final DeviceProfile mDeviceProfile; private RecentsToActivityHelper mActivityHelper; private RecyclerView mTaskRecyclerView; Loading Loading @@ -137,7 +133,6 @@ public final class IconRecentsView extends FrameLayout { 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()); Loading @@ -151,8 +146,6 @@ public final class IconRecentsView extends FrameLayout { 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 */)); Loading go/quickstep/src/com/android/quickstep/views/TaskLayoutUtils.java +3 −25 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ import static com.android.quickstep.TaskAdapter.MAX_TASKS_TO_DISPLAY; import android.content.Context; import com.android.launcher3.DeviceProfile; import com.android.launcher3.InvariantDeviceProfile; /** Loading @@ -27,18 +26,8 @@ import com.android.launcher3.InvariantDeviceProfile; */ 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 Loading @@ -54,19 +43,8 @@ public final class TaskLayoutUtils { 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; } } Loading
go/quickstep/src/com/android/quickstep/views/IconRecentsView.java +0 −7 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ import static androidx.recyclerview.widget.LinearLayoutManager.VERTICAL; 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; Loading @@ -33,7 +32,6 @@ import android.util.AttributeSet; import android.util.FloatProperty; import android.view.View; import android.view.ViewDebug; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.widget.FrameLayout; Loading @@ -47,7 +45,6 @@ import androidx.recyclerview.widget.RecyclerView.AdapterDataObserver; 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; Loading Loading @@ -106,7 +103,6 @@ public final class IconRecentsView extends FrameLayout { private final DefaultItemAnimator mDefaultItemAnimator = new DefaultItemAnimator(); private final ContentFillItemAnimator mLoadingContentItemAnimator = new ContentFillItemAnimator(); private final DeviceProfile mDeviceProfile; private RecentsToActivityHelper mActivityHelper; private RecyclerView mTaskRecyclerView; Loading Loading @@ -137,7 +133,6 @@ public final class IconRecentsView extends FrameLayout { 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()); Loading @@ -151,8 +146,6 @@ public final class IconRecentsView extends FrameLayout { 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 */)); Loading
go/quickstep/src/com/android/quickstep/views/TaskLayoutUtils.java +3 −25 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ import static com.android.quickstep.TaskAdapter.MAX_TASKS_TO_DISPLAY; import android.content.Context; import com.android.launcher3.DeviceProfile; import com.android.launcher3.InvariantDeviceProfile; /** Loading @@ -27,18 +26,8 @@ import com.android.launcher3.InvariantDeviceProfile; */ 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 Loading @@ -54,19 +43,8 @@ public final class TaskLayoutUtils { 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; } }