Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Update from original #1

Merged
merged 168 commits into from
Mar 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
6b738d1
remove getAllPerformanceCounters() function
aaronechiu Mar 1, 2017
23f2f5f
default root node to size of parent contraints
Mar 1, 2017
e44730c
Fast finish Travis builds, disable tvOS and JS tests
Mar 1, 2017
04f42ab
packager: DependencyGraph-test: go through fs.watch mock rather than …
Mar 1, 2017
4d00df4
Fix lint errors 2/2
cpojer Mar 1, 2017
5facc23
Packager - Fix absolute imports on Windows
janicduplessis Mar 1, 2017
7b35eb3
Move new components out of `Experimental` directory
sahrens Mar 1, 2017
d5a381f
Fix margin auto for start and end values
Mar 1, 2017
fb266fc
More efficient decoding of Dynamic value in LayoutShadowNode
Mar 1, 2017
cc27555
Add margin auto support to react native
Mar 1, 2017
31f848a
Expose alignContent to react native
Mar 1, 2017
4d69f4b
Add display:none support to react native
Mar 1, 2017
bdd9aed
Move configuration to new YGConfig and pass them down to CalculateLayout
woehrl01 Mar 1, 2017
d54c7f8
Refresh website
hramos Mar 1, 2017
08dbc43
Deprecate NavigationExperimental
Mar 1, 2017
4ee7d94
Move showcase source data into a JSON file
hramos Mar 1, 2017
48a84df
android now supports barStyle
sunnylqm Mar 1, 2017
18eb7ae
Fix the RN OSS gradle build
mhorowitz Mar 1, 2017
e70cdf0
add to RN OSS package.
sahrens Mar 2, 2017
a7a3922
Improve doc generation with flow types
sahrens Mar 2, 2017
8bfab2c
Improve command-line experience for capturing mobile JS heap
Mar 2, 2017
cf4891c
Update Getting Started instructions.
hramos Mar 2, 2017
906879e
BUCK file renaming round 2 (10/13)
swolchok Mar 2, 2017
d2ed064
Add to docs
sahrens Mar 2, 2017
f66fba8
Set initial opacity based on style
mlanter Mar 2, 2017
dc334b0
Improved flow on Picker.Item
agrcrobles Mar 2, 2017
fea8745
Add missing Immutable-List parameter
mjmahone Mar 2, 2017
94901b1
Bring back polyfill test
cpojer Mar 2, 2017
0b34809
blurRadius for Image
Mar 2, 2017
5d37bfa
packager: DependencyGraph-test: fix tests
Mar 2, 2017
067496e
packager: ResolutionRequest: use moduleMap instead of hasteMap
Mar 2, 2017
0cb2bc1
packager: make DependencyGraph.processFileChange private
Mar 2, 2017
a0f49fc
Add deprecation warning for NavigationExperimental
Mar 2, 2017
da04a6b
Remove NavigationExperimental examples
Mar 2, 2017
77b8c09
Implement sticky headers in JS using Native Animated
janicduplessis Mar 2, 2017
13b4c2d
<WebView>: Add propType for injectJavaScript
Mar 2, 2017
f9a3ed3
in non-lazy mode, log instantiation time for each native module
aaronechiu Mar 2, 2017
9f68d95
log native module initialization time
aaronechiu Mar 2, 2017
ee122be
Android: Remove dependency on recyclerview
Mar 3, 2017
d2050a3
log onHostResume and onHostPause times
aaronechiu Mar 3, 2017
32d7531
Fix OSS Website generation
sahrens Mar 3, 2017
dfe09db
Safely fix underline TextInput
astreet Mar 3, 2017
1b79e55
Use floats to prevent double calculation + float casting on scale
woehrl01 Mar 3, 2017
a1406c4
Explicitly set new experimental and a small other improvement
woehrl01 Mar 3, 2017
495fb54
Mark all children as dirty if display changes
woehrl01 Mar 3, 2017
e596217
Added bool config to YGConfig to configure using web defaults
woehrl01 Mar 3, 2017
3e9dedf
packager: minimize terminal.log() work
Mar 3, 2017
8174a0d
Remove semi-colons after class definition
jpstevens Mar 3, 2017
2022b1e
Improve docs
sahrens Mar 3, 2017
218e37d
Fix missing/renamed files so OSS builds again
mhorowitz Mar 3, 2017
f6aad8b
Default sticky headers enabled on ios only.
sahrens Mar 3, 2017
94a333a
Fix crash with js-based sticky headers
sahrens Mar 4, 2017
500dd2c
Fix bug with sticky headers that listen to onLayout
sahrens Mar 4, 2017
7e2d7f0
Replace the outdated flag
Mar 4, 2017
c04e79e
iOS: fixed RCTDevSettings executor-override handling
fkgozali Mar 5, 2017
6378333
upgrade to babylon@6.16.1
kassens Mar 5, 2017
e3ef695
VirtualizedList - trigger this.props.onContentSizeChange
DaveAdams88 Mar 5, 2017
59257d6
fbobjc
jeffmo Mar 5, 2017
c708234
Native Animated - Support multiple events attached to the same prop
janicduplessis Mar 5, 2017
cdcd620
Improve iOS' running on device instructions
Mar 5, 2017
5353d39
Remove unused native iOS sticky headers implementation
janicduplessis Mar 5, 2017
c97c1e5
Fix symlink resolving for examples in the repo
Kureev Mar 6, 2017
4d4028d
Inherit WebSocket protocol scheme in case of http and https
konradreiche Mar 6, 2017
c4e73dd
Fix Issue with network errors
aymen-mouelhi Mar 6, 2017
caa9d84
Update State.md
jsagorin Mar 6, 2017
c535c26
Remove reference to react-router-native
mjackson Mar 6, 2017
7d06c35
Run install third party script as part of the xcode build
janicduplessis Mar 6, 2017
4471c32
CLI: Assign project root concat back to project roots.
rmevans9 Mar 6, 2017
f126540
Fix linking manager library name in documentation
vedadsose Mar 6, 2017
c77f09b
packager: node-haste: remove getHasteMap()
Mar 6, 2017
c503dae
Merge Android UI Performance into Performance doc, reorder sidebar
hramos Mar 6, 2017
5e20b7b
Add TabBarIOS.Item on Android
Mar 6, 2017
8f0c16d
Update Showcase
hramos Mar 6, 2017
b87f4ab
revert D4656347 to fix crashes
zjj010104 Mar 6, 2017
dd5798b
Workaround for P/Invoke AccessViolationException
rozele Mar 6, 2017
31c9943
Updating the info about Myntra
mariostallone Mar 6, 2017
d1411f1
Drop calls to [RCTCxxBridge enqueueCallback:args:] on an invalid inst…
mhorowitz Mar 6, 2017
4e437c1
Export Alert's type ButtonsArray for external use
shergin Mar 6, 2017
4c79df9
Clean up objc-test-ios.sh, include tvOS build check
douglowder Mar 6, 2017
7acf741
android: add ReactInstancePackage abstract class to pass down ReactIn…
fkgozali Mar 6, 2017
160b1c8
Support for defineEnumerableProperties
sonaye Mar 7, 2017
4040e89
`<TextView>.onContentSizeChange` now fires on ANY content changing ci…
shergin Mar 7, 2017
9959db2
Upgrade fs-extra to 1.0.0
ptomasroos Mar 7, 2017
3f6476f
Tweak presentation of Colors guide.
hramos Mar 7, 2017
293bb36
warn about PureComponent in docs
sahrens Mar 7, 2017
e32e4d9
Blog post
sahrens Mar 7, 2017
b085215
move NativeModule initialization off UI thread
aaronechiu Mar 7, 2017
7005f54
Fix unmount crash when using sticky headers
sahrens Mar 7, 2017
28b43aa
Fix crash with empty section headers
sahrens Mar 7, 2017
9325496
Simplify scroll interaction stuff
sahrens Mar 7, 2017
b7e9374
Move BackAndroid -> BackHandler, add Apple TV support for back nav
douglowder Mar 7, 2017
5257c35
Add new `forkEvent`/`unforkEvent` API
sahrens Mar 7, 2017
b698b4a
Expo
hramos Mar 7, 2017
53c7f1d
When building open source React Native, make Buck use the same versio…
Mar 7, 2017
0a06250
Add build-time check that module methods are exported correctly
Mar 7, 2017
cb3a439
Upgrade double-conversion to 1.1.5
mhorowitz Mar 7, 2017
b8e8b72
Website: Fix aspect ratio of icons in the showcase on homepage
Mar 7, 2017
7eded2d
preserve inline components in prop type doc gen
sahrens Mar 8, 2017
1a8d216
added RCTLog.logToConsole() to force log regardless of debugger conne…
fkgozali Mar 8, 2017
f65a3c4
Replace defaultLink with infoLink in Showcase
hramos Mar 8, 2017
a8474c2
Fix license headers
Mar 8, 2017
7978f7a
enable Systracing is JS before JSBundle finishes loading
aaronechiu Mar 8, 2017
adf650d
Use different function syntax that the JS parser used to build the we…
Mar 8, 2017
48f30ec
Move iOS Maps out of the GitHub repo to internal fb codebase
Mar 8, 2017
4c7576e
Android: Fix clipping of text which contains unicode emoticons on And…
Mar 8, 2017
36f09dc
Add onabort to XHR classes
Mar 8, 2017
22b3faf
iOS: Expose fontScale to JavaScript
Mar 8, 2017
454ab8f
BREAKING: iOS: Support withCredentials flag in XHRs
Mar 8, 2017
36eb69e
Added option to set mixed content mode in android webview
prabakarviji Mar 8, 2017
abc483a
BREAKING - Remove LayoutAnimation experimental flag on Android
janicduplessis Mar 8, 2017
0150bc7
Updating the documentation for getSize()
Mar 8, 2017
a435fbc
packager: node-haste: remove use of HasteMap class
Mar 8, 2017
0ff379b
packager: node-haste: cleanup the load() function
Mar 8, 2017
c5e2cf7
UIExplorer test: wait for packager by polling its status
davidaurelio Mar 8, 2017
f637936
Some more Exponent -> Expo updates
ide Mar 8, 2017
3672b20
Recommend installing latest version of Xcode
hramos Mar 8, 2017
3b146cd
Add dev tools version to new issue template
hramos Mar 9, 2017
ddc4f8a
Update the date for this blog post
hramos Mar 9, 2017
1269f1e
don't obfuscate CxxModule names
aaronechiu Mar 9, 2017
264d60b
Setting `availableSize` for `RCTRootShadowView` on earlier stage
shergin Mar 9, 2017
07153dd
remove dup TRACE_TAG_REACT_APPS
aaronechiu Mar 9, 2017
8d6776c
Remove unpublished blog post
hramos Mar 9, 2017
21c2291
UIExplorer e2e: fix duplicated exit trap
davidaurelio Mar 9, 2017
751addc
Take margin into account on max dimension
woehrl01 Mar 9, 2017
f5585b3
ScrollView should not use RefreshControl on tvOS
douglowder Mar 9, 2017
9c6da27
Move pointscalefactor to config
woehrl01 Mar 9, 2017
a94d14c
Make a section on keyboard shortcuts more prominent
gaearon Mar 9, 2017
0429b6b
Update 2016-12-05-easier-upgrades.md
sunnylqm Mar 9, 2017
b79a246
Update Troubleshooting.md
iboxgithub Mar 9, 2017
a592e5b
Typo documentation ScrollView
dejakob Mar 9, 2017
e5ebdd8
Showcase is now fully managed by OSS team at fb, update comment
Mar 9, 2017
231bf7c
Show bundle loading progress on Android
janicduplessis Mar 9, 2017
d2796ea
Fix cookies not being sent with <Image> network requests
olegbl Mar 9, 2017
bfb2766
Allow Promise to display error strings and not just error objects.
mikelambert Mar 9, 2017
921b9ac
Native Animated - Support multiple events attached to the same prop
janicduplessis Mar 9, 2017
dd5ac84
YellowBox" Only provide elevation style prop when running on Android
cailenmusselman Mar 9, 2017
ac92d3e
Remove showcase submission callout
hramos Mar 9, 2017
b47000a
Refactor dependencies
theoy Mar 10, 2017
28ed5ed
Revert D4494386: [react-native][PR] BREAKING - Remove LayoutAnimation…
fred2028 Mar 10, 2017
5177a55
native animated scroll event support
sahrens Mar 10, 2017
1030aab
packager: Resolver: make the Resolver construction a Promise
Mar 10, 2017
0c46953
packager: node-haste: async load()
Mar 10, 2017
193afff
Update Boost dependency on Android to 1.63
Mar 10, 2017
5c24a91
Update Boost dependency to 1.63 on iOS
Mar 10, 2017
f0394ce
Revert D4588356: Refactor dependencies
Mar 10, 2017
75e783d
Align resolve function names to have similiar namings
woehrl01 Mar 10, 2017
d9ae27b
Clear Fresco memory cache in onHostDestroy
foghina Mar 10, 2017
3e1542b
packager: Resolver: remove opt defaults, simplify load()
Mar 10, 2017
acb9fa8
Refactor dependencies
theoy Mar 10, 2017
434ca24
Use CLOCK_MONOTONIC instead of CLOCK_MONOTONIC_RAW in performanceNow
alexeylang Mar 10, 2017
014eef3
packager: verify validity of TTY before using it
Mar 10, 2017
30bf039
Documentation updates
hramos Mar 10, 2017
a8bd462
Try to fix tvOS and podspec builds
Mar 10, 2017
f28f5d3
Sticky headers are no longer ios-only
sahrens Mar 10, 2017
82ff298
Update ListView sticky header docs
sahrens Mar 10, 2017
68695bd
Fix indent for .babelrc in HelloWorld template
Kerumen Mar 10, 2017
02a6621
Add systemJSCWrapper.cpp to React-tvOS target
douglowder Mar 11, 2017
70e4a58
measure conversion of Java Map to WritableNativeMap for each NativeMo…
aaronechiu Mar 11, 2017
8ba06cb
Fix wrong modal size in fullscreen
Mar 12, 2017
76f5b96
packager: Bundler: refactor the maxWorkerCount
Mar 13, 2017
41f3d0c
Expose getter for 'flex' property
javache Mar 13, 2017
ac452c0
packager: Server: make buildBundle() async
Mar 13, 2017
3ce31c2
Rename *Component props to match SectionList
sahrens Mar 13, 2017
67a8d89
React Conf lanches
hramos Mar 13, 2017
2976aa1
Fixes spelling mistake inside TouchableNativeFeedback.android.js
amilcar-andrade Mar 13, 2017
98798a0
More accurate implementation of `RCTRootView`'s `sizeThatFits:`
shergin Mar 13, 2017
103fa3d
Skip flaky ScrollView tests
Mar 13, 2017
fa30f41
Better TextInput: RCTTextView and RCTTextField was marked as Yoga lea…
shergin Mar 13, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-0]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-0]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-1]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-1]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

