mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add view config for AndroidHorizontalScrollView
Summary:
Adding a handwritten view config for AndroidHorizontalScrollView, the native component that's used with `<ScrollView horizontal={true} />` on Android. Native props are the same as `RCTScrollView`, so I'm reusing the type for that.
Changelog: [Internal]
Reviewed By: rickhanlonii
Differential Revision: D18284517
fbshipit-source-id: 7c81f72440b93d611f9574ad2c01a96530d07bf7
This commit is contained in:
committed by
Facebook Github Bot
parent
1f2dc8997f
commit
b7fac14b64
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const registerGeneratedViewConfig = require('../../Utilities/registerGeneratedViewConfig');
|
||||
const requireNativeComponent = require('../../ReactNative/requireNativeComponent');
|
||||
|
||||
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
||||
import type {ScrollViewNativeProps} from './ScrollViewNativeComponentType';
|
||||
|
||||
const AndroidHorizontalScrollViewViewConfig = {
|
||||
uiViewClassName: 'AndroidHorizontalScrollView',
|
||||
bubblingEventTypes: {},
|
||||
directEventTypes: {},
|
||||
validAttributes: {
|
||||
decelerationRate: true,
|
||||
disableIntervalMomentum: true,
|
||||
endFillColor: {process: require('../../StyleSheet/processColor')},
|
||||
fadingEdgeLength: true,
|
||||
nestedScrollEnabled: true,
|
||||
overScrollMode: true,
|
||||
pagingEnabled: true,
|
||||
persistentScrollbar: true,
|
||||
scrollEnabled: true,
|
||||
scrollPerfTag: true,
|
||||
sendMomentumEvents: true,
|
||||
showsHorizontalScrollIndicator: true,
|
||||
snapToEnd: true,
|
||||
snapToInterval: true,
|
||||
snapToStart: true,
|
||||
snapToOffsets: true,
|
||||
},
|
||||
};
|
||||
|
||||
let AndroidHorizontalScrollViewNativeComponent;
|
||||
if (global.RN$Bridgeless) {
|
||||
registerGeneratedViewConfig(
|
||||
'AndroidHorizontalScrollView',
|
||||
AndroidHorizontalScrollViewViewConfig,
|
||||
);
|
||||
AndroidHorizontalScrollViewNativeComponent = 'AndroidHorizontalScrollView';
|
||||
} else {
|
||||
AndroidHorizontalScrollViewNativeComponent = requireNativeComponent<ScrollViewNativeProps>(
|
||||
'AndroidHorizontalScrollView',
|
||||
);
|
||||
}
|
||||
|
||||
export default ((AndroidHorizontalScrollViewNativeComponent: any): HostComponent<ScrollViewNativeProps>);
|
||||
Reference in New Issue
Block a user