Re-sync with internal repository

This commit is contained in:
Héctor Ramos 2019-12-19 13:42:21 -08:00
Родитель 7428271995
Коммит be355a24b7
4 изменённых файлов: 59 добавлений и 4 удалений

Просмотреть файл

@ -10,6 +10,7 @@
'use strict';
import ReactNativeViewViewConfigAndroid from './ReactNativeViewViewConfigAndroid';
import {Platform} from 'react-native';
const ReactNativeViewConfig = {
uiViewClassName: 'RCTView',
@ -321,7 +322,9 @@ const ReactNativeViewConfig = {
textTransform: true,
tintColor: {process: require('../../StyleSheet/processColor')},
top: true,
transform: {diff: require('../../Utilities/differ/matricesDiffer')},
transform: ((Platform.OS === 'ios'
? {diff: require('../../Utilities/differ/matricesDiffer')}
: {process: require('../../StyleSheet/processTransform')}): any),
transformMatrix: true,
translateX: true,
translateY: true,
@ -331,7 +334,9 @@ const ReactNativeViewConfig = {
},
testID: true,
top: true,
transform: {diff: require('../../Utilities/differ/matricesDiffer')},
transform: ((Platform.OS === 'ios'
? {diff: require('../../Utilities/differ/matricesDiffer')}
: {process: require('../../StyleSheet/processTransform')}): any),
translateX: true,
translateY: true,
width: true,

Просмотреть файл

@ -15,6 +15,43 @@ import {Animated, StyleSheet, Text, View} from 'react-native';
import type {Node, Element} from 'react';
function AnimateTansformSingleProp() {
const [theta] = useState(new Animated.Value(45));
const animate = () => {
theta.setValue(0);
Animated.timing(theta, {
toValue: 100,
duration: 3000,
useNativeDriver: false,
}).start(animate);
};
useEffect(() => {
animate();
});
return (
<View style={styles.flipCardContainer}>
<Animated.View
style={[
styles.box6,
{
transform: [
{
rotate: theta.interpolate({
inputRange: [0, 100],
outputRange: ['0deg', '360deg'],
}),
},
],
},
]}>
<Text style={styles.flipText}>This text is flipping great.</Text>
</Animated.View>
</View>
);
}
function Flip() {
const [theta] = useState(new Animated.Value(45));
const animate = () => {
@ -160,6 +197,10 @@ const styles = StyleSheet.create({
box5Transform: {
transform: [{translate: [-50, 35]}, {rotate: '50deg'}, {scale: 2}],
},
box6: {
backgroundColor: 'salmon',
alignSelf: 'center',
},
flipCardContainer: {
marginVertical: 40,
flex: 1,
@ -276,4 +317,11 @@ exports.examples = [
);
},
},
{
title: 'Amimate Translate single prop',
description: "rotate: '360deg'",
render(): Node {
return <AnimateTansformSingleProp />;
},
},
];

Просмотреть файл

@ -209,7 +209,7 @@ public class MainReactPackage extends TurboReactPackage {
public ReactModuleInfoProvider getReactModuleInfoProvider() {
try {
Class<?> reactModuleInfoProviderClass =
Class.forName("com.facebook.react.MainReactPackage$$ReactModuleInfoProvider");
Class.forName("com.facebook.react.shell.MainReactPackage$$ReactModuleInfoProvider");
return (ReactModuleInfoProvider) reactModuleInfoProviderClass.newInstance();
} catch (ClassNotFoundException e) {
// In OSS case, the annotation processor does not run. We fall back on creating this byhand

Просмотреть файл

@ -61,6 +61,8 @@ adb shell am start -n com.facebook.react.uiapp/.RNTesterActivity
info "Press any key to open the workspace in Xcode, then build and test manually."
info ""
read -n 1
success "Installing CocoaPods dependencies"
rm -rf RNTester/Pods && cd RNTester && pod install
open "RNTester/RNTesterPods.xcworkspace"
info "When done testing RNTester app on iOS and Android press any key to continue."
@ -98,7 +100,7 @@ info ""
info "Press any key to run the sample in Android emulator/device"
info ""
read -n 1
cd "/tmp/${project_name}" && react-native run-android
cd "/tmp/${project_name}" && npx react-native run-android
info "Test the following on iOS:"
info " - Disable Fast Refresh. It might be enabled from last time (the setting is stored on the device)"