unsafe.enable_getters_and_setters=true

[version]
^0.40.0
^0.41.0
10 changes: 7 additions & 3 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
We use GitHub Issues for bugs.
Please read the following carefully before opening a new issue.

If you have a non-bug question, ask on Stack Overflow: http://stackoverflow.com/questions/tagged/react-native
We use GitHub Issues for tracking bugs in React Native.

If you have a feature request, post it on Product Pains: https://productpains.com/product/react-native/
- If you have a non-bug question, ask on Stack Overflow: http://stackoverflow.com/questions/tagged/react-native
- If you have a feature request, post it on Canny: https://react-native.canny.io/feature-requests

Your issue may be closed without explanation if it does not provide the information required by this template.

--- Please use this template, and delete everything above this line before submitting your issue ---

Expand All @@ -23,3 +26,4 @@ If you have a feature request, post it on Product Pains: https://productpains.co
* React Native version: [FILL THIS OUT: Does the bug reproduce on the latest RN release?]
* Platform: [FILL THIS OUT: iOS, Android, or both?]
* Operating System: [FILL THIS OUT: MacOS, Linux, or Windows?]
* Dev tools: [FILL THIS OUT: Xcode or Android Studio version, iOS or Android SDK version, if applicable]
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ node_modules
# Test generated files
/ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
*.js.meta

