summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2014-08-22 18:32:15 -0700
committerAdam Cohen <adamcohen@google.com>2014-08-22 18:34:07 -0700
commit8cc05507150fea5282b7581e1a268967a702bcc9 (patch)
treee44b60b5f83b0b37f1034de6d5664e7a76232bad
parentc50438c802355dff714b04f42a32e518cb9e91d8 (diff)
downloadandroid_packages_apps_Trebuchet-8cc05507150fea5282b7581e1a268967a702bcc9.tar.gz
android_packages_apps_Trebuchet-8cc05507150fea5282b7581e1a268967a702bcc9.tar.bz2
android_packages_apps_Trebuchet-8cc05507150fea5282b7581e1a268967a702bcc9.zip
Update adjacent page hints
-> draw the hints immediately above the workspace Change-Id: Id09070e3876516daf9650132052ab61d02a2cf4d
-rw-r--r--res/drawable-hdpi/page_hover_left.9.pngbin170 -> 184 bytes
-rw-r--r--res/drawable-hdpi/page_hover_left_active.9.pngbin160 -> 183 bytes
-rw-r--r--res/drawable-hdpi/page_hover_right.9.pngbin155 -> 174 bytes
-rw-r--r--res/drawable-hdpi/page_hover_right_active.9.pngbin158 -> 174 bytes
-rw-r--r--res/drawable-mdpi/page_hover_left.9.pngbin141 -> 172 bytes
-rw-r--r--res/drawable-mdpi/page_hover_left_active.9.pngbin156 -> 169 bytes
-rw-r--r--res/drawable-mdpi/page_hover_right.9.pngbin140 -> 162 bytes
-rw-r--r--res/drawable-mdpi/page_hover_right_active.9.pngbin153 -> 162 bytes
-rw-r--r--res/drawable-xhdpi/page_hover_left.9.pngbin166 -> 190 bytes
-rw-r--r--res/drawable-xhdpi/page_hover_left_active.9.pngbin166 -> 189 bytes
-rw-r--r--res/drawable-xhdpi/page_hover_right.9.pngbin177 -> 192 bytes
-rw-r--r--res/drawable-xhdpi/page_hover_right_active.9.pngbin182 -> 192 bytes
-rw-r--r--res/drawable-xxhdpi/page_hover_left.9.pngbin206 -> 216 bytes
-rw-r--r--res/drawable-xxhdpi/page_hover_left_active.9.pngbin207 -> 216 bytes
-rw-r--r--res/drawable-xxhdpi/page_hover_right.9.pngbin199 -> 233 bytes
-rw-r--r--res/drawable-xxhdpi/page_hover_right_active.9.pngbin203 -> 233 bytes
-rw-r--r--src/com/android/launcher3/DragLayer.java29
17 files changed, 20 insertions, 9 deletions
diff --git a/res/drawable-hdpi/page_hover_left.9.png b/res/drawable-hdpi/page_hover_left.9.png
index 5f7087c88..cc029d816 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 8787126d8..20c91a0fd 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 ef991b702..a42822ad8 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 cd5b42db2..523fafd6d 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 0d537e6cb..2bbf42807 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 3004f9e51..bf70f3601 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 c0fbb7da6..4bafd0f71 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 6d39687e4..4aaa0148e 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 9b0def8bb..a2b9b65d7 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 6440bdf71..ba9478ece 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 c7bdfe929..1243ea9ec 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 43660e50f..582261c9b 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 0c0eddda1..63869dd3e 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 a9ae22222..9a418ce1e 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 d61f94f95..c6fd39885 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 079ee1ef1..7aef3733c 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 72d33dae8..79cb1f9c4 100644
--- a/src/com/android/launcher3/DragLayer.java
+++ b/src/com/android/launcher3/DragLayer.java
@@ -81,6 +81,14 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
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 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
}
}
- 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 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
}
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 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
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 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang
}
}
+ 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;