Skip to content

Commit 553f4bb

Browse files
committed
upgrade to 0.60
1 parent b751a6f commit 553f4bb

28 files changed

+932
-937
lines changed

.npmignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
/screenshot
2-
/.idea
2+
/.idea
3+
/node_modules
4+
.prettierrc
5+
README.md

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"printWidth": 100,
3+
"trailingComma": "all",
4+
"tabWidth": 2,
5+
"semi": true,
6+
"singleQuote": true,
7+
"bracketSpacing": true,
8+
"arrowParens": "always"
9+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ It works, have fun!
2222

2323
### iOS
2424

25-
You need to install this module: https://github.com/react-native-community/art
25+
Following the [Art module](https://github.com/react-native-community/art) instruction to configure.
2626

2727
## Usage
2828

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const BubblesLoader = Bubbles;
2222
export const CirclesLoader = Circles;
2323
export const CirclesRotationScaleLoader = CirclesRotationScale;
2424
export const ColorDotsLoader = ColorDots;
25-
export const DotsLoader = Dots;
25+
export const DotsLoader = Dots;
2626
export const DoubleCircleLoader = DoubleCircle;
2727
export const EatBeanLoader = EatBean;
2828
export const LinesLoader = Lines;

lib/loader/BreathingLoader.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
import React from "react";
2-
import PropTypes from "prop-types";
3-
import { Animated } from "react-native";
4-
import { Surface } from "@react-native-community/art";
5-
import AnimatedCircle from "../animated/AnimatedCircle";
6-
import { color } from "../const";
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import { Animated } from 'react-native';
4+
import { Surface } from '@react-native-community/art';
5+
import AnimatedCircle from '../animated/AnimatedCircle';
6+
import { color } from '../const';
77

88
export default class BreathingLoader extends React.PureComponent {
99
static propTypes = {
1010
color: PropTypes.string,
1111
size: PropTypes.number,
1212
strokeWidth: PropTypes.number,
13-
frequency: PropTypes.number
13+
frequency: PropTypes.number,
1414
};
1515

1616
static defaultProps = {
1717
color,
1818
size: 30,
1919
strokeWidth: 3,
20-
frequency: 800
20+
frequency: 800,
2121
};
2222

2323
constructor(props) {
2424
super(props);
2525
this.state = {
26-
scale: new Animated.Value(0.1)
26+
scale: new Animated.Value(0.1),
2727
};
2828
}
2929

@@ -39,12 +39,12 @@ export default class BreathingLoader extends React.PureComponent {
3939
Animated.sequence([
4040
Animated.timing(this.state.scale, {
4141
toValue: 1,
42-
duration: this.props.frequency
42+
duration: this.props.frequency,
4343
}),
4444
Animated.timing(this.state.scale, {
4545
toValue: 0.1,
46-
duration: this.props.frequency
47-
})
46+
duration: this.props.frequency,
47+
}),
4848
]).start(() => {
4949
!this.unmounted && this._animation();
5050
});

lib/loader/BubblesLoader.js

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import React from "react";
2-
import PropTypes from "prop-types";
3-
import { Animated } from "react-native";
4-
import { Surface } from "@react-native-community/art";
5-
import AnimatedCircle from "../animated/AnimatedCircle";
6-
import { color } from "../const";
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import { Animated } from 'react-native';
4+
import { Surface } from '@react-native-community/art';
5+
import AnimatedCircle from '../animated/AnimatedCircle';
6+
import { color } from '../const';
77

88
export default class BubblesLoader extends React.PureComponent {
99
static propTypes = {
1010
color: PropTypes.string,
1111
dotRadius: PropTypes.number,
12-
size: PropTypes.number
12+
size: PropTypes.number,
1313
};
1414

1515
static defaultProps = {
1616
color,
1717
dotRadius: 10,
18-
size: 40
18+
size: 40,
1919
};
2020

2121
state = {
@@ -27,8 +27,8 @@ export default class BubblesLoader extends React.PureComponent {
2727
new Animated.Value(1),
2828
new Animated.Value(1),
2929
new Animated.Value(1),
30-
new Animated.Value(1)
31-
]
30+
new Animated.Value(1),
31+
],
3232
};
3333
eachDegree = 360 / this.state.opacities.length;
3434
timers = [];
@@ -44,15 +44,15 @@ export default class BubblesLoader extends React.PureComponent {
4444

4545
componentWillUnmount() {
4646
this.unmounted = true;
47-
this.timers.forEach(id => {
47+
this.timers.forEach((id) => {
4848
clearTimeout(id);
4949
});
5050
}
5151

52-
_animation = i => {
52+
_animation = (i) => {
5353
Animated.sequence([
5454
Animated.timing(this.state.opacities[i], { toValue: 0.2, duration: 600 }),
55-
Animated.timing(this.state.opacities[i], { toValue: 1, duration: 600 })
55+
Animated.timing(this.state.opacities[i], { toValue: 1, duration: 600 }),
5656
]).start(() => {
5757
!this.unmounted && this._animation(i);
5858
});
@@ -65,14 +65,8 @@ export default class BubblesLoader extends React.PureComponent {
6565
<Surface width={size + dotRadius} height={size + dotRadius}>
6666
{opacities.map((item, i) => {
6767
let radian = (i * this.eachDegree * Math.PI) / 180;
68-
let x =
69-
Math.round((size / 2) * Math.cos(radian)) +
70-
size / 2 +
71-
dotRadius / 2;
72-
let y =
73-
Math.round((size / 2) * Math.sin(radian)) +
74-
size / 2 +
75-
dotRadius / 2;
68+
let x = Math.round((size / 2) * Math.cos(radian)) + size / 2 + dotRadius / 2;
69+
let y = Math.round((size / 2) * Math.sin(radian)) + size / 2 + dotRadius / 2;
7670
return (
7771
<AnimatedCircle
7872
key={i}

lib/loader/CirclesLoader.js

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import React from "react";
2-
import PropTypes from "prop-types";
3-
import { Animated } from "react-native";
4-
import { Surface } from "@react-native-community/art";
5-
import AnimatedCircle from "../animated/AnimatedCircle";
6-
import { color } from "../const";
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import { Animated } from 'react-native';
4+
import { Surface } from '@react-native-community/art';
5+
import AnimatedCircle from '../animated/AnimatedCircle';
6+
import { color } from '../const';
77

88
export default class CirclesLoader extends React.PureComponent {
99
static propTypes = {
1010
color: PropTypes.string,
1111
dotRadius: PropTypes.number,
12-
size: PropTypes.number
12+
size: PropTypes.number,
1313
};
1414

1515
static defaultProps = {
1616
color,
1717
dotRadius: 8,
18-
size: 40
18+
size: 40,
1919
};
2020

2121
state = {
@@ -27,8 +27,8 @@ export default class CirclesLoader extends React.PureComponent {
2727
new Animated.Value(1),
2828
new Animated.Value(1),
2929
new Animated.Value(1),
30-
new Animated.Value(1)
31-
]
30+
new Animated.Value(1),
31+
],
3232
};
3333
eachDegree = 360 / this.state.opacities.length;
3434
timers = [];
@@ -44,15 +44,15 @@ export default class CirclesLoader extends React.PureComponent {
4444

4545
componentWillUnmount() {
4646
this.unmounted = true;
47-
this.timers.forEach(id => {
47+
this.timers.forEach((id) => {
4848
clearTimeout(id);
4949
});
5050
}
5151

52-
_animation = i => {
52+
_animation = (i) => {
5353
Animated.sequence([
5454
Animated.timing(this.state.opacities[i], { toValue: 0.1, duration: 600 }),
55-
Animated.timing(this.state.opacities[i], { toValue: 1, duration: 600 })
55+
Animated.timing(this.state.opacities[i], { toValue: 1, duration: 600 }),
5656
]).start(() => {
5757
!this.unmounted && this._animation(i);
5858
});
@@ -65,14 +65,8 @@ export default class CirclesLoader extends React.PureComponent {
6565
<Surface width={size + dotRadius} height={size + dotRadius}>
6666
{opacities.map((item, i) => {
6767
let radian = (i * this.eachDegree * Math.PI) / 180;
68-
let x =
69-
Math.round((size / 2) * Math.cos(radian)) +
70-
size / 2 +
71-
dotRadius / 2;
72-
let y =
73-
Math.round((size / 2) * Math.sin(radian)) +
74-
size / 2 +
75-
dotRadius / 2;
68+
let x = Math.round((size / 2) * Math.cos(radian)) + size / 2 + dotRadius / 2;
69+
let y = Math.round((size / 2) * Math.sin(radian)) + size / 2 + dotRadius / 2;
7670
return (
7771
<AnimatedCircle
7872
key={i}

lib/loader/CirclesRotationScaleLoader.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
import React from "react";
2-
import PropTypes from "prop-types";
3-
import { Animated, Easing } from "react-native";
4-
import { Surface, Group } from "@react-native-community/art";
5-
import AnimatedCircle from "../animated/AnimatedCircle";
6-
import { color } from "../const";
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import { Animated, Easing } from 'react-native';
4+
import { Surface, Group } from '@react-native-community/art';
5+
import AnimatedCircle from '../animated/AnimatedCircle';
6+
import { color } from '../const';
77

88
export default class RotationCircleLoader extends React.PureComponent {
99
static propTypes = {
1010
size: PropTypes.number,
11-
color: PropTypes.string
11+
color: PropTypes.string,
1212
};
1313

1414
static defaultProps = {
1515
size: 50,
16-
color
16+
color,
1717
};
1818

1919
state = {
2020
degree: new Animated.Value(0),
21-
scales: [new Animated.Value(0), new Animated.Value(0)]
21+
scales: [new Animated.Value(0), new Animated.Value(0)],
2222
};
2323
timers = [];
2424

@@ -34,7 +34,7 @@ export default class RotationCircleLoader extends React.PureComponent {
3434

3535
componentWillUnmount() {
3636
this.unmounted = true;
37-
this.timers.forEach(id => {
37+
this.timers.forEach((id) => {
3838
clearTimeout(id);
3939
});
4040
}
@@ -44,8 +44,8 @@ export default class RotationCircleLoader extends React.PureComponent {
4444
Animated.timing(this.state.degree, {
4545
toValue: 360,
4646
duration: 2000,
47-
easing: Easing.linear
48-
})
47+
easing: Easing.linear,
48+
}),
4949
]).start(() => {
5050
if (!this.unmounted) {
5151
this.state.degree.setValue(0);
@@ -54,10 +54,10 @@ export default class RotationCircleLoader extends React.PureComponent {
5454
});
5555
};
5656

57-
_animationCircles = i => {
57+
_animationCircles = (i) => {
5858
Animated.sequence([
5959
Animated.timing(this.state.scales[i], { toValue: 1, duration: 1000 }),
60-
Animated.timing(this.state.scales[i], { toValue: 0.05, duration: 1000 })
60+
Animated.timing(this.state.scales[i], { toValue: 0.05, duration: 1000 }),
6161
]).start(() => {
6262
!this.unmounted && this._animationCircles(i);
6363
});
@@ -67,13 +67,13 @@ export default class RotationCircleLoader extends React.PureComponent {
6767
const { size, color } = this.props;
6868
const degree = this.state.degree.interpolate({
6969
inputRange: [0, 360],
70-
outputRange: ["0deg", "360deg"]
70+
outputRange: ['0deg', '360deg'],
7171
});
7272
return (
7373
<Animated.View
7474
style={{
7575
transform: [{ rotate: degree }],
76-
backgroundColor: "rgba(0,0,0,0)"
76+
backgroundColor: 'rgba(0,0,0,0)',
7777
}}
7878
>
7979
<Surface width={size} height={size}>

0 commit comments

Comments
 (0)