summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/CellLayout.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2018-03-05 12:54:24 -0800
committerSunny Goyal <sunnygoyal@google.com>2018-03-05 14:56:38 -0800
commit726bee7d5da64e0cdca991c03c79a6c4ec41c694 (patch)
treecea8e33f2d97c6f7ab43bb69585a337b2af88667 /src/com/android/launcher3/CellLayout.java
parent85f1eed52de4c983c1e279523a1c9b35d6ccb842 (diff)
downloadandroid_packages_apps_Trebuchet-726bee7d5da64e0cdca991c03c79a6c4ec41c694.tar.gz
android_packages_apps_Trebuchet-726bee7d5da64e0cdca991c03c79a6c4ec41c694.tar.bz2
android_packages_apps_Trebuchet-726bee7d5da64e0cdca991c03c79a6c4ec41c694.zip
Removing click-feedback shadow generation logic in BubbleTextView
Instead of animating the shadow, animating the icon scale. This avoids unnecessary bitmap creating at app-launch and also plays nice with the app-launch transition Change-Id: I1d3d24bc7212a6d659855ff1002a45388e269e52
Diffstat (limited to 'src/com/android/launcher3/CellLayout.java')
-rw-r--r--src/com/android/launcher3/CellLayout.java26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 5e4f67034..734aec302 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -21,6 +21,7 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
@@ -45,7 +46,6 @@ import android.view.ViewDebug;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
-import com.android.launcher3.BubbleTextView.BubbleTextShadowHandler;
import com.android.launcher3.LauncherSettings.Favorites;
import com.android.launcher3.accessibility.DragAndDropAccessibilityDelegate;
import com.android.launcher3.accessibility.FolderAccessibilityHelper;
@@ -70,7 +70,7 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.Stack;
-public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
+public class CellLayout extends ViewGroup {
public static final int WORKSPACE_ACCESSIBILITY_DRAG = 2;
public static final int FOLDER_ACCESSIBILITY_DRAG = 1;
@@ -128,8 +128,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
private int mDragOutlineCurrent = 0;
private final Paint mDragOutlinePaint = new Paint();
- private final ClickShadowView mTouchFeedbackView;
-
@Thunk final ArrayMap<LayoutParams, Animator> mReorderAnimators = new ArrayMap<>();
@Thunk final ArrayMap<View, ReorderPreviewAnimation> mShakeAnimators = new ArrayMap<>();
@@ -285,9 +283,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mCountX, mCountY);
mStylusEventHelper = new StylusEventHelper(new SimpleOnStylusPressListener(this), this);
-
- mTouchFeedbackView = new ClickShadowView(context);
- addView(mTouchFeedbackView);
addView(mShortcutsAndWidgets);
}
@@ -384,11 +379,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
return mDropPending;
}
- @Override
- public void setPressedIcon(BubbleTextView icon, Bitmap background) {
- mTouchFeedbackView.setPressedIcon(icon, background);
- }
-
void setIsDragOverlapping(boolean isDragOverlapping) {
if (mIsDragOverlapping != isDragOverlapping) {
mIsDragOverlapping = isDragOverlapping;
@@ -785,13 +775,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
throw new RuntimeException("CellLayout cannot have UNSPECIFIED dimensions");
}
- // Make the feedback view large enough to hold the blur bitmap.
- mTouchFeedbackView.measure(
- MeasureSpec.makeMeasureSpec(mCellWidth + mTouchFeedbackView.getExtraSize(),
- MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(mCellHeight + mTouchFeedbackView.getExtraSize(),
- MeasureSpec.EXACTLY));
-
mShortcutsAndWidgets.measure(
MeasureSpec.makeMeasureSpec(newWidth, MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(newHeight, MeasureSpec.EXACTLY));
@@ -815,11 +798,7 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
int top = getPaddingTop();
int bottom = b - t - getPaddingBottom();
- mTouchFeedbackView.layout(left, top,
- left + mTouchFeedbackView.getMeasuredWidth(),
- top + mTouchFeedbackView.getMeasuredHeight());
mShortcutsAndWidgets.layout(left, top, right, bottom);
-
// Expand the background drawing bounds by the padding baked into the background drawable
mBackground.getPadding(mTempRect);
mBackground.setBounds(
@@ -1012,6 +991,7 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
}
}
+ @SuppressLint("StringFormatMatches")
public String getItemMoveDescription(int cellX, int cellY) {
if (mContainerType == HOTSEAT) {
return getContext().getString(R.string.move_to_hotseat_position,