diff --git a/circle.yml b/circle.yml index 7ea22ee0eda..56ad41b2f14 100644 --- a/circle.yml +++ b/circle.yml @@ -1,65 +1,4 @@ general: branches: ignore: - - gh-pages # list of branches to ignore -machine: - node: - version: 5.1.0 - environment: - PATH: "~/$CIRCLE_PROJECT_REPONAME/gradle-2.9/bin:$PATH" - TERM: "dumb" - ADB_INSTALL_TIMEOUT: 10 - GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx512m -XX:+HeapDumpOnOutOfMemoryError"' - -dependencies: - pre: - # BUCK - - if [[ ! -e buck ]]; then git clone https://github.com/facebook/buck.git; fi - - cd buck && ant - - buck/bin/buck --version - - buck/bin/buck fetch ReactAndroid/src/test/java/com/facebook/react/modules - - buck/bin/buck fetch ReactAndroid/src/main/java/com/facebook/react - - buck/bin/buck fetch ReactAndroid/src/main/java/com/facebook/react/shell - - buck/bin/buck fetch ReactAndroid/src/test/... - - buck/bin/buck fetch ReactAndroid/src/androidTest/... - # using npm@3 because of problems with shrink-wrapped optional deps installs on linux - - npm install -g npm@3.2 - - source scripts/circle-ci-android-setup.sh && getAndroidSDK - - ./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog - cache_directories: - - "ReactAndroid/build/downloads" - - "buck" - - "buck-out/bin" - override: - - npm install -test: - pre: - # starting emulator in advance because it takes very long to boot - - $ANDROID_HOME/tools/emulator -avd testAVD -no-skin -no-audio -no-window: - background: true - # assemble done separately because it requires quite a lot of memory and also gives time for emulator to load - - ./gradlew :ReactAndroid:assembleDebug -PdisablePreDex -Pjobs=1: - timeout: 360 - - source scripts/circle-ci-android-setup.sh && waitForAVD - override: - # buck tests - - buck/bin/buck test ReactAndroid/src/test/... --config build.threads=1 - - buck/bin/buck build ReactAndroid/src/main/java/com/facebook/react - - buck/bin/buck build ReactAndroid/src/main/java/com/facebook/react/shell - # temp, we can't run instrumentation tests yet - - buck/bin/buck build ReactAndroid/src/androidTest/java/com/facebook/react/tests - - # unit tests - - ./gradlew :ReactAndroid:testDebugUnitTest -PdisablePreDex - - # build JS bundle for instrumentation tests - - node local-cli/cli.js bundle --platform android --dev true --entry-file ReactAndroid/src/androidTest/assets/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js - # run tests on the emulator - - ./gradlew :ReactAndroid:connectedAndroidTest -PdisablePreDex --stacktrace --info: - timeout: 360 - post: - # copy test report for Circle CI to display - - mkdir -p $CIRCLE_TEST_REPORTS/junit/ - - find . -type f -regex ".*/build/test-results/debug/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \; - - find . -type f -regex ".*/outputs/androidTest-results/connected/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \; - + - gh-pages diff --git a/css/react-native.css b/css/react-native.css index 83cf44113d9..59b4fa3391e 100644 --- a/css/react-native.css +++ b/css/react-native.css @@ -1276,7 +1276,7 @@ input#algolia-doc-search { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: proxima-nova, "Helvetica Neue", Helvetica, Arial, sans-serif; - background: transparent url('/react-native/img/search.png') no-repeat left center; + background: transparent url('../img/search.png') no-repeat left center; background-size: 16px 16px; padding-left: 30px; diff --git a/docs/accessibility.html b/docs/accessibility.html index 50d4da21165..f6848ee7af2 100644 --- a/docs/accessibility.html +++ b/docs/accessibility.html @@ -1,4 +1,4 @@ -
Accessibility # | Edit on GitHub |
Both iOS and Android provide APIs for making apps accessible to people with disabilities. In addition, both platforms provide bundled assistive technologies, like the screen readers VoiceOver (iOS) and TalkBack (Android) for the visually impaired. Similarly, in React Native we have included APIs designed to provide developers with support for making apps more accessible. Take note, iOS and Android differ slightly in their approaches, and thus the React Native implementations may vary by platform.
When true, indicates that the view is an accessibility element. When a view is an accessibility element, it groups its children into a single selectable component. By default, all touchable elements are accessible.
On Android, ‘accessible={true}’ property for a react-native View will be translated into native ‘focusable={true}’.
Accessibility # | Edit on GitHub |
Both iOS and Android provide APIs for making apps accessible to people with disabilities. In addition, both platforms provide bundled assistive technologies, like the screen readers VoiceOver (iOS) and TalkBack (Android) for the visually impaired. Similarly, in React Native we have included APIs designed to provide developers with support for making apps more accessible. Take note, iOS and Android differ slightly in their approaches, and thus the React Native implementations may vary by platform.
When true, indicates that the view is an accessibility element. When a view is an accessibility element, it groups its children into a single selectable component. By default, all touchable elements are accessible.
On Android, ‘accessible={true}’ property for a react-native View will be translated into native ‘focusable={true}’.
In the above example, we can't get accessibility focus separately on 'text one' and 'text two'. Instead we get focus on a parent view with 'accessible' property.
When a view is marked as accessible, it is a good practice to set an accessibilityLabel on the view, so that people who use VoiceOver know what element they have selected. VoiceOver will read this string when a user selects the associated element.
To use, set the accessibilityLabel property to a custom string on your View:
In the above example we've created a custom radio button that now behaves like a native one. More specifically, TalkBack now correctly announces changes to the radio button selection.
To enable VoiceOver, go to the Settings app on your iOS device. Tap General, then Accessibility. There you will find many tools that people use to use to make their devices more usable, such as bolder text, increased contrast, and VoiceOver.
To enable VoiceOver, tap on VoiceOver under "Vision" and toggle the switch that appears at the top.
At the very bottom of the Accessibility settings, there is an "Accessibility Shortcut". You can use this to toggle VoiceOver by triple clicking the Home button.
ActionSheetIOS # | Edit on GitHub |
Examples # | Edit on GitHub |
ActionSheetIOS # | Edit on GitHub |
Examples # | Edit on GitHub |
ActivityIndicatorIOS # | Edit on GitHub |
Whether to show the indicator (true, the default) or hide it (false).
The foreground color of the spinner (default is gray).
Whether the indicator should hide when not animating (true by default).
Invoked on mount and layout changes with
{nativeEvent: { layout: {x, y, width, height}}}.
Size of the indicator. Small has a height of 20, large has a height of 36.
Examples # | Edit on GitHub |
ActivityIndicatorIOS # | Edit on GitHub |
Whether to show the indicator (true, the default) or hide it (false).
The foreground color of the spinner (default is gray).
Whether the indicator should hide when not animating (true by default).
Invoked on mount and layout changes with
{nativeEvent: { layout: {x, y, width, height}}}.
Size of the indicator. Small has a height of 20, large has a height of 36.
Examples # | Edit on GitHub |
Alert # | Edit on GitHub |
Launches an alert dialog with the specified title and message.
Optionally provide a list of buttons. Tapping any button will fire the +
Alert # | Edit on GitHub |
Launches an alert dialog with the specified title and message.
Optionally provide a list of buttons. Tapping any button will fire the respective onPress callback and dismiss the alert. By default, the only button will be an 'OK' button.
This is an API that works both on iOS and Android and can show static alerts. To show an alert that prompts the user to enter some information, @@ -133,7 +133,7 @@ of a neutral, negative and a positive button:
AlertIOS # | Edit on GitHub |
The AlertsIOS utility provides two functions: alert and prompt. All
+
AlertIOS # | Edit on GitHub |
The AlertsIOS utility provides two functions: alert and prompt. All
functionality available through AlertIOS.alert is also available in the
cross-platform Alert.alert, which we recommend you use if you don't need
iOS-specific functionality.
AlertIOS.prompt allows you to prompt the user for input inside of an
alert popup.
Creates a popup to alert the user. See -Alert.
callbackOrButtons -- This optional argument should be either a +Alert.
callbackOrButtons -- This optional argument should be either a single-argument function or an array of buttons. If passed a function, it will be called when the user taps 'OK'.
If passed an array of button configurations, each button should include
a text key, as well as optional onPress and style keys.
@@ -187,7 +187,7 @@ class PromptOptions extends : '#eeeeee',
padding: 10,
},
-});
Building React Native from source # | Edit on GitHub |
You will need to build React Native from source if you want to work on a new feature/bug fix, try out the latest features which are not released yet, or maintain your own fork with patches that cannot be merged to the core.
Assuming you have the Android SDK installed, run android to open the Android SDK Manager.
Make sure you have the following installed:
build.gradle)build.gradle)Point Gradle to your Android SDK: either have $ANDROID_SDK and $ANDROID_NDK defined, or create a local.properties file in the root of your react-native checkout with the following contents:
Building React Native from source # | Edit on GitHub |
You will need to build React Native from source if you want to work on a new feature/bug fix, try out the latest features which are not released yet, or maintain your own fork with patches that cannot be merged to the core.
Assuming you have the Android SDK installed, run android to open the Android SDK Manager.
Make sure you have the following installed:
build.gradle)build.gradle)Point Gradle to your Android SDK: either have $ANDROID_SDK and $ANDROID_NDK defined, or create a local.properties file in the root of your react-native checkout with the following contents:
Example:
First, you need to install react-native from your fork. For example, to install the master branch from the official repo, run the following:
Alternatively, you can clone the repo to your node_modules directory and run npm install inside the cloned repo.
Add gradle-download-task as dependency in android/build.gradle:
Android Setup # | Edit on GitHub |
This guide describes basic steps of the Android development environment setup that are required to run React Native android apps on an android emulator.
On Mac, if you have installed XCode, Git is already installed, otherwise run the following:
On Linux, install Git via your package manager.
On Windows, download and install Git for Windows. During the setup process, choose "Run Git from Windows Command Prompt", which will add Git to your PATH environment variable.
brew install android-sdkIMPORTANT: Make sure the ANDROID_HOME environment variable points to your existing Android SDK:
On Mac, add this to your ~/.bashrc, ~/.bash_profile or whatever your shell uses:
On Linux, add this to your ~/.bashrc, ~/.bash_profile or whatever your shell uses:
On Windows, go to Control Panel -> System and Security -> System -> Change settings -> Advanced -> Environment variables -> New
NOTE: You need to restart the Command Prompt (Windows) / Terminal Emulator (Mac OS X, Linux) to apply the new Environment variables.
React Native Android use gradle as a build system. We recommend to enable gradle daemon functionality which may result in up to 50% improvement in incremental build times for changes in java code. Learn here how to enable it for your platform.
android); in the window that appears make sure you check:

