Fix SVC for RCTImageView
Summary: Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D33341778 fbshipit-source-id: fb51664706febce570808b6018e98637d5f0d42a
This commit is contained in:
Родитель
067bcb5325
Коммит
fcf01b8c7a
|
@ -18,6 +18,7 @@ import type {
|
|||
DangerouslyImpreciseStyle,
|
||||
ImageStyleProp,
|
||||
} from '../StyleSheet/StyleSheet';
|
||||
import Platform from '../Utilities/Platform';
|
||||
|
||||
type Props = $ReadOnly<{
|
||||
...ImageProps,
|
||||
|
@ -36,62 +37,98 @@ type Props = $ReadOnly<{
|
|||
loadingIndicatorSrc?: ?string,
|
||||
}>;
|
||||
|
||||
const ImageViewViewConfig =
|
||||
Platform.OS === 'android'
|
||||
? {
|
||||
uiViewClassName: 'RCTImageView',
|
||||
bubblingEventTypes: {},
|
||||
directEventTypes: {
|
||||
topLoadStart: {
|
||||
registrationName: 'onLoadStart',
|
||||
},
|
||||
topProgress: {
|
||||
registrationName: 'onProgress',
|
||||
},
|
||||
topError: {
|
||||
registrationName: 'onError',
|
||||
},
|
||||
topLoad: {
|
||||
registrationName: 'onLoad',
|
||||
},
|
||||
topLoadEnd: {
|
||||
registrationName: 'onLoadEnd',
|
||||
},
|
||||
},
|
||||
validAttributes: {
|
||||
blurRadius: true,
|
||||
internal_analyticTag: true,
|
||||
resizeMode: true,
|
||||
tintColor: {
|
||||
process: require('../StyleSheet/processColor'),
|
||||
},
|
||||
borderBottomLeftRadius: true,
|
||||
borderTopLeftRadius: true,
|
||||
resizeMethod: true,
|
||||
src: true,
|
||||
borderRadius: true,
|
||||
headers: true,
|
||||
shouldNotifyLoadEvents: true,
|
||||
defaultSrc: true,
|
||||
overlayColor: {
|
||||
process: require('../StyleSheet/processColor'),
|
||||
},
|
||||
borderColor: {
|
||||
process: require('../StyleSheet/processColor'),
|
||||
},
|
||||
accessible: true,
|
||||
progressiveRenderingEnabled: true,
|
||||
fadeDuration: true,
|
||||
borderBottomRightRadius: true,
|
||||
borderTopRightRadius: true,
|
||||
loadingIndicatorSrc: true,
|
||||
},
|
||||
}
|
||||
: {
|
||||
uiViewClassName: 'RCTImageView',
|
||||
bubblingEventTypes: {},
|
||||
directEventTypes: {
|
||||
topLoadStart: {
|
||||
registrationName: 'onLoadStart',
|
||||
},
|
||||
topProgress: {
|
||||
registrationName: 'onProgress',
|
||||
},
|
||||
topError: {
|
||||
registrationName: 'onError',
|
||||
},
|
||||
topPartialLoad: {
|
||||
registrationName: 'onPartialLoad',
|
||||
},
|
||||
topLoad: {
|
||||
registrationName: 'onLoad',
|
||||
},
|
||||
topLoadEnd: {
|
||||
registrationName: 'onLoadEnd',
|
||||
},
|
||||
},
|
||||
validAttributes: {
|
||||
blurRadius: true,
|
||||
capInsets: {
|
||||
diff: require('../Utilities/differ/insetsDiffer'),
|
||||
},
|
||||
defaultSource: {
|
||||
process: require('./resolveAssetSource'),
|
||||
},
|
||||
internal_analyticTag: true,
|
||||
resizeMode: true,
|
||||
source: true,
|
||||
tintColor: {
|
||||
process: require('../StyleSheet/processColor'),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const ImageViewNativeComponent: HostComponent<Props> =
|
||||
NativeComponentRegistry.get<Props>('RCTImageView', () => ({
|
||||
uiViewClassName: 'RCTImageView',
|
||||
bubblingEventTypes: {},
|
||||
directEventTypes: {
|
||||
topLoadStart: {
|
||||
registrationName: 'onLoadStart',
|
||||
},
|
||||
topProgress: {
|
||||
registrationName: 'onProgress',
|
||||
},
|
||||
topError: {
|
||||
registrationName: 'onError',
|
||||
},
|
||||
topPartialLoad: {
|
||||
registrationName: 'onPartialLoad',
|
||||
},
|
||||
topLoad: {
|
||||
registrationName: 'onLoad',
|
||||
},
|
||||
topLoadEnd: {
|
||||
registrationName: 'onLoadEnd',
|
||||
},
|
||||
},
|
||||
validAttributes: {
|
||||
blurRadius: true,
|
||||
capInsets: {
|
||||
diff: require('../Utilities/differ/insetsDiffer'),
|
||||
},
|
||||
defaultSource: {
|
||||
process: require('./resolveAssetSource'),
|
||||
},
|
||||
defaultSrc: true,
|
||||
fadeDuration: true,
|
||||
headers: true,
|
||||
internal_analyticTag: true,
|
||||
loadingIndicatorSrc: true,
|
||||
onError: true,
|
||||
onLoad: true,
|
||||
onLoadEnd: true,
|
||||
onLoadStart: true,
|
||||
onPartialLoad: true,
|
||||
onProgress: true,
|
||||
overlayColor: {
|
||||
process: require('../StyleSheet/processColor'),
|
||||
},
|
||||
progressiveRenderingEnabled: true,
|
||||
resizeMethod: true,
|
||||
resizeMode: true,
|
||||
shouldNotifyLoadEvents: true,
|
||||
source: true,
|
||||
src: true,
|
||||
tintColor: {
|
||||
process: require('../StyleSheet/processColor'),
|
||||
},
|
||||
},
|
||||
}));
|
||||
NativeComponentRegistry.get<Props>('RCTImageView', () => ImageViewViewConfig);
|
||||
|
||||
export default ImageViewNativeComponent;
|
||||
|
|
Загрузка…
Ссылка в новой задаче