Loading go/quickstep/res/layout/icon_recents_root_view.xml +2 −3 Original line number Diff line number Diff line Loading @@ -33,10 +33,9 @@ android:scrollbars="none"/> <Button android:id="@+id/clear_all_button" android:layout_width="@dimen/clear_all_button_width" android:layout_height="@dimen/clear_all_button_height" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginVertical="@dimen/task_item_half_vert_margin" android:background="@drawable/clear_all_button" android:gravity="center" android:text="@string/recents_clear_all" Loading go/quickstep/res/layout/task_item_view.xml +7 −8 Original line number Diff line number Diff line Loading @@ -21,20 +21,19 @@ android:orientation="horizontal"> <FrameLayout android:id="@+id/task_icon_and_thumbnail" android:layout_width="@dimen/task_thumbnail_and_icon_view_size" android:layout_height="@dimen/task_thumbnail_and_icon_view_size" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center_vertical" android:layout_marginHorizontal="8dp" android:layout_marginVertical="@dimen/task_item_half_vert_margin"> android:layout_marginHorizontal="8dp"> <ImageView android:id="@+id/task_thumbnail" android:layout_width="@dimen/task_thumbnail_width" android:layout_height="@dimen/task_thumbnail_height" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="top|start"/> <ImageView android:id="@+id/task_icon" android:layout_width="@dimen/task_icon_size" android:layout_height="@dimen/task_icon_size" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end"/> </FrameLayout> <TextView Loading go/quickstep/res/values/dimens.xmldeleted 100644 → 0 +0 −26 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2019 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <resources> <dimen name="task_item_half_vert_margin">8dp</dimen> <dimen name="task_thumbnail_and_icon_view_size">60dp</dimen> <dimen name="task_thumbnail_height">60dp</dimen> <dimen name="task_thumbnail_width">36dp</dimen> <dimen name="task_icon_size">36dp</dimen> <dimen name="clear_all_button_width">106dp</dimen> <dimen name="clear_all_button_height">36dp</dimen> </resources> No newline at end of file go/quickstep/src/com/android/quickstep/TaskAdapter.java +15 −2 Original line number Diff line number Diff line Loading @@ -15,12 +15,18 @@ */ package com.android.quickstep; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static com.android.quickstep.views.TaskLayoutUtils.getTaskHeight; import static com.android.quickstep.views.TaskLayoutUtils.getTaskTopMargin; import android.view.LayoutInflater; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView.Adapter; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; import com.android.quickstep.views.TaskItemView; import com.android.systemui.shared.recents.model.Task; Loading @@ -35,15 +41,17 @@ import java.util.Objects; public final class TaskAdapter extends Adapter<TaskHolder> { public static final int CHANGE_EVENT_TYPE_EMPTY_TO_CONTENT = 0; public static final int MAX_TASKS_TO_DISPLAY = 6; private static final int MAX_TASKS_TO_DISPLAY = 6; private static final String TAG = "TaskAdapter"; private final TaskListLoader mLoader; private final DeviceProfile mDeviceProfile; private TaskActionController mTaskActionController; private boolean mIsShowingLoadingUi; public TaskAdapter(@NonNull TaskListLoader loader) { public TaskAdapter(@NonNull TaskListLoader loader, DeviceProfile dp) { mLoader = loader; mDeviceProfile = dp; } public void setActionController(TaskActionController taskActionController) { Loading @@ -66,6 +74,11 @@ public final class TaskAdapter extends Adapter<TaskHolder> { public TaskHolder onCreateViewHolder(ViewGroup parent, int viewType) { TaskItemView itemView = (TaskItemView) LayoutInflater.from(parent.getContext()) .inflate(R.layout.task_item_view, parent, false); ViewGroup.MarginLayoutParams itemViewParams = (ViewGroup.MarginLayoutParams) itemView.getLayoutParams(); itemViewParams.width = MATCH_PARENT; itemViewParams.height = getTaskHeight(mDeviceProfile); itemViewParams.topMargin = getTaskTopMargin(mDeviceProfile); TaskHolder holder = new TaskHolder(itemView); itemView.setOnClickListener(view -> mTaskActionController.launchTask(holder)); return holder; Loading go/quickstep/src/com/android/quickstep/views/IconRecentsView.java +19 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,10 @@ package com.android.quickstep.views; import static androidx.recyclerview.widget.LinearLayoutManager.VERTICAL; import static com.android.quickstep.TaskAdapter.CHANGE_EVENT_TYPE_EMPTY_TO_CONTENT; import static com.android.quickstep.views.TaskLayoutUtils.getClearAllButtonHeight; import static com.android.quickstep.views.TaskLayoutUtils.getClearAllButtonTopBottomMargin; import static com.android.quickstep.views.TaskLayoutUtils.getClearAllButtonWidth; import static com.android.quickstep.views.TaskLayoutUtils.getTaskListHeight; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; Loading @@ -31,6 +35,7 @@ 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 @@ -43,6 +48,8 @@ import androidx.recyclerview.widget.RecyclerView; 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.RecentsToActivityHelper; Loading Loading @@ -96,6 +103,7 @@ 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 @@ -109,9 +117,11 @@ public final class IconRecentsView extends FrameLayout { public IconRecentsView(Context context, AttributeSet attrs) { super(context, attrs); BaseActivity activity = BaseActivity.fromContext(context); mContext = context; mDeviceProfile = activity.getDeviceProfile(); mTaskLoader = new TaskListLoader(mContext); mTaskAdapter = new TaskAdapter(mTaskLoader); mTaskAdapter = new TaskAdapter(mTaskLoader, mDeviceProfile); mTaskActionController = new TaskActionController(mTaskLoader, mTaskAdapter); mTaskAdapter.setActionController(mTaskActionController); } Loading @@ -121,6 +131,8 @@ 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 Loading @@ -159,6 +171,12 @@ public final class IconRecentsView extends FrameLayout { } }); mClearAllView = findViewById(R.id.clear_all_button); MarginLayoutParams clearAllParams = (MarginLayoutParams) mClearAllView.getLayoutParams(); clearAllParams.height = getClearAllButtonHeight(mDeviceProfile); clearAllParams.width = getClearAllButtonWidth(mDeviceProfile); clearAllParams.topMargin = getClearAllButtonTopBottomMargin(mDeviceProfile); clearAllParams.bottomMargin = getClearAllButtonTopBottomMargin(mDeviceProfile); mClearAllView.setOnClickListener(v -> animateClearAllTasks()); } } Loading Loading
go/quickstep/res/layout/icon_recents_root_view.xml +2 −3 Original line number Diff line number Diff line Loading @@ -33,10 +33,9 @@ android:scrollbars="none"/> <Button android:id="@+id/clear_all_button" android:layout_width="@dimen/clear_all_button_width" android:layout_height="@dimen/clear_all_button_height" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginVertical="@dimen/task_item_half_vert_margin" android:background="@drawable/clear_all_button" android:gravity="center" android:text="@string/recents_clear_all" Loading
go/quickstep/res/layout/task_item_view.xml +7 −8 Original line number Diff line number Diff line Loading @@ -21,20 +21,19 @@ android:orientation="horizontal"> <FrameLayout android:id="@+id/task_icon_and_thumbnail" android:layout_width="@dimen/task_thumbnail_and_icon_view_size" android:layout_height="@dimen/task_thumbnail_and_icon_view_size" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center_vertical" android:layout_marginHorizontal="8dp" android:layout_marginVertical="@dimen/task_item_half_vert_margin"> android:layout_marginHorizontal="8dp"> <ImageView android:id="@+id/task_thumbnail" android:layout_width="@dimen/task_thumbnail_width" android:layout_height="@dimen/task_thumbnail_height" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="top|start"/> <ImageView android:id="@+id/task_icon" android:layout_width="@dimen/task_icon_size" android:layout_height="@dimen/task_icon_size" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end"/> </FrameLayout> <TextView Loading
go/quickstep/res/values/dimens.xmldeleted 100644 → 0 +0 −26 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2019 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <resources> <dimen name="task_item_half_vert_margin">8dp</dimen> <dimen name="task_thumbnail_and_icon_view_size">60dp</dimen> <dimen name="task_thumbnail_height">60dp</dimen> <dimen name="task_thumbnail_width">36dp</dimen> <dimen name="task_icon_size">36dp</dimen> <dimen name="clear_all_button_width">106dp</dimen> <dimen name="clear_all_button_height">36dp</dimen> </resources> No newline at end of file
go/quickstep/src/com/android/quickstep/TaskAdapter.java +15 −2 Original line number Diff line number Diff line Loading @@ -15,12 +15,18 @@ */ package com.android.quickstep; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static com.android.quickstep.views.TaskLayoutUtils.getTaskHeight; import static com.android.quickstep.views.TaskLayoutUtils.getTaskTopMargin; import android.view.LayoutInflater; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView.Adapter; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; import com.android.quickstep.views.TaskItemView; import com.android.systemui.shared.recents.model.Task; Loading @@ -35,15 +41,17 @@ import java.util.Objects; public final class TaskAdapter extends Adapter<TaskHolder> { public static final int CHANGE_EVENT_TYPE_EMPTY_TO_CONTENT = 0; public static final int MAX_TASKS_TO_DISPLAY = 6; private static final int MAX_TASKS_TO_DISPLAY = 6; private static final String TAG = "TaskAdapter"; private final TaskListLoader mLoader; private final DeviceProfile mDeviceProfile; private TaskActionController mTaskActionController; private boolean mIsShowingLoadingUi; public TaskAdapter(@NonNull TaskListLoader loader) { public TaskAdapter(@NonNull TaskListLoader loader, DeviceProfile dp) { mLoader = loader; mDeviceProfile = dp; } public void setActionController(TaskActionController taskActionController) { Loading @@ -66,6 +74,11 @@ public final class TaskAdapter extends Adapter<TaskHolder> { public TaskHolder onCreateViewHolder(ViewGroup parent, int viewType) { TaskItemView itemView = (TaskItemView) LayoutInflater.from(parent.getContext()) .inflate(R.layout.task_item_view, parent, false); ViewGroup.MarginLayoutParams itemViewParams = (ViewGroup.MarginLayoutParams) itemView.getLayoutParams(); itemViewParams.width = MATCH_PARENT; itemViewParams.height = getTaskHeight(mDeviceProfile); itemViewParams.topMargin = getTaskTopMargin(mDeviceProfile); TaskHolder holder = new TaskHolder(itemView); itemView.setOnClickListener(view -> mTaskActionController.launchTask(holder)); return holder; Loading
go/quickstep/src/com/android/quickstep/views/IconRecentsView.java +19 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,10 @@ package com.android.quickstep.views; import static androidx.recyclerview.widget.LinearLayoutManager.VERTICAL; import static com.android.quickstep.TaskAdapter.CHANGE_EVENT_TYPE_EMPTY_TO_CONTENT; import static com.android.quickstep.views.TaskLayoutUtils.getClearAllButtonHeight; import static com.android.quickstep.views.TaskLayoutUtils.getClearAllButtonTopBottomMargin; import static com.android.quickstep.views.TaskLayoutUtils.getClearAllButtonWidth; import static com.android.quickstep.views.TaskLayoutUtils.getTaskListHeight; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; Loading @@ -31,6 +35,7 @@ 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 @@ -43,6 +48,8 @@ import androidx.recyclerview.widget.RecyclerView; 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.RecentsToActivityHelper; Loading Loading @@ -96,6 +103,7 @@ 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 @@ -109,9 +117,11 @@ public final class IconRecentsView extends FrameLayout { public IconRecentsView(Context context, AttributeSet attrs) { super(context, attrs); BaseActivity activity = BaseActivity.fromContext(context); mContext = context; mDeviceProfile = activity.getDeviceProfile(); mTaskLoader = new TaskListLoader(mContext); mTaskAdapter = new TaskAdapter(mTaskLoader); mTaskAdapter = new TaskAdapter(mTaskLoader, mDeviceProfile); mTaskActionController = new TaskActionController(mTaskLoader, mTaskAdapter); mTaskAdapter.setActionController(mTaskActionController); } Loading @@ -121,6 +131,8 @@ 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 Loading @@ -159,6 +171,12 @@ public final class IconRecentsView extends FrameLayout { } }); mClearAllView = findViewById(R.id.clear_all_button); MarginLayoutParams clearAllParams = (MarginLayoutParams) mClearAllView.getLayoutParams(); clearAllParams.height = getClearAllButtonHeight(mDeviceProfile); clearAllParams.width = getClearAllButtonWidth(mDeviceProfile); clearAllParams.topMargin = getClearAllButtonTopBottomMargin(mDeviceProfile); clearAllParams.bottomMargin = getClearAllButtonTopBottomMargin(mDeviceProfile); mClearAllView.setOnClickListener(v -> animateClearAllTasks()); } } Loading