From 66e8d3768a97a963c03c529f62bc05da90aa706a Mon Sep 17 00:00:00 2001 From: Appcelerator Build Date: Fri, 20 Nov 2020 11:39:14 -0500 Subject: [PATCH] fix(ios): set tintcolor of UIBarButtonItem (#12278) Fixes TIMOB-28211 --- iphone/Classes/TiUINavBarButton.m | 1 + ...faultColor_right_greenColor_2x_400x400.png | Bin 0 -> 6820 bytes ...faultColor_right_greenColor_3x_400x400.png | Bin 0 -> 7905 bytes ...t_redColor_right_greenColor_2x_400x400.png | Bin 0 -> 6815 bytes ...t_redColor_right_greenColor_3x_400x400.png | Bin 0 -> 7875 bytes tests/Resources/ti.ui.window.test.js | 141 ++++++++++++++++++ 6 files changed, 142 insertions(+) create mode 100644 tests/Resources/ios/snapshots/navButton_left_defaultColor_right_greenColor_2x_400x400.png create mode 100644 tests/Resources/ios/snapshots/navButton_left_defaultColor_right_greenColor_3x_400x400.png create mode 100644 tests/Resources/ios/snapshots/navButton_left_redColor_right_greenColor_2x_400x400.png create mode 100644 tests/Resources/ios/snapshots/navButton_left_redColor_right_greenColor_3x_400x400.png diff --git a/iphone/Classes/TiUINavBarButton.m b/iphone/Classes/TiUINavBarButton.m index 9d8a76e8325..44e3edcd945 100644 --- a/iphone/Classes/TiUINavBarButton.m +++ b/iphone/Classes/TiUINavBarButton.m @@ -119,6 +119,7 @@ - (id)initWithProxy:(TiUIButtonProxy *)proxy_ self = [super initWithImage:theimage style:[self style:proxy_] target:self action:@selector(clicked:)]; } else { self = [super initWithTitle:[self title:proxy_] style:[self style:proxy_] target:self action:@selector(clicked:)]; + self.tintColor = [proxy_ valueForKey:@"color"] ? [TiUtils colorValue:[proxy_ valueForKey:@"color"]].color : [TiUtils colorValue:[proxy_ valueForKey:@"tintColor"]].color; } } proxy = proxy_; // Don't retain diff --git a/tests/Resources/ios/snapshots/navButton_left_defaultColor_right_greenColor_2x_400x400.png b/tests/Resources/ios/snapshots/navButton_left_defaultColor_right_greenColor_2x_400x400.png new file mode 100644 index 0000000000000000000000000000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URh+|^6Tz8`M8qcrTIaeyAC>{-yxSp4l``n zii|n7T3;W}+o~5)M-4LI49GHTf3jq>RdP#82{|N*%i#>uqKtavt1UPF zd_6`gwpWX(tuD!`>jfBVm-BMlX}SV_tflu;G~Uu{;FOt>m*D2lw0pDF*P-gk%%EGF zj*}?IIIpYPOeeh6WTVGA$Bz5GWH)K>!W8tCU?yU22;)0S!|&%-$cN81FaQQ)Vn`e> z82ggMPUWV=4*AIl8rmMY2~T5gPqpq)sTQXzk>z7Xl1~SSIUvZ>R6||wUVrRhMH6q% zFbE<w6uQ&ZE25|gfV?id?})h8_QsHm)zS!qKX_CbujqMW#X=f zb6e9`%G;r?McHL+DLTLPy=F+}9+D;ThY=j%s!Y^vQD{4|KX-kizkW)*?(~U+ArN+h zdBqV3&u!oYSc$`7@L(HaNLdI!y;y@O zI(flwagBafZ%)TkNeWIXyHAEA`U%iA`JS>u4khHMxf-)EHgHl!D>3KokI>U*koR3% zqc{u{_6ExPm^l7Bt*%qv0a0KmHsU_oFta9UFUxlh1m>Q-51vSieRNh zEZDB}qahHdYDZOJL-BwB1pcKdY#q>^Xu{W!Yha^*exZs)E1tCzHVs$)@45}H-B@gI zP9pj>>3JV0-SsZ|K&fcAjmr^X^HdBbyEa`?*aDq~!E8jVQ-vv-0#g)Pa6#A%Nkbsr zO^%0!DXJv^uLp{ST@~6KO*nlgYdb~Y%bYUM5~k=+1Oh3oyyJE!2|GJs=X3bqz=U}L zIExYpP^>rW03g0sIEb3ycD^hEVF!11Q2BrCkoXJo+BrkC-%slscu)eimX|F`E_mPjC&mDK5C8xG literal 0 HcmV?d00001 diff --git a/tests/Resources/ios/snapshots/navButton_left_defaultColor_right_greenColor_3x_400x400.png b/tests/Resources/ios/snapshots/navButton_left_defaultColor_right_greenColor_3x_400x400.png new file mode 100644 index 0000000000000000000000000000000000000000..e369de055077e18c1ab3af4d2447c0d3cdfb353c GIT binary patch literal 7905 zcmeHMdpJ~Ww4Xgq8B_*IavPWATKS4nVv}n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A7_S!ZP_`xu`F;Mv zh>lA8itvxe$V*hKJSYP`zu07s0m(wYbqO0)beKk|YI zFx6F)Xq$;{UT5tKim`vLH?IrbivZ7?@VCvpWoDz4w>`O7SUuuxGhel?XT0Of%p%w4Q!{E* zIjm97X0~2i1VmTpXZ+%W7!Sf3IFeXP`hsFp6Y3B@64cCjR0858s-*~oYHrTGY@UMp z$Kd~ZmOk3P2`vA02N;KKzrbm=w*m%Y+7DCNoYWA+a1BKvqS;K;52#UErAz`jA=>G! zC{#!ogPTaG5I`}Afl~h#`N!Z-mj3^iMtB%Rj&E)4us;+4gK_L*v)D7V@;wj>-*jv< ztY)1=pT;P@7!m>C2qX##7gUvjBpSQ||HjFdXilVo({V|V00V%z9qf-t2!wRG5HA`e z5C|*VRt9i*LjQd>8U)v2Y?U+s7~=HUXf!$$GKC`&AnsXJihT`em0){=8-gI;V_r5I zNfd{?K|C@VeXoPaMkAVeAa4Ya4@GKr)nTLI-#Gq+^CvrhYUfX9{dw;Ec`E-eE)rjW Z_%9vjdBsl6L;v`~40TO(O0=)s`46n$YiR%g literal 0 HcmV?d00001 diff --git a/tests/Resources/ios/snapshots/navButton_left_redColor_right_greenColor_2x_400x400.png b/tests/Resources/ios/snapshots/navButton_left_redColor_right_greenColor_2x_400x400.png new file mode 100644 index 0000000000000000000000000000000000000000..92626ee8b9b11ef31e308302b3b600c195ca4be4 GIT binary patch literal 6815 zcmeHM`BxL!woZxwK`s(N1wlgu6choK24qZ78W{v^qy?D;lu43~%wY<86_hC|f;1Ae z0a2MznPad`OB6APK!8B76B>j7AwZZzZbIMp-XHMRx<9-}t+i{PI`y4%s&<|FPVKL5 zpL0GVw?lOY2n3R|x3h5tfxrZ@L8U}Bc(U;)kpoA%o;d}o{=9EebP#vh!~Tks6X=Mj z3Lf^|R=TlD}4lokqt{2Sve^5RW2##WoZy~JbiztN(89s~b{ z1`{4j{7+fj>_ZzpLgZwAvAY-v0_`~{Hn6>`)|{wvU#N|Xo5+g>+}fz3y^h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O8^u6i#(8EKc90x-Cj=H(Dj@*}ZGaPo zkRYn1O0vk45IB-RNh2XyT+8nS|DP?ok}hj2w*4+T=%4$^oZ35KBY|hqmsnKRJh;(9 zBt=D8wkJqwcy=esih@+v8}Vo~<3VgJi}uO~k50aYG&vR|%D&x&z;4-abKeGS(tapB z%^;h~&0@^dVTcw7V--8N}p) { + const rightButton1 = Ti.UI.createButton({ + title: 'Right1', + color: 'green', + }); + + const rightButton2 = Ti.UI.createButton({ + title: 'Right2', + color: 'green', + }); + + const leftButton = Ti.UI.createButton({ + title: 'Left', + color: 'blue' + }); + + const rootWindow = Ti.UI.createWindow({ + backgroundColor: 'white', + leftNavButtons: [ leftButton ], + rightNavButtons: [ rightButton1, rightButton2 ], + }); + + win = Ti.UI.createNavigationWindow({ + window: rootWindow + }); + + win.open(); + + rootWindow.addEventListener('focus', function focus() { + rootWindow.removeEventListener('focus', focus); + try { + should(rootWindow.rightNavButtons).be.an.Array(); + should(rootWindow.rightNavButtons.length).be.eql(2); + rootWindow.rightNavButtons = [ rightButton1 ]; + should(rootWindow.rightNavButtons.length).be.eql(1); + + should(rootWindow.leftNavButtons).be.an.Array(); + should(rootWindow.leftNavButtons.length).be.eql(1); + } catch (e) { + return finish(e); + } + finish(); + }); + }); + + it.ios('.leftNavButton with default color (no color value) and .rightNavButton with tintColor', finish => { + // TO DO: Snapshots for different iPads are different. Can not test with static image. + // Probably try with snapshot comparision (with and without color) at run time + if (utilities.isMacOS() || utilities.isIPad()) { + return finish(); // how to skip for iPad? + } + + const density = Ti.Platform.displayCaps.logicalDensityFactor; + + const rightButton = Ti.UI.createButton({ + title: 'Right', + tintColor: 'green', + }); + + const leftButton = Ti.UI.createButton({ + title: 'Left', + }); + + const rootWindow = Ti.UI.createWindow({ + backgroundColor: 'white', + leftNavButton: leftButton, + rightNavButton: rightButton, + }); + + win = Ti.UI.createNavigationWindow({ + height: '400px', + width: '400px', + window: rootWindow + }); + + win.open(); + + rootWindow.addEventListener('postlayout', function postlayout() { + rootWindow.removeEventListener('postlayout', postlayout); + setTimeout(function () { + try { + should(rootWindow.leftNavButton).be.an.Object(); + should(rootWindow.rightNavButton).be.an.Object(); + should(win).matchImage(`snapshots/navButton_left_defaultColor_right_greenColor_${density}x.png`); + } catch (e) { + return finish(e); + } + finish(); + }, 10); + }); + }); + + it.ios('.leftNavButton and .rightNavButton with color and tintColor', finish => { + // TO DO: Snapshots for different iPads are different. Can not test with static image. + // Probably try with snapshot comparision (with and without color) at run time + if (utilities.isMacOS() || utilities.isIPad()) { + return finish(); // how to skip for iPad? + } + + const density = Ti.Platform.displayCaps.logicalDensityFactor; + + const rightButton = Ti.UI.createButton({ + title: 'Right', + tintColor: 'red', + color: 'green', // should have preference + }); + + const leftButton = Ti.UI.createButton({ + title: 'Left', + tintColor: 'red' + }); + + const rootWindow = Ti.UI.createWindow({ + backgroundColor: 'white', + leftNavButton: leftButton, + rightNavButton: rightButton, + }); + + win = Ti.UI.createNavigationWindow({ + height: '400px', + width: '400px', + window: rootWindow + }); + + win.open(); + + rootWindow.addEventListener('postlayout', function postlayout() { + rootWindow.removeEventListener('postlayout', postlayout); + setTimeout(function () { + try { + should(rootWindow.leftNavButton).be.an.Object(); + should(rootWindow.rightNavButton).be.an.Object(); + should(win).matchImage(`snapshots/navButton_left_redColor_right_greenColor_${density}x.png`); + } catch (e) { + return finish(e); + } + finish(); + }, 10); + }); + }); + // FIXME Move these rect/size tests into Ti.UI.View! it.windowsBroken('.size is read-only', finish => { win = Ti.UI.createWindow({