Recycling taskViews instead of inflating & throwing them away everytime
Bug: 122345781 Change-Id: If86d22729a42b8d5200f24dbf37a568fb9b11a5b
This commit is contained in:
1 parent
23c4fb8128
commit
9e4b32f6a3
8 files changed
+150
-36
No files matched your search
@@ -16,16 +16,13 @@
|
||||
|
||||
package com.android.quickstep;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Matrix;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.AnyThread;
|
||||
|
||||
import com.android.launcher3.BaseActivity;
|
||||
import com.android.launcher3.BaseDraggingActivity;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.util.Preconditions;
|
||||
import com.android.launcher3.util.MainThreadInitializedObject;
|
||||
import com.android.launcher3.util.ResourceBasedOverride;
|
||||
import com.android.quickstep.views.TaskView;
|
||||
import com.android.systemui.shared.recents.model.Task;
|
||||
@@ -34,11 +31,12 @@ import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.AnyThread;
|
||||
|
||||
/**
|
||||
* Factory class to create and add an overlays on the TaskView
|
||||
*/
|
||||
public class TaskOverlayFactory implements ResourceBasedOverride {
|
||||
private static TaskOverlayFactory sInstance;
|
||||
|
||||
/** Note that these will be shown in order from top to bottom, if available for the task. */
|
||||
private static final TaskSystemShortcut[] MENU_OPTIONS = new TaskSystemShortcut[]{
|
||||
@@ -49,14 +47,9 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
|
||||
new TaskSystemShortcut.Freeform()
|
||||
};
|
||||
|
||||
public static TaskOverlayFactory get(Context context) {
|
||||
Preconditions.assertUIThread();
|
||||
if (sInstance == null) {
|
||||
sInstance = Overrides.getObject(TaskOverlayFactory.class,
|
||||
context.getApplicationContext(), R.string.task_overlay_factory_class);
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
public static final MainThreadInitializedObject<TaskOverlayFactory> INSTANCE =
|
||||
new MainThreadInitializedObject<>(c -> Overrides.getObject(TaskOverlayFactory.class,
|
||||
c, R.string.task_overlay_factory_class));
|
||||
|
||||
@AnyThread
|
||||
public boolean needAssist() {
|
||||
|
||||
Reference in new issue
Block a user