/third-party
24 changes: 12 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: objective-c

osx_image: xcode8
osx_image: xcode8.2

install:
- mkdir -p /Users/travis/build/facebook/.nvm
Expand All @@ -20,19 +20,18 @@ script:
- if [[ "$TEST_TYPE" = objc-ios ]]; then travis_retry travis_wait ./scripts/objc-test-ios.sh; fi
- if [[ "$TEST_TYPE" = objc-tvos ]]; then travis_retry travis_wait ./scripts/objc-test-tvos.sh; fi
- if [[ "$TEST_TYPE" = e2e-objc ]]; then node ./scripts/run-ci-e2e-tests.js --ios --js --retries 3; fi
- if [[ "$TEST_TYPE" = e2e-objc-tvos ]]; then node ./scripts/run-ci-e2e-tests.js --tvos --retries 3; fi
- if [[ "$TEST_TYPE" = js ]]; then npm run flow check; fi
- if [[ "$TEST_TYPE" = js ]]; then npm test -- --maxWorkers=1; fi
- if [[ ( "$TEST_TYPE" = podspecs ) && ( "$TRAVIS_PULL_REQUEST" = "false" ) ]]; then gem install cocoapods && ./scripts/process-podspecs.sh; fi


matrix:
- fast_finish: true # Fail the whole build as soon as one test type fails. Should help with Travis capacity issues (very long queues).

