react-native APIs
- View
- StyleSheet
- Text
- Platform
- TouchableOpacity
- ScrollView
- Image
- ViewStyle
- Dimensions
- StatusBar
- TextInput
- FlatList
- SafeAreaView
- TextStyle
- ActivityIndicator
- Alert
- StyleProp
- Animated
- Linking
- TouchableWithoutFeedback
- Button
- NativeModules
- KeyboardAvoidingView
- TextInputProps
- ViewProps
- Keyboard
- Easing
- ImageBackground
- TextProps
- LayoutChangeEvent
- NativeSyntheticEvent
- NativeEventEmitter
- Switch
- AppRegistry
- ImageStyle
- ImageSourcePropType
- TouchableOpacityProps
- Modal
- AppState
- RefreshControl
- TouchableHighlight
- BackHandler
- useWindowDimensions
- GestureResponderEvent
- AppStateStatus
- PixelRatio
- useColorScheme
- SectionList
- Pressable
- AsyncStorage
- UIManager
- I18nManager
- ImageProps
- LogBox
- FlatListProps
- LayoutRectangle
- findNodeHandle
- EmitterSubscription
- requireNativeComponent
- PermissionsAndroid
- InteractionManager
- ScrollViewProps
- TextInputFocusEventData
- Share
- ColorSchemeName
- ScaledSize
- Clipboard
- Insets
- NativeScrollEvent
- ListRenderItem
- LayoutAnimation
- TouchableNativeFeedback
- PanResponder
- SectionListData
- ListRenderItemInfo
- AccessibilityRole
- AccessibilityInfo
- ImageURISource
- ViewToken
- SectionListProps
- DeviceEventEmitter
- KeyboardEvent
- ActionSheetIOS
- processColor
- YellowBox
- DevSettings
- Slider
- ViewabilityConfig
- AccessibilityState
- EventSubscription
- Permission
- TextInputSelectionChangeEventData
- EasingFunction
- TouchableHighlightProps
- TextInputSubmitEditingEventData
- TextInputChangeEventData
- Appearance
- KeyboardTypeOptions
- AccessibilityEvent
- NativeScrollPoint
- ActionSheetIOSOptions
- HostComponent
- PlatformOSType
- ITheme
- IThemeColors
- IThemeFonts
- IThemeLayout
- IThemeUtils
- ViewPropTypes
- SectionListRenderItem
- NativeAppEventEmitter
- Picker
- VirtualizedList
- SectionListRenderItemInfo
- TextInputKeyPressEventData
- ShareAction
- ImageErrorEventData
- ProgressViewIOS
- ProgressBarAndroid
- RotateXTransform
- RotateYTransform
- PerpectiveTransform
- RotateTransform
- RotateZTransform
- ScaleTransform
- ScaleXTransform
- ScaleYTransform
- TranslateXTransform
- TranslateYTransform
- SkewXTransform
- SkewYTransform
- TransformsStyle
- NativeModulesStatic
- CheckBox
react-native#TransformsStyle TypeScript Examples
The following examples show how to use
react-native#TransformsStyle.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.ts From react-native-anchor-point with MIT License | 5 votes |
withAnchorPoint = (transform: TransformsStyle, anchorPoint: Point, size: Size) => {
if(!isValidSize(size)) {
return transform;
}
let injectedTransform = transform.transform;
if (!injectedTransform) {
return transform;
}
if (anchorPoint.x !== defaultAnchorPoint.x && size.width) {
const shiftTranslateX = [];
// shift before rotation
shiftTranslateX.push({
translateX: size.width * (anchorPoint.x - defaultAnchorPoint.x),
});
injectedTransform = [...shiftTranslateX, ...injectedTransform];
// shift after rotation
injectedTransform.push({
translateX: size.width * (defaultAnchorPoint.x - anchorPoint.x),
});
}
if (!Array.isArray(injectedTransform)) {
return { transform: injectedTransform };
}
if (anchorPoint.y !== defaultAnchorPoint.y && size.height) {
let shiftTranslateY = [];
// shift before rotation
shiftTranslateY.push({
translateY: size.height * (anchorPoint.y - defaultAnchorPoint.y),
});
injectedTransform = [...shiftTranslateY, ...injectedTransform];
// shift after rotation
injectedTransform.push({
translateY: size.height * (defaultAnchorPoint.y - anchorPoint.y),
});
}
return { transform: injectedTransform };
}