mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
[react_native] JS files from D2001635: [react_native] Use hardware layers during adsmanager Navigator navigation
This commit is contained in:
@@ -138,6 +138,37 @@ var NavigatorBreadcrumbNavigationBar = React.createClass({
|
||||
}
|
||||
},
|
||||
|
||||
onAnimationStart: function(fromIndex, toIndex) {
|
||||
var max = Math.max(fromIndex, toIndex);
|
||||
var min = Math.min(fromIndex, toIndex);
|
||||
for (var index = min; index <= max; index++) {
|
||||
this._setRenderViewsToHardwareTextureAndroid(index, true);
|
||||
}
|
||||
},
|
||||
|
||||
onAnimationEnd: function(fromIndex, toIndex) {
|
||||
var max = Math.max(fromIndex, toIndex);
|
||||
var min = Math.min(fromIndex, toIndex);
|
||||
for (var index = min; index <= max; index++) {
|
||||
this._setRenderViewsToHardwareTextureAndroid(index, false);
|
||||
}
|
||||
},
|
||||
|
||||
_setRenderViewsToHardwareTextureAndroid: function(index, renderToHardwareTexture) {
|
||||
var props = {
|
||||
renderToHardwareTextureAndroid: renderToHardwareTexture,
|
||||
};
|
||||
|
||||
this.refs['crumb_' + index].setNativeProps(props);
|
||||
this.refs['icon_' + index].setNativeProps(props);
|
||||
this.refs['separator_' + index].setNativeProps(props);
|
||||
this.refs['title_' + index].setNativeProps(props);
|
||||
var right = this.refs['right_' + index];
|
||||
if (right) {
|
||||
right.setNativeProps(props);
|
||||
}
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var navState = this.props.navState;
|
||||
var icons = navState && navState.routeStack.map(this._renderOrReturnBreadcrumb);
|
||||
|
||||
Reference in New Issue
Block a user