-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathAndroidSvgViewNativeComponent.ts
77 lines (72 loc) · 2.39 KB
/
AndroidSvgViewNativeComponent.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ColorValue } from 'react-native';
import type {
Double,
Float,
Int32,
} from 'react-native/Libraries/Types/CodegenTypes';
import type { ViewProps } from './utils';
type NativeBackgroundProp = Readonly<{
type?: string;
color?: Float;
borderless?: boolean;
rippleRadius?: Float;
}>;
type HitSlop = Readonly<{
left?: Float;
top?: Float;
right?: Float;
bottom?: Float;
}>;
interface NativeProps extends ViewProps {
bbWidth?: string;
bbHeight?: string;
minX?: Float;
minY?: Float;
vbWidth?: Float;
vbHeight?: Float;
align?: string;
meetOrSlice?: Int32;
tintColor?: ColorValue;
color?: ColorValue;
pointerEvents?: string;
// props needed for Android SvgView
hasTVPreferredFocus?: boolean;
borderTopEndRadius?: Float;
borderBottomStartRadius?: Float;
borderBottomColor?: ColorValue;
nextFocusDown?: Int32;
borderRightColor?: ColorValue;
nextFocusRight?: Int32;
borderLeftColor?: ColorValue;
borderColor?: ColorValue;
removeClippedSubviews?: boolean;
nextFocusForward?: Int32;
nextFocusUp?: Int32;
accessible?: boolean;
borderStartColor?: ColorValue;
borderBottomEndRadius?: Float;
borderEndColor?: ColorValue;
focusable?: boolean;
nativeBackgroundAndroid?: NativeBackgroundProp; // maybe there should a value accepted by codegen for this?
borderTopStartRadius?: Float;
nativeForegroundAndroid?: NativeBackgroundProp; // maybe there should a value accepted by codegen for this?
backfaceVisibility?: string;
borderStyle?: string;
needsOffscreenAlphaCompositing?: boolean;
hitSlop?: HitSlop;
borderTopColor?: ColorValue;
nextFocusLeft?: Int32;
// TODO: those props are present in the `ReactPropGroup` but are not supported
// (https://github.com/facebook/react-native/blob/35556dba600fbb28e0f41340a74b6c4a59bc6018/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java#L613)
// and static view config validator says that they are missing.
// We pass them as doubles although they should be floats, and cast them to floats again on the native side.
borderTopRightRadius?: Double;
borderBottomRightRadius?: Double;
borderRadius?: Double;
borderBottomLeftRadius?: Double;
borderTopLeftRadius?: Double;
}
export default codegenNativeComponent<NativeProps>('RNSVGSvgViewAndroid', {
excludedPlatforms: ['iOS'],
});