From b85a52a46181b096faf665d3382aa7a10fc65f76 Mon Sep 17 00:00:00 2001 From: Andreas Drivenes Date: Wed, 27 Jan 2016 13:21:42 -0800 Subject: [PATCH] Update Image docs and examples to the new asset system Summary: After the release of 0.14, static images should be placed in the source code tree and then required as explained in the [Images guide] (https://facebook.github.io/react-native/docs/images.html). This pull request updates the image documentation and examples to the new asset system. UIExplorer tested on iOS and Android. Closes https://github.com/facebook/react-native/pull/4987 Reviewed By: svcscm Differential Revision: D2796276 Pulled By: bestander fb-gh-sync-id: 732ffa2f136391bb8a3e40a54b5b1ff5022c97f2 --- Examples/UIExplorer/ImageExample.js | 20 ++++++++--------- Examples/UIExplorer/MapViewExample.js | 2 +- .../Contents.json | 21 ------------------ .../uie_comment_normal.imageset/Contents.json | 21 ------------------ .../uie_thumb_normal.imageset/Contents.json | 21 ------------------ .../uie_thumb_selected.imageset/Contents.json | 21 ------------------ .../res/drawable/uie_comment_highlighted.png | Bin 403 -> 0 bytes .../main/res/drawable/uie_comment_normal.png | Bin 420 -> 0 bytes .../main/res/drawable/uie_thumb_normal.png | Bin 850 -> 0 bytes .../main/res/drawable/uie_thumb_selected.png | Bin 1110 -> 0 bytes .../uie_comment_highlighted@2x.png | Bin .../uie_comment_normal@2x.png | Bin .../uie_thumb_normal@2x.png | Bin .../uie_thumb_selected@2x.png | Bin Libraries/Image/Image.android.js | 6 ++--- 15 files changed, 14 insertions(+), 98 deletions(-) delete mode 100644 Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_highlighted.imageset/Contents.json delete mode 100644 Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_normal.imageset/Contents.json delete mode 100644 Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_normal.imageset/Contents.json delete mode 100644 Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_selected.imageset/Contents.json delete mode 100644 Examples/UIExplorer/android/app/src/main/res/drawable/uie_comment_highlighted.png delete mode 100644 Examples/UIExplorer/android/app/src/main/res/drawable/uie_comment_normal.png delete mode 100644 Examples/UIExplorer/android/app/src/main/res/drawable/uie_thumb_normal.png delete mode 100644 Examples/UIExplorer/android/app/src/main/res/drawable/uie_thumb_selected.png rename Examples/UIExplorer/{UIExplorer/Images.xcassets/uie_comment_highlighted.imageset => }/uie_comment_highlighted@2x.png (100%) rename Examples/UIExplorer/{UIExplorer/Images.xcassets/uie_comment_normal.imageset => }/uie_comment_normal@2x.png (100%) rename Examples/UIExplorer/{UIExplorer/Images.xcassets/uie_thumb_normal.imageset => }/uie_thumb_normal@2x.png (100%) rename Examples/UIExplorer/{UIExplorer/Images.xcassets/uie_thumb_selected.imageset => }/uie_thumb_selected@2x.png (100%) diff --git a/Examples/UIExplorer/ImageExample.js b/Examples/UIExplorer/ImageExample.js index 60fc38dab..eb13b16b0 100644 --- a/Examples/UIExplorer/ImageExample.js +++ b/Examples/UIExplorer/ImageExample.js @@ -148,15 +148,15 @@ exports.examples = [ }, { title: 'Plain Static Image', - description: 'Static assets should be required by prefixing with `image!` ' + - 'and are located in the app bundle.', + description: 'Static assets should be placed in the source code tree, and ' + + 'required in the same way as JavaScript modules.', render: function() { return ( - - - - + + + + ); }, @@ -320,19 +320,19 @@ exports.examples = [ diff --git a/Examples/UIExplorer/MapViewExample.js b/Examples/UIExplorer/MapViewExample.js index bd1173a83..b10620b04 100644 --- a/Examples/UIExplorer/MapViewExample.js +++ b/Examples/UIExplorer/MapViewExample.js @@ -313,7 +313,7 @@ exports.examples = [ }}> ), diff --git a/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_highlighted.imageset/Contents.json b/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_highlighted.imageset/Contents.json deleted file mode 100644 index e1ccff627..000000000 --- a/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_highlighted.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x", - "filename" : "uie_comment_highlighted@2x.png" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_normal.imageset/Contents.json b/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_normal.imageset/Contents.json deleted file mode 100644 index 6f75231d5..000000000 --- a/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_normal.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x", - "filename" : "uie_comment_normal@2x.png" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_normal.imageset/Contents.json b/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_normal.imageset/Contents.json deleted file mode 100644 index 06a7acabf..000000000 --- a/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_normal.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x", - "filename" : "uie_thumb_normal@2x.png" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_selected.imageset/Contents.json b/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_selected.imageset/Contents.json deleted file mode 100644 index a00a3dc54..000000000 --- a/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_selected.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x", - "filename" : "uie_thumb_selected@2x.png" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Examples/UIExplorer/android/app/src/main/res/drawable/uie_comment_highlighted.png b/Examples/UIExplorer/android/app/src/main/res/drawable/uie_comment_highlighted.png deleted file mode 100644 index b33726757ed46498e7da512385e6708961b815e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 403 zcmeAS@N?(olHy`uVBq!ia0vp^N3j#jV-?mT=R~x z?qG_S5?46a-)zXcG1-6R+i#oC& zzvJE7cl6ywiMQb_vU3WSbIt9ztM)A8M5}1dx3CTO&WkBXEz_K2dYbpTst&{ou;2CIke`}<=m|S8gDPI6x5@=C);^Q3R#*ykgOCne9>D-nJd7pV!zCT)dC(t9N{Y0^mVs6FiMWuKAPnVn5 z?Roq5^S-ybKUY7x%Gdom?!Pgg^PVLYGoSvP^7X90$F9F6)BVq1GT+}VV6SOECsk~d s;zPy!yeaoLEZjKh?$rl^Fz^0*#@%wFGV)>p%W{yAr>mdKI;Vst00SMV4*&oF diff --git a/Examples/UIExplorer/android/app/src/main/res/drawable/uie_comment_normal.png b/Examples/UIExplorer/android/app/src/main/res/drawable/uie_comment_normal.png deleted file mode 100644 index 6491689fbbc88bfd4289d4ffee2e4262097ddaae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 420 zcmeAS@N?(olHy`uVBq!ia0vp^N(}fc;mYo{*7tr)BX@!Dy91&-83Z-YtleIPcr8Uv_SS zB@dn6-gzW;tJ>(;OP33+-dm?0)!n+i*HW^mOg^<&ep#>llC!ZBc;qTixW|2(-FD`% z#q@)-rkzySWbjEtzOw$4%N`9qmHThj_V1ZH{hH<1O;v%1mfn!N(pR)u+V0bY{ykPl zOgU$+y&U8%mm1114>INQdNxH4M-Hcd$sKb$@_I5oq#qxdxk2h;-=4R&J?FYl>bI)Q zSA6zo<^;P>o8C>Ge)Xa0`SR{7FPXRA}Dqm^*J1K@i9DFtHPqf+7+UU0N#S%Cew$ zlW*c89TGx1CB$I+e7@UztbK`-;1u)}G!*m*J^*|JB#=y$@Q@-cGv{4Y6&FAy05^!;5Ah}#_ z*>ZeQvr%58is{&LS7rx-nb(~_@bDlK^Fsk(-w|-uAgMazqPh1nQe*c};Ag{lzCLvj ztz%NrjzHkB)dn3!?~d0LTQ98pQ!UmwM6p<0Qy{zheGtPi?kZ22I7kcvi!oiPIo0mb z^moMe8pnk~A+2CFrG^>aI1ribQh5Uk^UMu)B}hA}lR69DDNyMvN@>kw&ehK#mmHKu zN}G=$o*2&_LCc<6&@ot`-5O~N-aHW1nrq0w*g3Z~t;o4_-0%`-enA#WnWtN&hi2XT zYJqq7jaIY^3dG}k0^0c$zVCp+bpWbUsWA|YE%pucW^?oLdff2hR-KX5@hlWjdS}Nh zfN7l|1P1Lx9BD_x1@2VOc1#}z zkE;&bHX@vx(bcBG$$vg_^`=T*I6wtizj0ijC)CA8Otv|TO|#d^*mW#Pqz z!ByMYZll*BgCPEHz{N`tPPDx!7BzY4ZgpCM-3E^6c^Ls-djCy7@BnX=T zNOYede1EAYG&Tj0aR2B>v(^3>gooQf5Zsv<2>lyCAOu1n1VSJLLLdY}AOu1n1VSJL c@{fc30h_?_Xm?+0KL7v#07*qoM6N<$g3xSt9RL6T diff --git a/Examples/UIExplorer/android/app/src/main/res/drawable/uie_thumb_selected.png b/Examples/UIExplorer/android/app/src/main/res/drawable/uie_thumb_selected.png deleted file mode 100644 index 79eb69cf92b3638954dd11b045006803abe6d904..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1110 zcmV-c1gZOpP)5AvWIw6 zQBjmADu|kc9`b`XF-IW;B%ml>LOcnIkb^hLO-R6>gLn=i8YGK{TnssgQ9OlU#O%5| zU7v^Up6QvL*`0BdWe-(Q%rI1SJ>UENRWo#VY=#QqcxNEjK%WSbv`wX0sr;`>|KDM_>N% zYmiUF{koUsnakgO{N69$f3{qM`j!N%@{Y^G3!*xb?zAjBy7$@RCr8B1tp)l0hqGNt zu#mw*4q1R@#gTiTI&52=zHVj+S%IvWLC6Z2*=-L$dF-xRp1wmF!$uKVK$K7-LUTK3 zCXJ8(1=4~L06uf%%x)5p0EvJLE}>k$c6BJFZyv}HgaB~Q{SUn@0U{w15aHtAmo9#B ztyxRbhHA{3f)_Rcp#$$Pz8H$)ElH3FsXC%$ym0y3Qx3p}vd3F>#!1EoCXDj=h|TQ+ zMgV&CopVogW_N#1$t(nz2_Qf^Sa#2~s;x$V5J1@+?e0FROlyo4y-Yjw?)k@yUGra3 zHZRK&vJPY!9FEvsLAkPgqbyfeD`Q*R9VO`J|N8CX(QiIIc%@b*y1R!VOKl8DY@YVo ziN)uO9k-taIV%NNR=`3AP=LoOMvOba0CfP^4`0$ZMGSrw}_0cJT=L$K1j zU1w_#k0`-##8Ti&ywK{<1By5Rngv*vg9^R2>9IuYt~MYrGgua278<8d(F_1MFWo4w z@2?f|QN6~^gb*@hS&onw)o18Q?e6X-!o;d>80z{l$*fZw@qtd5y>H#hI=HF!h!ZZ3 zSu=$kPDDB)Vj1Xh__Cz6AgC;6WqD(Ldrj|mPBBG@_y<@yaO%x_eqQ$)&@`@5vTnR) z{Yg52I4gxi8#XopT63?cC} z;?-jlDAJd`Nlo|R7!hQGq^a^YR!Z;t@yee|8(tNwcCG>Wt61!NCHV92_%6e ckgXa20ii_@% diff --git a/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_highlighted.imageset/uie_comment_highlighted@2x.png b/Examples/UIExplorer/uie_comment_highlighted@2x.png similarity index 100% rename from Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_highlighted.imageset/uie_comment_highlighted@2x.png rename to Examples/UIExplorer/uie_comment_highlighted@2x.png diff --git a/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_normal.imageset/uie_comment_normal@2x.png b/Examples/UIExplorer/uie_comment_normal@2x.png similarity index 100% rename from Examples/UIExplorer/UIExplorer/Images.xcassets/uie_comment_normal.imageset/uie_comment_normal@2x.png rename to Examples/UIExplorer/uie_comment_normal@2x.png diff --git a/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_normal.imageset/uie_thumb_normal@2x.png b/Examples/UIExplorer/uie_thumb_normal@2x.png similarity index 100% rename from Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_normal.imageset/uie_thumb_normal@2x.png rename to Examples/UIExplorer/uie_thumb_normal@2x.png diff --git a/Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_selected.imageset/uie_thumb_selected@2x.png b/Examples/UIExplorer/uie_thumb_selected@2x.png similarity index 100% rename from Examples/UIExplorer/UIExplorer/Images.xcassets/uie_thumb_selected.imageset/uie_thumb_selected@2x.png rename to Examples/UIExplorer/uie_thumb_selected@2x.png diff --git a/Libraries/Image/Image.android.js b/Libraries/Image/Image.android.js index 3cf5ae1f6..4c920dcf2 100644 --- a/Libraries/Image/Image.android.js +++ b/Libraries/Image/Image.android.js @@ -38,7 +38,7 @@ var resolveAssetSource = require('resolveAssetSource'); * * *