Update adjacent page hints
-> draw the hints immediately above the workspace
Change-Id: Id09070e3876516daf9650132052ab61d02a2cf4d
diff --git a/res/drawable-hdpi/page_hover_left.9.png b/res/drawable-hdpi/page_hover_left.9.png
index 5f7087c..cc029d8 100644
--- a/res/drawable-hdpi/page_hover_left.9.png
+++ b/res/drawable-hdpi/page_hover_left.9.png
Binary files differ
diff --git a/res/drawable-hdpi/page_hover_left_active.9.png b/res/drawable-hdpi/page_hover_left_active.9.png
index 8787126..20c91a0 100644
--- a/res/drawable-hdpi/page_hover_left_active.9.png
+++ b/res/drawable-hdpi/page_hover_left_active.9.png
Binary files differ
diff --git a/res/drawable-hdpi/page_hover_right.9.png b/res/drawable-hdpi/page_hover_right.9.png
index ef991b7..a42822a 100644
--- a/res/drawable-hdpi/page_hover_right.9.png
+++ b/res/drawable-hdpi/page_hover_right.9.png
Binary files differ
diff --git a/res/drawable-hdpi/page_hover_right_active.9.png b/res/drawable-hdpi/page_hover_right_active.9.png
index cd5b42d..523fafd 100644
--- a/res/drawable-hdpi/page_hover_right_active.9.png
+++ b/res/drawable-hdpi/page_hover_right_active.9.png
Binary files differ
diff --git a/res/drawable-mdpi/page_hover_left.9.png b/res/drawable-mdpi/page_hover_left.9.png
index 0d537e6..2bbf428 100644
--- a/res/drawable-mdpi/page_hover_left.9.png
+++ b/res/drawable-mdpi/page_hover_left.9.png
Binary files differ
diff --git a/res/drawable-mdpi/page_hover_left_active.9.png b/res/drawable-mdpi/page_hover_left_active.9.png
index 3004f9e..bf70f36 100644
--- a/res/drawable-mdpi/page_hover_left_active.9.png
+++ b/res/drawable-mdpi/page_hover_left_active.9.png
Binary files differ
diff --git a/res/drawable-mdpi/page_hover_right.9.png b/res/drawable-mdpi/page_hover_right.9.png
index c0fbb7d..4bafd0f 100644
--- a/res/drawable-mdpi/page_hover_right.9.png
+++ b/res/drawable-mdpi/page_hover_right.9.png
Binary files differ
diff --git a/res/drawable-mdpi/page_hover_right_active.9.png b/res/drawable-mdpi/page_hover_right_active.9.png
index 6d39687..4aaa014 100644
--- a/res/drawable-mdpi/page_hover_right_active.9.png
+++ b/res/drawable-mdpi/page_hover_right_active.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/page_hover_left.9.png b/res/drawable-xhdpi/page_hover_left.9.png
index 9b0def8..a2b9b65 100644
--- a/res/drawable-xhdpi/page_hover_left.9.png
+++ b/res/drawable-xhdpi/page_hover_left.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/page_hover_left_active.9.png b/res/drawable-xhdpi/page_hover_left_active.9.png
index 6440bdf..ba9478e 100644
--- a/res/drawable-xhdpi/page_hover_left_active.9.png
+++ b/res/drawable-xhdpi/page_hover_left_active.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/page_hover_right.9.png b/res/drawable-xhdpi/page_hover_right.9.png
index c7bdfe9..1243ea9 100644
--- a/res/drawable-xhdpi/page_hover_right.9.png
+++ b/res/drawable-xhdpi/page_hover_right.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/page_hover_right_active.9.png b/res/drawable-xhdpi/page_hover_right_active.9.png
index 43660e5..582261c 100644
--- a/res/drawable-xhdpi/page_hover_right_active.9.png
+++ b/res/drawable-xhdpi/page_hover_right_active.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/page_hover_left.9.png b/res/drawable-xxhdpi/page_hover_left.9.png
index 0c0eddd..63869dd 100644
--- a/res/drawable-xxhdpi/page_hover_left.9.png
+++ b/res/drawable-xxhdpi/page_hover_left.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/page_hover_left_active.9.png b/res/drawable-xxhdpi/page_hover_left_active.9.png
index a9ae222..9a418ce 100644
--- a/res/drawable-xxhdpi/page_hover_left_active.9.png
+++ b/res/drawable-xxhdpi/page_hover_left_active.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/page_hover_right.9.png b/res/drawable-xxhdpi/page_hover_right.9.png
index d61f94f..c6fd398 100644
--- a/res/drawable-xxhdpi/page_hover_right.9.png
+++ b/res/drawable-xxhdpi/page_hover_right.9.png
Binary files differ
diff --git a/res/drawable-xxhdpi/page_hover_right_active.9.png b/res/drawable-xxhdpi/page_hover_right_active.9.png
index 079ee1e..7aef373 100644
--- a/res/drawable-xxhdpi/page_hover_right_active.9.png
+++ b/res/drawable-xxhdpi/page_hover_right_active.9.png
Binary files differ
diff --git a/src/com/android/launcher3/DragLayer.java b/src/com/android/launcher3/DragLayer.java
index 72d33dae..79cb1f9 100644
--- a/src/com/android/launcher3/DragLayer.java
+++ b/src/com/android/launcher3/DragLayer.java
@@ -81,6 +81,14 @@
private Drawable mBackground;
private float mBackgroundAlpha = 0;
+ // Related to adjacent page hints
+ private boolean mInScrollArea;
+ private boolean mShowPageHints;
+ private Drawable mLeftHoverDrawable;
+ private Drawable mRightHoverDrawable;
+ private Drawable mLeftHoverDrawableActive;
+ private Drawable mRightHoverDrawableActive;
+
/**
* Used to create a new DragLayer from XML.
*
@@ -851,13 +859,6 @@
}
}
- private boolean mInScrollArea;
- private boolean mShowPageHints;
- private Drawable mLeftHoverDrawable;
- private Drawable mRightHoverDrawable;
- private Drawable mLeftHoverDrawableActive;
- private Drawable mRightHoverDrawableActive;
-
void onEnterScrollArea(int direction) {
mInScrollArea = true;
invalidate();
@@ -896,8 +897,9 @@
}
super.dispatchDraw(canvas);
+ }
- // Draw screen hover indicators above children.
+ private void drawPageHints(Canvas canvas) {
if (mShowPageHints) {
Workspace workspace = mLauncher.getWorkspace();
int width = getMeasuredWidth();
@@ -920,7 +922,6 @@
if (rightPage != null && rightPage.isDragTarget()) {
Drawable right = mInScrollArea && rightPage.getIsDragOverlapping() ?
mRightHoverDrawableActive : mRightHoverDrawable;
-
right.setBounds(width - right.getIntrinsicWidth(),
childRect.top, width, childRect.bottom);
right.draw(canvas);
@@ -928,6 +929,16 @@
}
}
+ protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
+ boolean ret = super.drawChild(canvas, child, drawingTime);
+
+ // We want to draw the page hints above the workspace, but below the drag view.
+ if (child instanceof Workspace) {
+ drawPageHints(canvas);
+ }
+ return ret;
+ }
+
public void setBackgroundAlpha(float alpha) {
if (alpha != mBackgroundAlpha) {
mBackgroundAlpha = alpha;