Genymotion is much easier to set up than stock Google emulators. However, it's only free for personal use. If you want to use the stock Google emulator, see below.
android; in the window that appears make sure you check:android avd and click on Create...
-
Start...The Visual Studio Emulator for Android is a free android emulator that is hardware accelerated via Hyper-V. It doesn't require you to install Visual Studio at all.
To use it with react-native you just have to add a key and value to your registry:
regedit.exeHKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK ToolsAndroid SDK Tools and choose New > String ValuePathPath Key and set the value to C:\Program Files\Android\sdk. The path value might be different on your machine.You will also need to run the command adb reverse tcp:8081 tcp:8081 with this emulator.
Then restart the emulator and when it runs you can just do react-native run-android as usual.
You can use any editor to edit JavaScript. If you want to use Android Studio to work on native code, from the Welcome screen of Android Studio choose "Import project" and select the android folder of your app.
Android Setup # | Edit on GitHub |
This guide describes basic steps of the Android development environment setup that are required to run React Native android apps on an android emulator. We don't discuss developer tool configuration such as IDEs here.
On Mac, if you have installed XCode, Git is already installed, otherwise run the following:
On Linux, install Git via your package manager.
On Windows, download and install Git for Windows. During the setup process, choose "Run Git from Windows Command Prompt", which will add Git to your PATH environment variable.
brew install android-sdkIMPORTANT: Make sure the ANDROID_HOME environment variable points to your existing Android SDK:
On Mac, add this to your ~/.bashrc, ~/.bash_profile or whatever your shell uses:
On Linux, add this to your ~/.bashrc, ~/.bash_profile or whatever your shell uses:
On Windows, go to Control Panel -> System and Security -> System -> Change settings -> Advanced -> Environment variables -> New
NOTE: You need to restart the Command Prompt (Windows) / Terminal Emulator (Mac OS X, Linux) to apply the new Environment variables.
React Native Android use gradle as a build system. We recommend to enable gradle daemon functionality which may result in up to 50% improvement in incremental build times for changes in java code. Learn here how to enable it for your platform.
android); in the window that appears make sure you check:

Genymotion is much easier to set up than stock Google emulators. However, it's only free for personal use. If you want to use the stock Google emulator, see below.
android; in the window that appears make sure you check:android avd and click on Create...
+
Start...The Visual Studio Emulator for Android is a free android emulator that is hardware accelerated via Hyper-V. It doesn't require you to install Visual Studio at all.
To use it with react-native you just have to add a key and value to your registry:
regedit.exeHKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK ToolsAndroid SDK Tools and choose New > String ValuePathPath Key and set the value to C:\Program Files\Android\sdk. The path value might be different on your machine.You will also need to run the command adb reverse tcp:8081 tcp:8081 with this emulator.
Then restart the emulator and when it runs you can just do react-native run-android as usual.