From 2725da5dd12d60baa6a5d550ba2c3227cff2e445 Mon Sep 17 00:00:00 2001 From: Uwais Ashraf Date: Wed, 27 Mar 2024 16:17:07 +0000 Subject: [PATCH] Remove unused code and fix warnings Bug: 330326121 Test: Presubmit - change is a no-op Flag: NA Change-Id: If656113fce6bae82466d9482a92a15f689da00b6 --- .../com/android/quickstep/views/TaskView.java | 45 +++++-------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index abd4ec4eae..79bd107b92 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -135,8 +135,6 @@ import java.util.stream.Stream; public class TaskView extends FrameLayout implements Reusable { private static final String TAG = TaskView.class.getSimpleName(); - private static final boolean DEBUG = false; - public static final int FLAG_UPDATE_ICON = 1; public static final int FLAG_UPDATE_THUMBNAIL = FLAG_UPDATE_ICON << 1; public static final int FLAG_UPDATE_CORNER_RADIUS = FLAG_UPDATE_THUMBNAIL << 1; @@ -184,7 +182,7 @@ public class TaskView extends FrameLayout implements Reusable { Collections.singletonList(new Rect()); public static final FloatProperty FOCUS_TRANSITION = - new FloatProperty("focusTransition") { + new FloatProperty<>("focusTransition") { @Override public void setValue(TaskView taskView, float v) { taskView.setIconsAndBannersTransitionProgress(v, false /* invert */); @@ -197,7 +195,7 @@ public class TaskView extends FrameLayout implements Reusable { }; private static final FloatProperty SPLIT_SELECT_TRANSLATION_X = - new FloatProperty("splitSelectTranslationX") { + new FloatProperty<>("splitSelectTranslationX") { @Override public void setValue(TaskView taskView, float v) { taskView.setSplitSelectTranslationX(v); @@ -210,7 +208,7 @@ public class TaskView extends FrameLayout implements Reusable { }; private static final FloatProperty SPLIT_SELECT_TRANSLATION_Y = - new FloatProperty("splitSelectTranslationY") { + new FloatProperty<>("splitSelectTranslationY") { @Override public void setValue(TaskView taskView, float v) { taskView.setSplitSelectTranslationY(v); @@ -223,7 +221,7 @@ public class TaskView extends FrameLayout implements Reusable { }; private static final FloatProperty DISMISS_TRANSLATION_X = - new FloatProperty("dismissTranslationX") { + new FloatProperty<>("dismissTranslationX") { @Override public void setValue(TaskView taskView, float v) { taskView.setDismissTranslationX(v); @@ -236,7 +234,7 @@ public class TaskView extends FrameLayout implements Reusable { }; private static final FloatProperty DISMISS_TRANSLATION_Y = - new FloatProperty("dismissTranslationY") { + new FloatProperty<>("dismissTranslationY") { @Override public void setValue(TaskView taskView, float v) { taskView.setDismissTranslationY(v); @@ -249,7 +247,7 @@ public class TaskView extends FrameLayout implements Reusable { }; private static final FloatProperty TASK_OFFSET_TRANSLATION_X = - new FloatProperty("taskOffsetTranslationX") { + new FloatProperty<>("taskOffsetTranslationX") { @Override public void setValue(TaskView taskView, float v) { taskView.setTaskOffsetTranslationX(v); @@ -262,7 +260,7 @@ public class TaskView extends FrameLayout implements Reusable { }; private static final FloatProperty TASK_OFFSET_TRANSLATION_Y = - new FloatProperty("taskOffsetTranslationY") { + new FloatProperty<>("taskOffsetTranslationY") { @Override public void setValue(TaskView taskView, float v) { taskView.setTaskOffsetTranslationY(v); @@ -275,7 +273,7 @@ public class TaskView extends FrameLayout implements Reusable { }; private static final FloatProperty TASK_RESISTANCE_TRANSLATION_X = - new FloatProperty("taskResistanceTranslationX") { + new FloatProperty<>("taskResistanceTranslationX") { @Override public void setValue(TaskView taskView, float v) { taskView.setTaskResistanceTranslationX(v); @@ -288,7 +286,7 @@ public class TaskView extends FrameLayout implements Reusable { }; private static final FloatProperty TASK_RESISTANCE_TRANSLATION_Y = - new FloatProperty("taskResistanceTranslationY") { + new FloatProperty<>("taskResistanceTranslationY") { @Override public void setValue(TaskView taskView, float v) { taskView.setTaskResistanceTranslationY(v); @@ -301,7 +299,7 @@ public class TaskView extends FrameLayout implements Reusable { }; public static final FloatProperty GRID_END_TRANSLATION_X = - new FloatProperty("gridEndTranslationX") { + new FloatProperty<>("gridEndTranslationX") { @Override public void setValue(TaskView taskView, float v) { taskView.setGridEndTranslationX(v); @@ -314,7 +312,7 @@ public class TaskView extends FrameLayout implements Reusable { }; public static final FloatProperty SNAPSHOT_SCALE = - new FloatProperty("snapshotScale") { + new FloatProperty<>("snapshotScale") { @Override public void setValue(TaskView taskView, float v) { taskView.setSnapshotScale(v); @@ -602,10 +600,7 @@ public class TaskView extends FrameLayout implements Reusable { if (event.getAction() == MotionEvent.ACTION_DOWN) { computeAndSetIconTouchDelegate(mIconView, mIconCenterCoords, mIconTouchDelegate); } - if (mIconTouchDelegate != null && mIconTouchDelegate.onTouchEvent(event)) { - return true; - } - return false; + return mIconTouchDelegate != null && mIconTouchDelegate.onTouchEvent(event); } protected void computeAndSetIconTouchDelegate(TaskViewIcon view, float[] tempCenterCoords, @@ -647,9 +642,6 @@ public class TaskView extends FrameLayout implements Reusable { /** * Updates this task view to the given {@param task}. - * - * TODO(b/142282126) Re-evaluate if we need to pass in isMultiWindowMode after - * that issue is fixed */ public void bind(Task task, RecentsOrientedState orientedState) { cancelPendingLoadTasks(); @@ -1594,19 +1586,6 @@ public class TaskView extends FrameLayout implements Reusable { mEndQuickswitchCuj = endQuickswitchCuj; } - private int getExpectedViewHeight(View view) { - int expectedHeight; - int h = view.getLayoutParams().height; - if (h > 0) { - expectedHeight = h; - } else { - int m = MeasureSpec.makeMeasureSpec(MeasureSpec.EXACTLY - 1, MeasureSpec.AT_MOST); - view.measure(m, m); - expectedHeight = view.getMeasuredHeight(); - } - return expectedHeight; - } - @Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(info);