react-native/Examples/UIExplorer
Janic Duplessis 44f7a00e95 Cross platform PullToRefreshView component
Summary:
Both iOS and Android currently support some sort of native pull to refresh control but the API was very different. I tried implementing a component based on PullToRefreshViewAndroid but that works on both platforms.

I liked the idea of wrapping the ListView or ScrollView with the PullToRefreshView component and allow styling the refresh view with platform specific props if needed. I also like the fact that 'refreshing' is a controlled prop so there is no need to keep a ref to the component or to the stopRefreshing function.

It is a pretty rough start so I'm looking for feedback and ideas to improve on the API before cleaning up everything.

On iOS we could probably deprecate the onRefreshStart property of the ScrollView and implement the native stuff in a PullToRefreshViewManager. We could then add props to customize the look of the UIRefreshControl (tintColor). We could also deprecate the Android only component and remove it later.
Closes https://github.com/facebook/react-native/pull/4915

Reviewed By: svcscm

Differential Revision: D2799246

Pulled By: nicklockwood

fb-gh-sync-id: 75872c12143ddbc05cc91900ab4612e477ca5765
2016-01-04 08:00:29 -08:00
..
AnimatedGratuitousApp [RN] New AnimationExample 2015-09-03 12:52:56 -08:00
Navigator Fix 16 linter warnings in Examples/ 2015-10-16 04:03:23 -07:00
Thumbnails Fixed zero-size images 2015-11-18 15:23:30 -08:00
UIExplorer Add option for both min/max track image. 2015-12-21 10:30:39 -08:00
UIExplorer.xcodeproj Rename RCTContextExecutor to RCTJSCExecutor 2015-12-16 02:51:28 -08:00
UIExplorerIntegrationTests Consume react, fbjs from npm 2015-12-30 11:41:09 -08:00
UIExplorerUnitTests Remove warnings in RCTBridgeTests 2015-12-23 14:42:31 -08:00
android/app add permission for android geolocation example 2015-12-03 06:27:24 -08:00
AccessibilityAndroidExample.android.js Release React Native for Android 2015-09-14 18:13:39 +01:00
AccessibilityIOSExample.js Fix 16 linter warnings in Examples/ 2015-10-16 04:03:23 -07:00
ActionSheetIOSExample.js Add tintColor for buttons. 2015-12-09 05:19:25 -08:00
ActivityIndicatorIOSExample.js [Flow] Properly fix new errors as of Flow v0.10. 2015-04-27 14:56:21 -08:00
AdSupportIOSExample.js [ReactNative] expose missing haste modules through 'react-native' node module 2015-06-30 18:57:26 -08:00
AlertExample.js Open souce the Android Dialog module 2015-12-17 11:11:13 -08:00
AlertIOSExample.js Open souce the Android Dialog module 2015-12-17 11:11:13 -08:00
AnimatedExample.js Fix all warnings for missing keys. 2015-12-11 21:23:29 -08:00
AppStateIOSExample.js Fix 16 linter warnings in Examples/ 2015-10-16 04:03:23 -07:00
AssetScaledImageExample.js [Image] Improved loading of Assets Library and Photos Framework images. 2015-07-21 05:32:48 -08:00
AsyncStorageExample.js Fix all warnings for missing keys. 2015-12-11 21:23:29 -08:00
BorderExample.js Added support for #rgba and #rrggbbaa colors 2015-11-09 08:02:46 -08:00
CameraRollExample.ios.js Fix all warnings for missing keys. 2015-12-11 21:23:29 -08:00
CameraRollView.ios.js [CameraRoll] support fetching videos from the camera roll 2015-06-01 15:57:32 -08:00
ClipboardExample.js add Clipboard component for ios and android 2015-12-09 10:04:21 -08:00
DatePickerIOSExample.js [Flow] Fix or suppress errors in react-native for Flow v0.13.0 2015-06-22 09:48:15 -08:00
ExampleTypes.js React native fixups 2015-09-18 10:36:24 -07:00
GeolocationExample.js Fix errors uncovered by v0.19.0 2015-12-01 20:11:26 -08:00
ImageCapInsetsExample.js Move Image.resizeMode to component 2015-12-16 16:00:36 -08:00
ImageEditingExample.js Added JS wrappers for ImageStore and ImageEditor 2015-12-23 10:08:07 -08:00
ImageExample.js Implement draggable annotations on MapView. Closes #2512 2016-01-04 06:38:30 -08:00
IntentAndroidExample.android.js Open source IntentAndroid 2015-11-12 12:41:32 -08:00
LayoutEventsExample.js Fix errors uncovered by v0.19.0 2015-12-01 20:11:26 -08:00
LayoutExample.js Migrate unit tests from FBReactKitModules to FBReactKit 2015-07-07 16:39:35 -08:00
ListViewExample.js Expose in public interface 2015-12-23 10:07:34 -08:00
ListViewGridLayoutExample.js Fix THUMBNAILS to follow the require Syntax 2015-12-30 14:50:29 -08:00
ListViewPagingExample.js Fix THUMBNAILS to follow the require Syntax 2015-12-30 14:50:29 -08:00
MapViewExample.js Implement draggable annotations on MapView. Closes #2512 2016-01-04 06:38:30 -08:00
ModalExample.js Make <Modal> visible by default 2015-10-30 17:09:27 -07:00
NavigatorIOSColorsExample.js Fix one warning 2015-09-30 21:02:25 -07:00
NavigatorIOSExample.js [Nav] Add support for bar button icons and left buttons 2015-05-07 08:03:21 -08:00
NetInfoExample.js Don't use arrow functions with Flow types to fix website generation 2015-12-09 14:56:40 -08:00
PanResponderExample.js Fix errors uncovered by v0.19.0 2015-12-01 20:11:26 -08:00
PickerIOSExample.js Fix PickerIOSExample 2015-12-08 13:48:28 -08:00
PointerEventsExample.js Better text descriptions for examples 2015-09-15 14:55:27 -07:00
ProgressBarAndroidExample.android.js Support progress in ProgressBarAndroid 2015-11-06 12:08:29 -08:00
ProgressViewIOSExample.js [Flow] Fix or suppress errors in react-native for Flow v0.13.0 2015-06-22 09:48:15 -08:00
PullToRefreshViewAndroidExample.android.js Fix all warnings for missing keys. 2015-12-11 21:23:29 -08:00
PushNotificationIOSExample.js Updates from Wed 1 Apr 2015-04-01 18:37:03 -07:00
RCTRootViewIOSExample.js RN: Revamp YellowBox for Warnings 2015-11-20 13:09:16 -08:00
README.md Add git clone step to READMEs 2015-11-16 22:55:45 -05:00
RefreshControlExample.js Cross platform PullToRefreshView component 2016-01-04 08:00:29 -08:00
ScrollViewExample.js Fixes #3060 2015-10-02 14:32:23 -07:00
ScrollViewSimpleExample.js Get back 100% in sync with fb codebase 2015-09-16 10:30:53 -07:00
SegmentedControlIOSExample.js Update SegmentedControlIOSExample.js 2015-07-08 12:52:04 -08:00
SetPropertiesExampleApp.js 'Update app properties in runtime' UIExplorer demo 2015-11-12 11:43:34 -08:00
SliderIOSExample.js Add option for both min/max track image. 2015-12-21 10:30:39 -08:00
StatusBarIOSExample.js Fix all warnings for missing keys. 2015-12-11 21:23:29 -08:00
SwitchAndroidExample.android.js Fix 16 linter warnings in Examples/ 2015-10-16 04:03:23 -07:00
SwitchIOSExample.js Fix 16 linter warnings in Examples/ 2015-10-16 04:03:23 -07:00
TabBarIOSExample.js Managed assets support for RCTConvert 2015-09-29 09:21:39 -07:00
TextExample.android.js Add <Text> shadow support 2016-01-01 09:33:31 -08:00
TextExample.ios.js Add <Text> shadow support 2016-01-01 09:33:31 -08:00
TextInputExample.android.js implement android maxlength prop 2015-11-06 13:25:34 -08:00
TextInputExample.ios.js Fixed controlled component on iOS and remove unnecessary code 2015-12-14 06:46:31 -08:00
TimerExample.js Fix all warnings for missing keys. 2015-12-11 21:23:29 -08:00
ToastAndroidExample.android.js Fix typos in example descriptions. 2015-10-20 04:38:21 -07:00
ToolbarAndroidExample.android.js Allow for styling of ToolbarAndroid's overflow icon 2015-10-22 04:43:25 -07:00
TouchableExample.js Better text descriptions for examples 2015-09-15 14:55:27 -07:00
TransformExample.js Added JS wrappers for ImageStore and ImageEditor 2015-12-23 10:08:07 -08:00
TransparentHitTestExample.js Hit testing now treats views with 0.0 opacity as interactable 2015-10-30 04:14:25 -07:00
UIExplorerApp.android.js Release React Native for Android 2015-09-14 18:13:39 +01:00
UIExplorerApp.ios.js 'RCTRootView's size flexibility' UIExplorer demo 2015-11-12 11:43:43 -08:00
UIExplorerBlock.js Fixed text background color 2015-05-28 09:31:57 -08:00
UIExplorerButton.js Add Timer example 2015-09-11 02:00:31 -07:00
UIExplorerList.android.js Cross platform PullToRefreshView component 2016-01-04 08:00:29 -08:00
UIExplorerList.ios.js Cross platform PullToRefreshView component 2016-01-04 08:00:29 -08:00
UIExplorerListBase.js Fix UIExplorer list 2015-12-30 10:43:36 -08:00
UIExplorerPage.js [React Native] Fix padding in UIExplorer 2015-07-03 02:24:56 -08:00
UIExplorerTitle.js [React Native] Fix padding in UIExplorer 2015-07-03 02:24:56 -08:00
VibrationIOSExample.js [React Native] Sync from github 2015-03-27 22:09:11 -08:00
ViewExample.js Support dashed and dotted border styles on iOS 2015-12-23 10:07:28 -08:00
ViewPagerAndroidExample.android.js Add setPageWithoutAnimation 2015-11-13 08:05:27 -08:00
WebViewExample.js Allowing turning on / off DOM storage on android webviews 2015-12-31 18:04:29 -08:00
XHRExample.android.js Don't set height to avoid clipping textinput for XHRExample on android 2015-12-24 13:13:36 -08:00
XHRExample.ios.js Add response headers to XHR response 2015-10-30 11:23:25 -07:00
XHRExampleCookies.js Support cookies on Android 2015-11-23 03:21:31 -08:00
XHRExampleHeaders.js Fix errors uncovered by v0.19.0 2015-12-01 20:11:26 -08:00
bunny.png add remote image support to toolbar 2015-09-30 09:21:27 -07:00
createExamplePage.js [ReactNative][SyncDiff] Add option to make examples platform specific 2015-09-01 04:56:05 -08:00
flux@3x.png Managed assets support for RCTConvert 2015-09-29 09:21:39 -07:00
hawk.png add remote image support to toolbar 2015-09-30 09:21:27 -07:00
slider-left.png Add option for both min/max track image. 2015-12-21 10:30:39 -08:00
slider-left@2x.png Add option for both min/max track image. 2015-12-21 10:30:39 -08:00
slider-right.png Add option for both min/max track image. 2015-12-21 10:30:39 -08:00
slider-right@2x.png Add option for both min/max track image. 2015-12-21 10:30:39 -08:00
slider.png Add option for both min/max track image. 2015-12-21 10:30:39 -08:00
slider@2x.png Add option for both min/max track image. 2015-12-21 10:30:39 -08:00
uie_thumb_big.png added method to set thumb image 2015-11-24 16:10:04 -08:00

README.md

UIExplorer

The UIExplorer is a sample app that showcases React Native views and modules.

Running this app

Before running the app, make sure you ran:

git clone https://github.com/facebook/react-native.git
cd react-native
npm install

Running on iOS

Mac OS and Xcode are required.

  • Open Examples/UIExplorer/UIExplorer.xcodeproj in Xcode
  • Hit the Run button

See Running on device if you want to use a physical device.

Running on Android

You'll need to have all the prerequisites (SDK, NDK) for Building React Native installed.

Start an Android emulator (Genymotion is recommended).

cd react-native
./gradlew :Examples:UIExplorer:android:app:installDebug
./packager/packager.sh

Note: Building for the first time can take a while.

Open the UIExplorer app in your emulator.

See Running on Device in case you want to use a physical device.

Built from source

Building the app on both iOS and Android means building the React Native framework from source. This way you're running the latest native and JS code the way you see it in your clone of the github repo.

This is different from apps created using react-native init which have a dependency on a specific version of React Native JS and native code, declared in a package.json file (and build.gradle for Android apps).