summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/dragndrop
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2016-02-18 14:37:07 -0800
committerTony Wickham <twickham@google.com>2016-03-16 11:09:09 -0700
commit95cdb3a0211650e76adb451588ce89fd585b178f (patch)
tree3bcada81043e1555307ef1fcb3eed6056a4edde8 /src/com/android/launcher3/dragndrop
parent16466f1bbb935d56c01b10551ead416feb7fc943 (diff)
downloadandroid_packages_apps_Trebuchet-95cdb3a0211650e76adb451588ce89fd585b178f.tar.gz
android_packages_apps_Trebuchet-95cdb3a0211650e76adb451588ce89fd585b178f.tar.bz2
android_packages_apps_Trebuchet-95cdb3a0211650e76adb451588ce89fd585b178f.zip
Remove scrim on highlighted spring-loaded panel.
Bug: 27135377 Change-Id: I470955ed082a45ae7dc5f8fdd1f3decb2b573dbc
Diffstat (limited to 'src/com/android/launcher3/dragndrop')
-rw-r--r--src/com/android/launcher3/dragndrop/DragLayer.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java
index 647ec5e9f..058a58cde 100644
--- a/src/com/android/launcher3/dragndrop/DragLayer.java
+++ b/src/com/android/launcher3/dragndrop/DragLayer.java
@@ -26,6 +26,7 @@ import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Rect;
+import android.graphics.Region;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.DragEvent;
@@ -42,6 +43,7 @@ import android.widget.TextView;
import com.android.launcher3.AppWidgetResizeFrame;
import com.android.launcher3.CellLayout;
+import com.android.launcher3.Hotseat;
import com.android.launcher3.InsettableFrameLayout;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.Launcher;
@@ -92,6 +94,7 @@ public class DragLayer extends InsettableFrameLayout {
private boolean mHoverPointClosesFolder = false;
private final Rect mHitRect = new Rect();
+ private final Rect mHighlightRect = new Rect();
private TouchCompleteListener mTouchCompleteListener;
@@ -922,12 +925,29 @@ public class DragLayer extends InsettableFrameLayout {
invalidate();
}
+ public void invalidateScrim() {
+ if (mBackgroundAlpha > 0.0f) {
+ invalidate();
+ }
+ }
+
@Override
protected void dispatchDraw(Canvas canvas) {
// Draw the background below children.
if (mBackgroundAlpha > 0.0f) {
+ // Update the scroll position first to ensure scrim cutout is in the right place.
+ mLauncher.getWorkspace().computeScrollWithoutInvalidation();
+
int alpha = (int) (mBackgroundAlpha * 255);
+ CellLayout currCellLayout = mLauncher.getWorkspace().getCurrentDragOverlappingLayout();
+ canvas.save();
+ if (currCellLayout != null && currCellLayout != mLauncher.getHotseat().getLayout()) {
+ // Cut a hole in the darkening scrim on the page that should be highlighted, if any.
+ getDescendantRectRelativeToSelf(currCellLayout, mHighlightRect);
+ canvas.clipRect(mHighlightRect, Region.Op.DIFFERENCE);
+ }
canvas.drawColor((alpha << 24) | SCRIM_COLOR);
+ canvas.restore();
}
super.dispatchDraw(canvas);