Skip to content

Commit

Permalink
Fixed transfers ratio crash
Browse files Browse the repository at this point in the history
  • Loading branch information
DSteve595 committed Aug 8, 2014
1 parent 5974426 commit 6f9d6dc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 67
versionName '2.0.1'
versionCode 68
versionName '2.0.2'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class PutioTransferLayout implements Parcelable {
public String name;
public long downSpeed;
public long upSpeed;
public String ratio;
public float ratio;
public int percentDone;
public String status;

Expand All @@ -35,7 +35,7 @@ private void readFromParcel(Parcel in) {
this.name = in.readString();
this.downSpeed = in.readLong();
this.upSpeed = in.readLong();
this.ratio = in.readString();
this.ratio = in.readFloat();
this.percentDone = in.readInt();
this.status = in.readString();
}
Expand All @@ -45,7 +45,7 @@ public void writeToParcel(Parcel out, int flags) {
out.writeString(this.name);
out.writeLong(this.downSpeed);
out.writeLong(this.upSpeed);
out.writeString(this.ratio);
out.writeFloat(this.ratio);
out.writeInt(this.percentDone);
out.writeString(this.status);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
holder.textMessage.setVisibility(View.GONE);
holder.downHolder.setVisibility(View.GONE);
holder.upHolder.setVisibility(View.VISIBLE);
if (Float.valueOf(transfer.ratio) != 0) {
if (transfer.ratio != 0) {
holder.textRatio.setText(getContext().getString(R.string.ratio_is, transfer.ratio));
holder.ratioHolder.setVisibility(View.VISIBLE);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class PutioTransferData implements Parcelable {
public String estimatedTime;
public String createdTime;
public boolean extract;
public String currentRatio;
public float currentRatio;
public long downSpeed;
public long upSpeed;
public int percentDone;
Expand All @@ -36,7 +36,7 @@ private void readFromParcel(Parcel in) {
this.estimatedTime = in.readString();
this.createdTime = in.readString();
this.extract = (Boolean) in.readValue(ClassLoader.getSystemClassLoader());
this.currentRatio = in.readString();
this.currentRatio = in.readFloat();
this.downSpeed = in.readLong();
this.upSpeed = in.readLong();
this.percentDone = in.readInt();
Expand All @@ -54,7 +54,7 @@ public void writeToParcel(Parcel out, int flags) {
out.writeString(this.estimatedTime);
out.writeString(this.createdTime);
out.writeValue(this.extract);
out.writeString(this.currentRatio);
out.writeFloat(this.currentRatio);
out.writeLong(this.downSpeed);
out.writeLong(this.upSpeed);
out.writeInt(this.percentDone);
Expand Down

0 comments on commit 6f9d6dc

Please sign in to comment.