Skip to content

Commit

Permalink
Merge pull request #16 from wkh237/master
Browse files Browse the repository at this point in the history
Fix non-integer size property error
  • Loading branch information
maxs15 committed May 20, 2016
2 parents 93243e6 + 46b58c7 commit a086c78
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 47 deletions.
1 change: 1 addition & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ Thumbs.db
.idea/tasks.xml
.idea/vcs.xml
.idea/workspace.xml
.idea/misc.xml
43 changes: 0 additions & 43 deletions android/.idea/misc.xml

This file was deleted.

4 changes: 2 additions & 2 deletions android/src/main/java/com/react/rnspinkit/RNSpinkit.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class RNSpinkit extends SimpleViewManager<SpinKitView> {

ReactApplicationContext mContext;
Sprite mSprite = getSprite("");
int mSize = 48;
double mSize = 48;

public RNSpinkit(ReactApplicationContext reactContext) {
mContext = reactContext;
Expand Down Expand Up @@ -82,7 +82,7 @@ public void setColor(SpinKitView view, @Nullable String color) {
}

@ReactProp(name = "size")
public void setSize(SpinKitView view, @Nullable Integer size) {
public void setSize(SpinKitView view, @Nullable double size) {
mSize = size;
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
view.setLayoutParams(params);
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class Spinkit extends React.Component {
if (!this.props.isVisible) return <View/>;
return (
<RNSpinkit
type={this.props.type}
size={this.props.size}
type={String(this.props.type)}
size={parseInt(this.props.size)}
color={this.props.color}
style={[size, this.props.style]}/>
);
Expand Down

0 comments on commit a086c78

Please sign in to comment.