Skip to content

Commit 1e50777

Browse files
committed
Migrating original js files
1 parent f0b3876 commit 1e50777

File tree

5 files changed

+152
-0
lines changed

5 files changed

+152
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
connection.project.dir=
2+
eclipse.preferences.version=1
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
connection.project.dir=
2+
eclipse.preferences.version=1

js/RNCProgressBarAndroid.android.js

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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+
* @flow
8+
* @format
9+
*/
10+
11+
'use strict';
12+
13+
const React = require('React');
14+
15+
const ProgressBarAndroidNativeComponent = require('ProgressBarAndroidNativeComponent');
16+
17+
import type {ViewProps} from 'ViewPropTypes';
18+
19+
export type ProgressBarAndroidProps = $ReadOnly<{|
20+
...ViewProps,
21+
22+
/**
23+
* Style of the ProgressBar and whether it shows indeterminate progress (e.g. spinner).
24+
*
25+
* `indeterminate` can only be false if `styleAttr` is Horizontal, and requires a
26+
* `progress` value.
27+
*/
28+
...
29+
| {|
30+
styleAttr: 'Horizontal',
31+
indeterminate: false,
32+
progress: number,
33+
|}
34+
| {|
35+
typeAttr:
36+
| 'Horizontal'
37+
| 'Normal'
38+
| 'Small'
39+
| 'Large'
40+
| 'Inverse'
41+
| 'SmallInverse'
42+
| 'LargeInverse',
43+
indeterminate: true,
44+
|},
45+
/**
46+
* Whether to show the ProgressBar (true, the default) or hide it (false).
47+
*/
48+
animating?: ?boolean,
49+
/**
50+
* Color of the progress bar.
51+
*/
52+
color?: ?string,
53+
/**
54+
* Used to locate this view in end-to-end tests.
55+
*/
56+
testID?: ?string,
57+
|}>;
58+
59+
/**
60+
* React component that wraps the Android-only `ProgressBar`. This component is
61+
* used to indicate that the app is loading or there is activity in the app.
62+
*
63+
* Example:
64+
*
65+
* ```
66+
* render: function() {
67+
* var progressBar =
68+
* <View style={styles.container}>
69+
* <ProgressBar styleAttr="Inverse" />
70+
* </View>;
71+
72+
* return (
73+
* <MyLoadingComponent
74+
* componentView={componentView}
75+
* loadingView={progressBar}
76+
* style={styles.loadingComponent}
77+
* />
78+
* );
79+
* },
80+
* ```
81+
*/
82+
const ProgressBarAndroid = (
83+
props: ProgressBarAndroidProps,
84+
forwardedRef: ?React.Ref<typeof ProgressBarAndroidNativeComponent>,
85+
) => {
86+
return <ProgressBarAndroidNativeComponent {...props} ref={forwardedRef} />;
87+
};
88+
89+
const ProgressBarAndroidToExport = React.forwardRef(ProgressBarAndroid);
90+
91+
/* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an
92+
* error found when Flow v0.89 was deployed. To see the error, delete this
93+
* comment and run Flow. */
94+
ProgressBarAndroidToExport.defaultProps = {
95+
styleAttr: 'Normal',
96+
indeterminate: true,
97+
animating: true,
98+
};
99+
100+
/* $FlowFixMe(>=0.89.0 site=react_native_android_fb) This comment suppresses an
101+
* error found when Flow v0.89 was deployed. To see the error, delete this
102+
* comment and run Flow. */
103+
module.exports = (ProgressBarAndroidToExport: ProgressBarAndroidNativeComponent);

js/RNCProgressBarAndroid.ios.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
*/
9+
10+
'use strict';
11+
12+
module.exports = require('UnimplementedView');
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
* @flow
8+
* @format
9+
*/
10+
11+
'use strict';
12+
13+
const requireNativeComponent = require('requireNativeComponent');
14+
15+
import type {ViewProps} from 'ViewPropTypes';
16+
import type {NativeComponent} from 'ReactNative';
17+
18+
type NativeProps = $ReadOnly<{|
19+
...ViewProps,
20+
styleAttr?: string,
21+
typeAttr?: string,
22+
indeterminate: boolean,
23+
progress?: number,
24+
animating?: ?boolean,
25+
color?: ?string,
26+
testID?: ?string,
27+
|}>;
28+
29+
type ProgressBarAndroidType = Class<NativeComponent<NativeProps>>;
30+
31+
module.exports = ((requireNativeComponent(
32+
'AndroidProgressBar',
33+
): any): ProgressBarAndroidType);

0 commit comments

Comments
 (0)