diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..deec4eb5fa --- /dev/null +++ b/.gitignore @@ -0,0 +1,100 @@ +*AppPackages* +*BundleArtifacts* +*ReactAssets* + +#OS junk files +[Tt]humbs.db +*.DS_Store + +#Visual Studio files +*.[Oo]bj +*.user +*.aps +*.pch +*.vspscc +*.vssscc +*_i.c +*_p.c +*.ncb +*.suo +*.tlb +*.tlh +*.bak +*.[Cc]ache +*.ilk +*.log +*.lib +*.sbr +*.sdf +*.opensdf +*.opendb +*.unsuccessfulbuild +ipch/ +[Oo]bj/ +[Bb]in +[Dd]ebug*/ +[Rr]elease*/ +Ankh.NoLoad + +#MonoDevelop +*.pidb +*.userprefs + +#Tooling +_ReSharper*/ +*.resharper +[Tt]est[Rr]esult* +*.sass-cache + +#Project files +[Bb]uild/ + +#Subversion files +.svn + +# Office Temp Files +~$* + +# vim Temp Files +*~ + +#NuGet +packages/ +*.nupkg + +#ncrunch +*ncrunch* +*crunch*.local.xml + +# visual studio database projects +*.dbmdl + +#Test files +*.testsettings + +#Other files +*.DotSettings +.vs/ +*project.lock.json + +#JavaScript files +*.jsbundle + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Build results +[Dd]ebugPublic/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Ll]og/ diff --git a/RNTester.sln b/RNTester.sln new file mode 100644 index 0000000000..59411fd22a --- /dev/null +++ b/RNTester.sln @@ -0,0 +1,121 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RNTesterApp", "windows\RNTester\RNTesterApp.csproj", "{283F872F-7145-45A4-8EE0-4A6DB9FB2628}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReactNative", "..\ReactWindows\ReactNative\ReactNative.csproj", "{C7673AD5-E3AA-468C-A5FD-FA38154E205C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ChakraBridge", "..\ReactWindows\ChakraBridge\ChakraBridge.vcxproj", "{4B72C796-16D5-4E3A-81C0-3E36F531E578}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ReactNative.Shared", "..\ReactWindows\ReactNative.Shared\ReactNative.Shared.shproj", "{EEA8B852-4D07-48E1-8294-A21AB5909FE5}" +EndProject +Global + GlobalSection(SharedMSBuildProjectFiles) = preSolution + ..\ReactWindows\ReactNative.Shared\ReactNative.Shared.projitems*{c7673ad5-e3aa-468c-a5fd-fa38154e205c}*SharedItemsImports = 4 + ..\ReactWindows\ReactNative.Shared\ReactNative.Shared.projitems*{eea8b852-4d07-48e1-8294-a21ab5909fe5}*SharedItemsImports = 13 + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + DebugBundle|ARM = DebugBundle|ARM + DebugBundle|x64 = DebugBundle|x64 + DebugBundle|x86 = DebugBundle|x86 + Release|ARM = Release|ARM + Release|x64 = Release|x64 + Release|x86 = Release|x86 + ReleaseBundle|ARM = ReleaseBundle|ARM + ReleaseBundle|x64 = ReleaseBundle|x64 + ReleaseBundle|x86 = ReleaseBundle|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Debug|ARM.ActiveCfg = Debug|ARM + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Debug|ARM.Build.0 = Debug|ARM + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Debug|ARM.Deploy.0 = Debug|ARM + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Debug|x64.ActiveCfg = Debug|x64 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Debug|x64.Build.0 = Debug|x64 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Debug|x64.Deploy.0 = Debug|x64 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Debug|x86.ActiveCfg = Debug|x86 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Debug|x86.Build.0 = Debug|x86 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Debug|x86.Deploy.0 = Debug|x86 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.DebugBundle|ARM.ActiveCfg = Debug|ARM + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.DebugBundle|ARM.Build.0 = Debug|ARM + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.DebugBundle|ARM.Deploy.0 = Debug|ARM + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.DebugBundle|x64.ActiveCfg = Debug|x64 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.DebugBundle|x64.Build.0 = Debug|x64 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.DebugBundle|x64.Deploy.0 = Debug|x64 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.DebugBundle|x86.ActiveCfg = DebugBundle|x86 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.DebugBundle|x86.Build.0 = DebugBundle|x86 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.DebugBundle|x86.Deploy.0 = DebugBundle|x86 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Release|ARM.ActiveCfg = Release|ARM + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Release|ARM.Build.0 = Release|ARM + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Release|ARM.Deploy.0 = Release|ARM + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Release|x64.ActiveCfg = Release|x64 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Release|x64.Build.0 = Release|x64 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Release|x64.Deploy.0 = Release|x64 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Release|x86.ActiveCfg = Release|x86 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Release|x86.Build.0 = Release|x86 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.Release|x86.Deploy.0 = Release|x86 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.ReleaseBundle|ARM.ActiveCfg = Release|ARM + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.ReleaseBundle|ARM.Build.0 = Release|ARM + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.ReleaseBundle|ARM.Deploy.0 = Release|ARM + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.ReleaseBundle|x64.ActiveCfg = Release|x64 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.ReleaseBundle|x64.Build.0 = Release|x64 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.ReleaseBundle|x64.Deploy.0 = Release|x64 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.ReleaseBundle|x86.ActiveCfg = ReleaseBundle|x86 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.ReleaseBundle|x86.Build.0 = ReleaseBundle|x86 + {283F872F-7145-45A4-8EE0-4A6DB9FB2628}.ReleaseBundle|x86.Deploy.0 = ReleaseBundle|x86 + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Debug|ARM.ActiveCfg = Debug|ARM + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Debug|ARM.Build.0 = Debug|ARM + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Debug|x64.ActiveCfg = Debug|x64 + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Debug|x64.Build.0 = Debug|x64 + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Debug|x86.ActiveCfg = Debug|x86 + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Debug|x86.Build.0 = Debug|x86 + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.DebugBundle|ARM.ActiveCfg = Debug|ARM + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.DebugBundle|ARM.Build.0 = Debug|ARM + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.DebugBundle|x64.ActiveCfg = Debug|x64 + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.DebugBundle|x64.Build.0 = Debug|x64 + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.DebugBundle|x86.ActiveCfg = Debug|x86 + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.DebugBundle|x86.Build.0 = Debug|x86 + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Release|ARM.ActiveCfg = Release|ARM + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Release|ARM.Build.0 = Release|ARM + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Release|x64.ActiveCfg = Release|x64 + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Release|x64.Build.0 = Release|x64 + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Release|x86.ActiveCfg = Release|x86 + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.Release|x86.Build.0 = Release|x86 + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.ReleaseBundle|ARM.ActiveCfg = Release|ARM + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.ReleaseBundle|ARM.Build.0 = Release|ARM + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.ReleaseBundle|x64.ActiveCfg = Release|x64 + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.ReleaseBundle|x64.Build.0 = Release|x64 + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.ReleaseBundle|x86.ActiveCfg = Release|x86 + {C7673AD5-E3AA-468C-A5FD-FA38154E205C}.ReleaseBundle|x86.Build.0 = Release|x86 + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.Debug|ARM.ActiveCfg = Debug|ARM + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.Debug|ARM.Build.0 = Debug|ARM + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.Debug|x64.ActiveCfg = Debug|x64 + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.Debug|x64.Build.0 = Debug|x64 + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.Debug|x86.ActiveCfg = Debug|Win32 + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.Debug|x86.Build.0 = Debug|Win32 + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.DebugBundle|ARM.ActiveCfg = Debug|ARM + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.DebugBundle|ARM.Build.0 = Debug|ARM + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.DebugBundle|x64.ActiveCfg = Debug|x64 + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.DebugBundle|x64.Build.0 = Debug|x64 + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.DebugBundle|x86.ActiveCfg = Debug|Win32 + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.DebugBundle|x86.Build.0 = Debug|Win32 + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.Release|ARM.ActiveCfg = Release|ARM + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.Release|ARM.Build.0 = Release|ARM + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.Release|x64.ActiveCfg = Release|x64 + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.Release|x64.Build.0 = Release|x64 + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.Release|x86.ActiveCfg = Release|Win32 + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.Release|x86.Build.0 = Release|Win32 + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.ReleaseBundle|ARM.ActiveCfg = Release|ARM + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.ReleaseBundle|ARM.Build.0 = Release|ARM + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.ReleaseBundle|x64.ActiveCfg = Release|x64 + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.ReleaseBundle|x64.Build.0 = Release|x64 + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.ReleaseBundle|x86.ActiveCfg = Release|Win32 + {4B72C796-16D5-4E3A-81C0-3E36F531E578}.ReleaseBundle|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/js/BorderExample.js b/js/BorderExample.js index 1dea4656dc..eed1be4000 100644 --- a/js/BorderExample.js +++ b/js/BorderExample.js @@ -146,6 +146,7 @@ exports.examples = [ { title: 'Equal-Width Borders', description: 'borderWidth & border*Color', + platforms: ['android', 'ios'], render() { return ; } @@ -160,6 +161,7 @@ exports.examples = [ { title: 'Custom Borders', description: 'border*Width & border*Color', + platforms: ['android', 'ios'], render() { return ; } @@ -209,6 +211,7 @@ exports.examples = [ { title: 'Corner Radii', description: 'borderTopLeftRadius & borderBottomRightRadius', + platforms: ['android', 'ios'], render() { return ; } @@ -224,6 +227,7 @@ exports.examples = [ { title: 'CSS Trick - Triangle', description: 'create a triangle by manipulating border colors and widths', + platforms: ['android', 'ios'], render() { return ; } diff --git a/js/FlipViewWindowsExample.windows.js b/js/FlipViewWindowsExample.windows.js new file mode 100644 index 0000000000..c5f5113861 --- /dev/null +++ b/js/FlipViewWindowsExample.windows.js @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation and contributors. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ +'use strict'; + +var React = require('react'); +var ReactNative = require('react-native'); +var ReactWindows = require('react-native-windows'); +var { + Image, + StyleSheet, + Text, + TouchableWithoutFeedback, + TouchableOpacity, + View, +} = ReactNative; +var {FlipViewWindows} = ReactWindows; + +var PAGES = 5; +var BGCOLOR = ['#fdc08e', '#fff6b9', '#99d1b7', '#dde5fe', '#f79273']; +var IMAGE_URIS = [ + 'http://apod.nasa.gov/apod/image/1410/20141008tleBaldridge001h990.jpg', + 'http://apod.nasa.gov/apod/image/1409/volcanicpillar_vetter_960.jpg', + 'http://apod.nasa.gov/apod/image/1409/m27_snyder_960.jpg', + 'http://apod.nasa.gov/apod/image/1409/PupAmulti_rot0.jpg', + 'http://apod.nasa.gov/apod/image/1510/lunareclipse_27Sep_beletskycrop4.jpg', +]; + +class LikeCount extends React.Component { + state = { + likes: 7, + }; + + onClick = () => { + this.setState({likes: this.state.likes + 1}); + }; + + render() { + var thumbsUp = '\uD83D\uDC4D'; + return ( + + + + {thumbsUp + ' Like'} + + + + {this.state.likes + ' likes'} + + + ); + } +} + +class Button extends React.Component { + _handlePress = () => { + if (this.props.enabled && this.props.onPress) { + this.props.onPress(); + } + }; + + render() { + return ( + + + {this.props.text} + + + ); + } +} + +class ProgressBar extends React.Component { + render() { + var fractionalPosition = (this.props.progress.position + this.props.progress.offset); + var progressBarSize = (fractionalPosition / (PAGES - 1)) * this.props.size; + return ( + + + + ); + } +} + +class FlipViewWindowsExample extends React.Component { + static title = ''; + static description = 'Container that allows to flip left and right between child views.'; + + state = { + page: 0, + animationsAreEnabled: true, + scrollEnabled: true, + progress: { + position: 0, + offset: 0, + }, + }; + + onSelectionChange = (e) => { + this.setState({page: e.nativeEvent.position}); + }; + + move = (delta) => { + var page = this.state.page + delta; + this.go(page); + }; + + go = (page) => { + this.flipView.setPage(page); + this.setState({page}); + }; + + render() { + var pages = []; + for (var i = 0; i < PAGES; i++) { + var pageStyle = { + backgroundColor: BGCOLOR[i % BGCOLOR.length], + alignItems: 'center', + padding: 20, + }; + pages.push( + + + + + ); + } + var { page, animationsAreEnabled } = this.state; + return ( + + { this.flipView = flipView; }}> + {pages} + + + { animationsAreEnabled ? +