AndroidHorizontalScrollViewNativeComponent.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @format
  8. * @flow
  9. */
  10. 'use strict';
  11. const registerGeneratedViewConfig = require('../../Utilities/registerGeneratedViewConfig');
  12. const requireNativeComponent = require('../../ReactNative/requireNativeComponent');
  13. import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
  14. import type {ScrollViewNativeProps} from './ScrollViewNativeComponentType';
  15. const AndroidHorizontalScrollViewViewConfig = {
  16. uiViewClassName: 'AndroidHorizontalScrollView',
  17. bubblingEventTypes: {},
  18. directEventTypes: {},
  19. validAttributes: {
  20. decelerationRate: true,
  21. disableIntervalMomentum: true,
  22. endFillColor: {process: require('../../StyleSheet/processColor')},
  23. fadingEdgeLength: true,
  24. nestedScrollEnabled: true,
  25. overScrollMode: true,
  26. pagingEnabled: true,
  27. persistentScrollbar: true,
  28. scrollEnabled: true,
  29. scrollPerfTag: true,
  30. sendMomentumEvents: true,
  31. showsHorizontalScrollIndicator: true,
  32. snapToEnd: true,
  33. snapToInterval: true,
  34. snapToStart: true,
  35. snapToOffsets: true,
  36. contentOffset: true,
  37. },
  38. };
  39. let AndroidHorizontalScrollViewNativeComponent;
  40. if (global.RN$Bridgeless) {
  41. registerGeneratedViewConfig(
  42. 'AndroidHorizontalScrollView',
  43. AndroidHorizontalScrollViewViewConfig,
  44. );
  45. AndroidHorizontalScrollViewNativeComponent = 'AndroidHorizontalScrollView';
  46. } else {
  47. AndroidHorizontalScrollViewNativeComponent = requireNativeComponent<ScrollViewNativeProps>(
  48. 'AndroidHorizontalScrollView',
  49. );
  50. }
  51. export default ((AndroidHorizontalScrollViewNativeComponent: any): HostComponent<ScrollViewNativeProps>);