# The order of these tests says which are more likely to run first and fail the whole build fast.
env:
matrix:
- TEST_TYPE=e2e-objc-tvos
- TEST_TYPE=e2e-objc
- TEST_TYPE=objc-ios
- TEST_TYPE=objc-tvos
- TEST_TYPE=js
- TEST_TYPE=podspecs
- TEST_TYPE=objc-ios
- TEST_TYPE=podspecs
- TEST_TYPE=e2e-objc
- TEST_TYPE=objc-tvos

branches:
only:
Expand All @@ -43,7 +42,8 @@ notifications:
email:
recipients:
- mkonicek@fb.com
- eloy@artsy.net
- douglowder@mac.com # Doug Lowder built and maintains Apple TV specific code and wants to be notified about tvOS failures.
- eloy@artsy.net # Eloy Durán maintains the podspecs test and wants to be notified about failures.
on_failure: change
on_success: change
slack:
Expand Down
18 changes: 9 additions & 9 deletions Examples/Movies/SearchScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,6 @@ var SearchScreen = React.createClass({

fetch(this._urlForQueryAndPage(query, 1))
.then((response) => response.json())
.catch((error) => {
LOADING[query] = false;
resultsCache.dataForQuery[query] = undefined;

this.setState({
dataSource: this.getDataSource([]),
isLoading: false,
});
})
.then((responseData) => {
LOADING[query] = false;
resultsCache.totalForQuery[query] = responseData.total;
Expand All @@ -148,6 +139,15 @@ var SearchScreen = React.createClass({
dataSource: this.getDataSource(responseData.movies),
});
})
.catch((error) => {
LOADING[query] = false;
resultsCache.dataForQuery[query] = undefined;

this.setState({
dataSource: this.getDataSource([]),
isLoading: false,
});
})
.done();
},

Expand Down
4 changes: 4 additions & 0 deletions Examples/UIExplorer/js/CameraRollView.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ var propTypes = {
};

var CameraRollView = React.createClass({
// $FlowFixMe(>=0.41.0)
propTypes: propTypes,

getDefaultProps: function(): Object {
Expand Down Expand Up @@ -123,6 +124,7 @@ var CameraRollView = React.createClass({
rendererChanged: function() {
var ds = new ListView.DataSource({rowHasChanged: this._rowHasChanged});
this.state.dataSource = ds.cloneWithRows(
// $FlowFixMe(>=0.41.0)
groupByEveryN(this.state.assets, this.props.imagesPerRow)
);
},
Expand Down Expand Up @@ -209,6 +211,7 @@ var CameraRollView = React.createClass({
if (image === null) {
return null;
}
// $FlowFixMe(>=0.41.0)
return this.props.renderImage(image);
});

Expand All @@ -231,6 +234,7 @@ var CameraRollView = React.createClass({
newState.lastCursor = data.page_info.end_cursor;
newState.assets = this.state.assets.concat(assets);
newState.dataSource = this.state.dataSource.cloneWithRows(
// $FlowFixMe(>=0.41.0)
groupByEveryN(newState.assets, this.props.imagesPerRow)
);
}
Expand Down
84 changes: 66 additions & 18 deletions Examples/UIExplorer/js/FlatListExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
const React = require('react');
const ReactNative = require('react-native');
const {
Animated,
FlatList,
StyleSheet,
View,
} = ReactNative;

const FlatList = require('FlatList');
const UIExplorerPage = require('./UIExplorerPage');

const infoLog = require('infoLog');
Expand All @@ -47,6 +48,8 @@ const {
renderSmallSwitchOption,
} = require('./ListExampleShared');

const AnimatedFlatList = Animated.createAnimatedComponent(FlatList);

const VIEWABILITY_CONFIG = {
minimumViewTime: 3000,
viewAreaCoveragePercentThreshold: 100,
Expand All @@ -66,18 +69,34 @@ class FlatListExample extends React.PureComponent {
logViewable: false,
virtualized: true,
};

_onChangeFilterText = (filterText) => {
this.setState({filterText});
};

_onChangeScrollToIndex = (text) => {
this._listRef.scrollToIndex({viewPosition: 0.5, index: Number(text)});
this._listRef.getNode().scrollToIndex({viewPosition: 0.5, index: Number(text)});
};

_scrollPos = new Animated.Value(0);
_scrollSinkX = Animated.event(
[{nativeEvent: { contentOffset: { x: this._scrollPos } }}],
{useNativeDriver: true},
);
_scrollSinkY = Animated.event(
[{nativeEvent: { contentOffset: { y: this._scrollPos } }}],
{useNativeDriver: true},
);

componentDidUpdate() {
this._listRef.recordInteraction(); // e.g. flipping logViewable switch
this._listRef.getNode().recordInteraction(); // e.g. flipping logViewable switch
}

render() {
const filterRegex = new RegExp(String(this.state.filterText), 'i');
const filter = (item) => (filterRegex.test(item.text) || filterRegex.test(item.title));
const filter = (item) => (
filterRegex.test(item.text) || filterRegex.test(item.title)
);
const filteredData = this.state.data.filter(filter);
return (
<UIExplorerPage
Expand All @@ -93,7 +112,6 @@ class FlatListExample extends React.PureComponent {
<PlainInput
onChangeText={this._onChangeScrollToIndex}
placeholder="scrollToIndex..."
style={styles.searchTextInput}
/>
</View>
<View style={styles.options}>
Expand All @@ -102,22 +120,37 @@ class FlatListExample extends React.PureComponent {
{renderSmallSwitchOption(this, 'fixedHeight')}
{renderSmallSwitchOption(this, 'logViewable')}
{renderSmallSwitchOption(this, 'debug')}
<Animated.View style={[styles.spindicator, {
transform: [
{rotate: this._scrollPos.interpolate({
inputRange: [0, 5000],
outputRange: ['0deg', '360deg'],
extrapolate: 'extend',
})}
]
}]} />
</View>
</View>
<SeparatorComponent />
<FlatList
HeaderComponent={HeaderComponent}
FooterComponent={FooterComponent}
SeparatorComponent={SeparatorComponent}
<AnimatedFlatList
ItemSeparatorComponent={SeparatorComponent}
ListHeaderComponent={HeaderComponent}
ListFooterComponent={FooterComponent}
data={filteredData}
debug={this.state.debug}
disableVirtualization={!this.state.virtualized}
getItemLayout={this.state.fixedHeight ? this._getItemLayout : undefined}
getItemLayout={this.state.fixedHeight ?
this._getItemLayout :
undefined
}
horizontal={this.state.horizontal}
key={(this.state.horizontal ? 'h' : 'v') + (this.state.fixedHeight ? 'f' : 'd')}
key={(this.state.horizontal ? 'h' : 'v') +
(this.state.fixedHeight ? 'f' : 'd')
}
legacyImplementation={false}
numColumns={1}
onRefresh={this._onRefresh}
onScroll={this.state.horizontal ? this._scrollSinkX : this._scrollSinkY}
onViewableItemsChanged={this._onViewableItemsChanged}
ref={this._captureRef}
refreshing={false}
Expand Down Expand Up @@ -145,26 +178,35 @@ class FlatListExample extends React.PureComponent {
};
_shouldItemUpdate(prev, next) {
/**
* Note that this does not check state.horizontal or state.fixedheight because we blow away the
* whole list by changing the key in those cases. Make sure that you do the same in your code,
* or incorporate all relevant data into the item data, or skip this optimization entirely.
* Note that this does not check state.horizontal or state.fixedheight
* because we blow away the whole list by changing the key in those cases.
* Make sure that you do the same in your code, or incorporate all relevant
* data into the item data, or skip this optimization entirely.
*/
return prev.item !== next.item;
}
// This is called when items change viewability by scrolling into or out of the viewable area.
// This is called when items change viewability by scrolling into or out of
// the viewable area.
_onViewableItemsChanged = (info: {
changed: Array<{
key: string, isViewable: boolean, item: any, index: ?number, section?: any
key: string,
isViewable: boolean,
item: any,
index: ?number,
section?: any,
}>
}
) => {
// Impressions can be logged here
if (this.state.logViewable) {
infoLog('onViewableItemsChanged: ', info.changed.map((v) => ({...v, item: '...'})));
infoLog(
'onViewableItemsChanged: ',
info.changed.map((v) => ({...v, item: '...'})),
);
}
};
_pressItem = (key: number) => {
this._listRef.recordInteraction();
this._listRef.getNode().recordInteraction();
pressItem(this, key);
};
_listRef: FlatList<*>;
Expand All @@ -180,6 +222,12 @@ const styles = StyleSheet.create({
searchRow: {
paddingHorizontal: 10,
},
spindicator: {
marginLeft: 'auto',
width: 2,
height: 16,
backgroundColor: 'darkgray',
},
});

module.exports = FlatListExample;
39 changes: 39 additions & 0 deletions Examples/UIExplorer/js/ImageExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,45 @@ exports.examples = [
},
platform: 'ios',
},
{
title: 'Blur Radius',
render: function() {
return (
<View style={styles.horizontal}>
<Image
style={[styles.base,]}
source={fullImage}
blurRadius={0}
/>
<Image
style={[styles.base, styles.leftMargin]}
source={fullImage}
blurRadius={5}
/>
<Image
style={[styles.base, styles.leftMargin]}
source={fullImage}
blurRadius={10}
/>
<Image
style={[styles.base, styles.leftMargin]}
source={fullImage}
blurRadius={15}
/>
<Image
style={[styles.base, styles.leftMargin]}
source={fullImage}
blurRadius={20}
/>
<Image
style={[styles.base, styles.leftMargin]}
source={fullImage}
blurRadius={25}
/>
</View>
);
},
},
];

var fullImage = {uri: 'https://facebook.github.io/react/img/logo_og.png'};
Expand Down
Loading