From cd83e8f120caa20aef1f38f2e463b0a848efa912 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Wed, 30 Apr 2014 10:25:51 -0700 Subject: [PATCH] Bug 1000149 - Part 3: Update close button size and toolbar spacing. r=lucasr --- .../drawable-hdpi/close_edit_mode.png | Bin 301 -> 550 bytes .../drawable-mdpi/close_edit_mode.png | Bin 205 -> 473 bytes .../drawable-xhdpi/close_edit_mode.png | Bin 370 -> 679 bytes .../base/resources/layout/browser_toolbar.xml | 15 +++++++++------ .../android/base/toolbar/BrowserToolbar.java | 17 +++++++++++------ 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/mobile/android/base/resources/drawable-hdpi/close_edit_mode.png b/mobile/android/base/resources/drawable-hdpi/close_edit_mode.png index 70caf842d33e52296d730f9016c4c50bf89b0838..efb5ab8e7474a84d0cbf37fa22702768b2d0ffa6 100644 GIT binary patch literal 550 zcmeAS@N?(olHy`uVBq!ia0vp^Y9P$P3?%12mYf5mSkfJR9T^xl_H+M9WCijSl0AZa z85pX73L9D&7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10!Y05c#1%-#CuhVZrANdh zre_x>q+|lQ#GwEG|Eo4Wj05TyDhcun2GT$vC#Jb^p~Alnn3f}>VLzVH9@5NnBDA2K!2*1xJHzuB$lLF zB^RXvDF!10Lla#C6J0~|5JO`tV`D2*GhG97D+7aeN2h2M4Y~O#nQ4`{HGGr#^&F^y N!PC{xWt~$(699wr%vAsY literal 301 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpUtFP<)rAr-gY-rUP|*no%S!MVDl ze6qW~$THV%UUVzLAmjq~PKD^VyirCj-yQ36ekP@@^k!gW`H_0y?LUpJ+oG=bzxH{{ zb*<{#y{Fm?E%nznMXm4SVB8Y7cllSIryL7juD$N?q2cdC_gsO7d=mkc2Lb*J9Ig`{ z+A2snwta8NV3EAXyht#mg1^HJEXa6Rm_hDfTR#&6i=Z7xgP_X~4F)%Xhl?2`7!Ucg zC9rVVOE(BA{HbAZ`|;h0!PZHA-;rNE|9 z$OSTpMF0Q)zn~Z62h=QB666;Qq#1aG+LkE)S*^5Aan0{-9*fql0g5pudAqv^Rqx3G zDVXf(;uxZFerwQMzQYO}I%~u1*4+ADe{!*=)k)G;oySCs{`@|co1KI`789itzIl}KIr<=9mUe%PRFZHJ{=JC7vpTT}B zyZ;Qf(^)#296;x(mbgZgq$HN4S|t~y0x1R~149#C0~1|C^AJO0D`R6TQ!`xyb1MUb hc1NdZ6b-rgDVb@NxHWu}`SlzW0-mmZF6*2UngIQ-pEdvh literal 205 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJDV{ElAr-gYUfalfKtX`np>1L6 zGLg(py3Hva=f&?U%ADkw`G~u`!JmtM;ihYTRd(5L{5ho#67I$kyRM z=a<<5|D|8?FH-JH`kAV-zwar((9g*_@kcp54(Q0Y);#-k?Askzp!*m+UHx3vIVCg! E0H9e+EC2ui diff --git a/mobile/android/base/resources/drawable-xhdpi/close_edit_mode.png b/mobile/android/base/resources/drawable-xhdpi/close_edit_mode.png index 4b6f1f34fd46470288a7a999b0479f55ce51871c..8fd7a3d1d00f3a61c1bf29396fc19be4759ab8e8 100644 GIT binary patch literal 679 zcmeAS@N?(olHy`uVBq!ia0vp^#vshW3=*k7AOWOU(j9#r85lP9bN@+X1@aY=J%W50 z7^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10A~wJ$#1%-#C8ftFXZQz& z`38hk)V3s~WY#uyDk-amMa9J?riO&a0AX&(X_fwGKA-tI1PMO+HnK(?W$i(`n#@wd}%Gc_sjv}LM=&C@(9 z{QmzeO-ClCSL<%8e!lbP6u9rT9PnDdt=h>X?Z{CV9?uoSi{rb)Yk>WY7R~TKUDKWihS(3;aaWY!* z*0kqeHIGkwdHN9-`>M3rCoS$zyRglSyGnaOC6JM z+d7W1SnK#LvlX+Q+_m;8kEh3{;%iOuf^2E-`lYnu| zpjzS@QIe8al4_M)lnSI6j0_A-bPY^&4b4LgjjfE0txU~y4a}_!4B8!?qER&D=BH$) XRpQq0P3G5gP)vHd`njxgN@xNA&DjT~ literal 370 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7T#lEV6^mfaSW-r_4c-5(IE!`m%zLO zXLm3)3f~VF3@_UB?m#G?8pCz>+l}=XR)+mu#gJLPW6joor7Qvt42(dc;rY(`nz+fz zI~!T&uXQZ;?t5~IG3}@Orb+833l#jEUmbn&acIl_Y4PexdshFE;t+W7WABTV9DDwp zX=HrHB)pKN;ax7%7r|}Q<}=i`tbMBPAfK51lk~zc^Od zu)k1V@JVJtf5WL_nBW2%<`qgGfP!5IP8T<5F=^Q|GB|KHPJhl2$`Ut^xkRv{lJA21 zjHj#~e>ha?IMx2~sM&F-+HtAx<5Atmr=HiLlGmx4*QJ)%tuEK2BG>y=O0G{$u3w$c yL#6M83ZJK?+VcfV7H{J7w$^(uuLk$|%>2U~$xb_eg>VDIlEKr}&t;ucLK6VOFpa(d diff --git a/mobile/android/base/resources/layout/browser_toolbar.xml b/mobile/android/base/resources/layout/browser_toolbar.xml index 8df7416111da..f07972e98662 100644 --- a/mobile/android/base/resources/layout/browser_toolbar.xml +++ b/mobile/android/base/resources/layout/browser_toolbar.xml @@ -22,12 +22,11 @@ + + android:visibility="invisible"/> focusOrder; - private final View editCancel; + private final ImageView editCancel; private boolean shouldShrinkURLBar = false; @@ -218,7 +220,7 @@ public class BrowserToolbar extends ThemedRelativeLayout actionItemBar = (LinearLayout) findViewById(R.id.menu_items); hasSoftMenuButton = !HardwareUtils.hasMenuButton(); - editCancel = findViewById(R.id.edit_cancel); + editCancel = (ImageView) findViewById(R.id.edit_cancel); // We use different layouts on phones and tablets, so adjust the focus // order appropriately. @@ -603,10 +605,9 @@ public class BrowserToolbar extends ThemedRelativeLayout return 0; } - // We would ideally use the right-most point of the edit layout instead of the - // edit separator and its margin, but it is not inflated when this code initially runs. - final LayoutParams lp = (LayoutParams) editCancel.getLayoutParams(); - return editCancel.getLeft() - lp.leftMargin - urlBarEntry.getRight(); + // Subtract the right margin because it's negative. + final LayoutParams lp = (LayoutParams) urlEditLayout.getLayoutParams(); + return urlEditLayout.getRight() - lp.rightMargin - urlBarEntry.getRight(); } private int getUrlBarCurveTranslation() { @@ -1102,6 +1103,10 @@ public class BrowserToolbar extends ThemedRelativeLayout updateProgressVisibility(); + // The animation looks cleaner if the text in the URL bar is + // not selected so clear the selection by clearing focus. + urlEditLayout.clearFocus(); + if (Build.VERSION.SDK_INT < 11) { stopEditingWithoutAnimation(); } else if (HardwareUtils.isTablet()) {