Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix non-integer size property error #16

Merged
merged 2 commits into from
May 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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