mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-05 22:47:48 +08:00
LayoutAnimation support for Android RN
Reviewed By: dernienl Differential Revision: D2710141 fb-gh-sync-id: 28d6af84441b7c2dbc423b73eb05e71f62f7cdea
This commit is contained in:
committed by
facebook-github-bot-4
parent
cf892a96d6
commit
098fcb3a27
@@ -11,6 +11,7 @@
|
||||
* 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.
|
||||
*
|
||||
* @provides ListViewPagingExample
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
@@ -26,6 +27,11 @@ var {
|
||||
View,
|
||||
} = React;
|
||||
|
||||
var NativeModules = require('NativeModules');
|
||||
var {
|
||||
UIManager,
|
||||
} = NativeModules;
|
||||
|
||||
var PAGE_SIZE = 4;
|
||||
var THUMB_URLS = [
|
||||
'Thumbnails/like.png',
|
||||
@@ -48,6 +54,10 @@ var Thumb = React.createClass({
|
||||
getInitialState: function() {
|
||||
return {thumbIndex: this._getThumbIdx(), dir: 'row'};
|
||||
},
|
||||
componentWillMount: function() {
|
||||
UIManager.setLayoutAnimationEnabledExperimental &&
|
||||
UIManager.setLayoutAnimationEnabledExperimental(true);
|
||||
},
|
||||
_getThumbIdx: function() {
|
||||
return Math.floor(Math.random() * THUMB_URLS.length);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user