From 8cc05507150fea5282b7581e1a268967a702bcc9 Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Fri, 22 Aug 2014 18:32:15 -0700 Subject: [PATCH] Update adjacent page hints -> draw the hints immediately above the workspace Change-Id: Id09070e3876516daf9650132052ab61d02a2cf4d --- res/drawable-hdpi/page_hover_left.9.png | Bin 170 -> 184 bytes .../page_hover_left_active.9.png | Bin 160 -> 183 bytes res/drawable-hdpi/page_hover_right.9.png | Bin 155 -> 174 bytes .../page_hover_right_active.9.png | Bin 158 -> 174 bytes res/drawable-mdpi/page_hover_left.9.png | Bin 141 -> 172 bytes .../page_hover_left_active.9.png | Bin 156 -> 169 bytes res/drawable-mdpi/page_hover_right.9.png | Bin 140 -> 162 bytes .../page_hover_right_active.9.png | Bin 153 -> 162 bytes res/drawable-xhdpi/page_hover_left.9.png | Bin 166 -> 190 bytes .../page_hover_left_active.9.png | Bin 166 -> 189 bytes res/drawable-xhdpi/page_hover_right.9.png | Bin 177 -> 192 bytes .../page_hover_right_active.9.png | Bin 182 -> 192 bytes res/drawable-xxhdpi/page_hover_left.9.png | Bin 206 -> 216 bytes .../page_hover_left_active.9.png | Bin 207 -> 216 bytes res/drawable-xxhdpi/page_hover_right.9.png | Bin 199 -> 233 bytes .../page_hover_right_active.9.png | Bin 203 -> 233 bytes src/com/android/launcher3/DragLayer.java | 29 ++++++++++++------ 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 5f7087c88508fa94656e54c2882bbc1b0d31a0e9..cc029d816031e93c1712fae61ed59115ddde043d 100644 GIT binary patch delta 153 zcmZ3*xPwu#Gr-TCmrII^fq{Y7)59eQNb>-(7zZ1W{9;inHBnI`Kg!d^F~p+x?d6@k z4F&=(7t>Q-E#l`|;@PBHkQ5nlgHiBLPXA5i8A}A-d6o)X%&t~qJJ1%P_H3PjGDBo# z#rrG$W`=toir2VK5S`3p{rKwSb2lGm_{0@{4{qXCtkttuX7rs5w2i^j)z4*}Q$iB} DSTQwM delta 139 zcmdnNxQbD+Gr-TCmrII^fq{Y7)59eQNV5a67zZ1W_>w`Mj*%iKJd_SoT$L_^40#z{*$ZZvHD^>&xh<;JCT qrfPp4E_W{XUvT~u|C=k<8{ckM5fcwtm+}i}K7*&LpUXO@geCwrPBjq# diff --git a/res/drawable-hdpi/page_hover_left_active.9.png b/res/drawable-hdpi/page_hover_left_active.9.png index 8787126d8aafc14ea8cf6933a2bef2e660e167d6..20c91a0fd10d9c99d095f42d1610bcb19afa1317 100644 GIT binary patch delta 152 zcmZ3$xSdh4Gr-TCmrII^fq{Y7)59eQNb>-(7zZ1W{9;inHBnI`FVfS+F~p+x?PW`$ z1_c3^i|wt?FDwkpdhQR3~cSO@z6twx} z=l;5UX|>P;BmMWE`EzqvZJA?c+RnG{W*0%ydo^J eA8)q1+Z3uSCK1ynm*ovKmBG{1&t;ucLK6VgTPtP& diff --git a/res/drawable-hdpi/page_hover_right.9.png b/res/drawable-hdpi/page_hover_right.9.png index ef991b70240ec11de6b23490a6e8e35806959255..a42822ad8df005610760c46b64baae7e6cd64ac6 100644 GIT binary patch delta 143 zcmbQuxQ-(7zZ1W{9;inHBnI`HNexwF~p)bIpqM~ zzsCaUM-=@eZv0ngGB7aslirk-pnfey?T}XhBRBJr=64y70xhoSE8lDjrzrz2HL^k>FVdQ&MBb@0D*`sivR!s delta 124 zcmZ3-IGa(iGr-TCmrII^fq{Y7)59eQNV5a67zZ1WC`%D-=KrPX_y^*Wi{RNI@L#Ovv;d;h~kfngsD a8-rrJwEpVX1-(7zZ1W{9;inHBnI`HNexwF~p)bIpqM~ zzsCaUM-=@eZv0ngGB7aslirk-pnfey?T}XhBRBJr=64y7*b7#aE8J`gFVdQ&MBb@0DB}XC;$Ke delta 127 zcmZ3-IFC`WGr-TCmrII^fq{Y7)59eQNV5a67zZ1Wzopr0J%vj#{d8T diff --git a/res/drawable-mdpi/page_hover_left.9.png b/res/drawable-mdpi/page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Rn=tY5%&t6`3Azl`(`y WNbSC}DWV=|9D}E;pUXO@geCx$W+?Fh diff --git a/res/drawable-xhdpi/page_hover_left.9.png b/res/drawable-xhdpi/page_hover_left.9.png index 9b0def8bb6323df13b850a37e281f94982861e63..a2b9b65d7f9b776b0daac40d44f86ead8f152df3 100644 GIT binary patch delta 159 zcmZ3+xQ|h>Gr-TCmrII^fq{Y7)59eQNb>`+EC(BqEIna%Yoek?X@aMVV~9oX+o_IR z4F)_c>X*9nKdIYoi2t%fu1IjA*ySn#qvMkjGr6J<3+BG5Q}{aN{6+5u-U~u!q8S$% z9WFXJKlA;Wt1nM#E}!!$XXk^hQm-!lzxz{ylU45D0`9e{QU^GbEUc`fI8WFD?PTzD L^>bP0l+XkKmL@zZ delta 135 zcmdnTxQtP;Gr-TCmrII^fq{Y7)59eQNOJa!NzP zf1VW$g2#URmyhiV`XJ9HAtAveDIsy>;?tQISdIW$H!k=(hPR0JXi0^dToT!vl92Gj jwa1Nz;q>Q<(@YG7{UV*`jwoCJn$6(p>gTe~DWM4fYOpL} diff --git a/res/drawable-xhdpi/page_hover_left_active.9.png b/res/drawable-xhdpi/page_hover_left_active.9.png index 6440bdf7196ad40ce1fe88f8cebfe805e394b696..ba9478ece5c6708f15db82bac27ccd58171dd15f 100644 GIT binary patch delta 158 zcmZ3+xR+6}Gr-TCmrII^fq{Y7)59eQNb>`+EC(BqEIna%Yoek?NxY|vV~9oX+o^_J z4F&=%&sBQ!H+_8hbL!Km7-c2SxFp3pQy#XdirUmR0T!?c8ZTmn-i zr*Z%D*=oGq-`~&j>6G--tn04^^#6N*?zo4>hY#$r8M+r4{PKQSSu;gmy9l(B!PC{x JWt~$(696UPI{p9v delta 135 zcmdnXxQtP;Gr-TCmrII^fq{Y7)59eQNOJa!NzP zf1VW$g2#URmyhiV`XDcBU|_%k#2p8p%q++dNl!>fXf7`+EC(BqEIna%Yoek?d6K7#V~9m>a>@bT ze~%|7CjfzpfR|ft2FJ_;xF;i#J9E~!@y|D90pp$;OXk;vd$@?2>|2lGmHQL diff --git a/res/drawable-xhdpi/page_hover_right_active.9.png b/res/drawable-xhdpi/page_hover_right_active.9.png index 43660e50f0c86b378f45230811a9e0a0fc25c0e7..582261c9be432c66d074676f7c57496616cc3d74 100644 GIT binary patch delta 161 zcmdnScz{u{Gr-TCmrII^fq{Y7)59eQNb>`+EC(BqEIna%Yoek?d6K7#V~9m>a>@bT ze~%|7CjfzpfPnu}D!_nrIqPSsdYuwhB>o+t7q30RUISihzelF{r5}E)xmPG3S delta 176 zcmcb?c#cuAGr-TCmrII^fq{Y7)59eQL<6xl2OE%FEXNc+QBkA5z|+Ms#G~`=HAAjL z2|R5Nmq%$>d}E1Q(EjqTxc`ON4S!_26jb*obw8L;&Qs}m;?vTNK}Sq(J85pc79SXQ zu!C`W)PGHlxQmZtW(#@BMjaHq=PB>0xpYd9m*&#sOS1f5KkzM;Ry$L@?FaL`#6MS$ bZ(^9wAhVZetrR2B4Gf;HY<@25oD!M<_f(Yg?V8I_7NiWXumvVnc oA@~HYV6*qCKg^=H7btr-DmxHK5ZaY!IRF3v07*qoM6N<$g0TlhMgRZ+ delta 177 zcmcb?c%D(QGr-TCmrII^fq{Y7)59eQL<6xl2OE%FEXNc+QBkA5(9^{+#G~`=G()Zi z10L6SmzRPuwv(5amx$Rka2#96wKSw@(T*p*^Y^GkE4fTDn#8^;d}+KwVN&IijxPsT zcn;JYiIViSUcl-k6&1uVYtOk!T|1sk^48n={&CM6;=lY*q cJHCmTDM8GwATW0|&=Cxt?5=(;>zopr00*c-UjP6A diff --git a/res/drawable-xxhdpi/page_hover_right.9.png b/res/drawable-xxhdpi/page_hover_right.9.png index d61f94f9502a3c936ae86fb884e18d3f8aa6025c..c6fd3988596a3a59a5a9ed706c23472efab6d8cf 100644 GIT binary patch delta 203 zcmX@k_>xhvGr-TCmrII^fq{Y7)59eQNQ(inHU}G!tO=;_n5d{x-|gw*7~;|S_WDNN z1_K_J1LaeiL?>h{OqXRl!=Q7Nt7I9+!UY?Zdt6%fdwsN0RA*Itap+VWXXrQk37<|f zH_V(FEG5kBiT8x8}B4~Jcz)Nc!X zu{3JO-oQP4#;?RBME5Y?P}E60KlQiM;=K-qf>sR6=JDDsf2(;B=spHdS3j3^P6N<#G~`=HAAjL z0X%FE^j!<|3YoK; ToU$E&mNR&|`njxgN@xNAk>x*8 diff --git a/res/drawable-xxhdpi/page_hover_right_active.9.png b/res/drawable-xxhdpi/page_hover_right_active.9.png index 079ee1ef17afc96de718ae5aa421864bf8c34837..7aef3733c37f76f901fc02e1f2b8939f85a6ddeb 100644 GIT binary patch delta 203 zcmX@j_>xhvGr-TCmrII^fq{Y7)59eQNQ(inHU}G!tO=;_n5d{x-|gw*7~;|S_WDNN z1_K_J1LaeiL?>h{Om9AOh9&1PSIIJtg$p`$dt6%fdwsN0RA*H?ap+JSr{-^YkDpH% z51cvE&FR%rFwdG{FKbj#Les|s&U-(JTPWH8TX`vZYF<{p2%q(v4Tpimhr=#U>bGsY zgTe~DWM4f Dx1dh< delta 173 zcmaFKc$!hMGr-TCmrII^fq{Y7)59eQL<6xl2OE%FEXNc+QBk8l*VDx@#G~`=HAAij z1D@80|2rQsvdG5T?*0CWLrH?YRC8&|qX!eVFMXnXGiavdBnF=NCvSc$Jc@fQYstWE zFze|M3;iju$Z+ Y=Ll!NeJUjjbO3{=tDnm{W~YQE0AasBIRF3v diff --git a/src/com/android/launcher3/DragLayer.java b/src/com/android/launcher3/DragLayer.java index 72d33dae86..79cb1f9c4f 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;