diff options
author | Adam Cohen <adamcohen@google.com> | 2014-08-22 18:32:15 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2014-08-22 18:34:07 -0700 |
commit | 8cc05507150fea5282b7581e1a268967a702bcc9 (patch) | |
tree | e44b60b5f83b0b37f1034de6d5664e7a76232bad | |
parent | c50438c802355dff714b04f42a32e518cb9e91d8 (diff) | |
download | android_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
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 Binary files differindex 5f7087c88..cc029d816 100644 --- a/res/drawable-hdpi/page_hover_left.9.png +++ b/res/drawable-hdpi/page_hover_left.9.png diff --git a/res/drawable-hdpi/page_hover_left_active.9.png b/res/drawable-hdpi/page_hover_left_active.9.png Binary files differindex 8787126d8..20c91a0fd 100644 --- a/res/drawable-hdpi/page_hover_left_active.9.png +++ b/res/drawable-hdpi/page_hover_left_active.9.png diff --git a/res/drawable-hdpi/page_hover_right.9.png b/res/drawable-hdpi/page_hover_right.9.png Binary files differindex ef991b702..a42822ad8 100644 --- a/res/drawable-hdpi/page_hover_right.9.png +++ b/res/drawable-hdpi/page_hover_right.9.png diff --git a/res/drawable-hdpi/page_hover_right_active.9.png b/res/drawable-hdpi/page_hover_right_active.9.png Binary files differindex cd5b42db2..523fafd6d 100644 --- a/res/drawable-hdpi/page_hover_right_active.9.png +++ b/res/drawable-hdpi/page_hover_right_active.9.png diff --git a/res/drawable-mdpi/page_hover_left.9.png b/res/drawable-mdpi/page_hover_left.9.png Binary files differindex 0d537e6cb..2bbf42807 100644 --- a/res/drawable-mdpi/page_hover_left.9.png +++ b/res/drawable-mdpi/page_hover_left.9.png diff --git a/res/drawable-mdpi/page_hover_left_active.9.png b/res/drawable-mdpi/page_hover_left_active.9.png Binary files differindex 3004f9e51..bf70f3601 100644 --- a/res/drawable-mdpi/page_hover_left_active.9.png +++ b/res/drawable-mdpi/page_hover_left_active.9.png diff --git a/res/drawable-mdpi/page_hover_right.9.png b/res/drawable-mdpi/page_hover_right.9.png Binary files differindex c0fbb7da6..4bafd0f71 100644 --- a/res/drawable-mdpi/page_hover_right.9.png +++ b/res/drawable-mdpi/page_hover_right.9.png diff --git a/res/drawable-mdpi/page_hover_right_active.9.png b/res/drawable-mdpi/page_hover_right_active.9.png Binary files differindex 6d39687e4..4aaa0148e 100644 --- a/res/drawable-mdpi/page_hover_right_active.9.png +++ b/res/drawable-mdpi/page_hover_right_active.9.png diff --git a/res/drawable-xhdpi/page_hover_left.9.png b/res/drawable-xhdpi/page_hover_left.9.png Binary files differindex 9b0def8bb..a2b9b65d7 100644 --- a/res/drawable-xhdpi/page_hover_left.9.png +++ b/res/drawable-xhdpi/page_hover_left.9.png diff --git a/res/drawable-xhdpi/page_hover_left_active.9.png b/res/drawable-xhdpi/page_hover_left_active.9.png Binary files differindex 6440bdf71..ba9478ece 100644 --- a/res/drawable-xhdpi/page_hover_left_active.9.png +++ b/res/drawable-xhdpi/page_hover_left_active.9.png diff --git a/res/drawable-xhdpi/page_hover_right.9.png b/res/drawable-xhdpi/page_hover_right.9.png Binary files differindex c7bdfe929..1243ea9ec 100644 --- a/res/drawable-xhdpi/page_hover_right.9.png +++ b/res/drawable-xhdpi/page_hover_right.9.png diff --git a/res/drawable-xhdpi/page_hover_right_active.9.png b/res/drawable-xhdpi/page_hover_right_active.9.png Binary files differindex 43660e50f..582261c9b 100644 --- a/res/drawable-xhdpi/page_hover_right_active.9.png +++ b/res/drawable-xhdpi/page_hover_right_active.9.png diff --git a/res/drawable-xxhdpi/page_hover_left.9.png b/res/drawable-xxhdpi/page_hover_left.9.png Binary files differindex 0c0eddda1..63869dd3e 100644 --- a/res/drawable-xxhdpi/page_hover_left.9.png +++ b/res/drawable-xxhdpi/page_hover_left.9.png diff --git a/res/drawable-xxhdpi/page_hover_left_active.9.png b/res/drawable-xxhdpi/page_hover_left_active.9.png Binary files differindex a9ae22222..9a418ce1e 100644 --- a/res/drawable-xxhdpi/page_hover_left_active.9.png +++ b/res/drawable-xxhdpi/page_hover_left_active.9.png diff --git a/res/drawable-xxhdpi/page_hover_right.9.png b/res/drawable-xxhdpi/page_hover_right.9.png Binary files differindex d61f94f95..c6fd39885 100644 --- a/res/drawable-xxhdpi/page_hover_right.9.png +++ b/res/drawable-xxhdpi/page_hover_right.9.png diff --git a/res/drawable-xxhdpi/page_hover_right_active.9.png b/res/drawable-xxhdpi/page_hover_right_active.9.png Binary files differindex 079ee1ef1..7aef3733c 100644 --- a/res/drawable-xxhdpi/page_hover_right_active.9.png +++ b/res/drawable-xxhdpi/page_hover_right_active.9.png 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; |