Skip to content

Commit

Permalink
resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrique committed Nov 26, 2014
2 parents 1392fef + 7f2d6ec commit 5fd58f1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
39 changes: 37 additions & 2 deletions src/main/java/com/inaka/galgo/GalgoOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
*/
package com.inaka.galgo;

import java.io.Serializable;
import android.os.Parcel;
import android.os.Parcelable;

public final class GalgoOptions implements Serializable {
public final class GalgoOptions implements Parcelable {

public final int numberOfLines;
public final int backgroundColor;
Expand Down Expand Up @@ -102,4 +103,38 @@ private static void ensurePositiveInt(int value, String msg) {
throw new IllegalArgumentException(msg);
}
}

// Parcelable implementation
private GalgoOptions(Parcel source) {
numberOfLines = source.readInt();
backgroundColor = source.readInt();
textColor = source.readInt();
textSize = source.readInt();
}

public static final Creator<GalgoOptions> CREATOR = new Creator<GalgoOptions>() {
@Override
public GalgoOptions createFromParcel(Parcel source) {
return new GalgoOptions(source);
}

@Override
public GalgoOptions[] newArray(int size) {
return new GalgoOptions[size];
}
};

@Override
public int describeContents() {
return 0; // No special content.
}

@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(numberOfLines);
dest.writeInt(backgroundColor);
dest.writeInt(textColor);
dest.writeInt(textSize);
}

}
2 changes: 1 addition & 1 deletion src/main/java/com/inaka/galgo/GalgoService.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public GalgoService getService() {

@Override
public IBinder onBind(Intent intent) {
this.mOptions = (GalgoOptions) intent.getExtras().get(Galgo.ARG_OPTIONS);
this.mOptions = intent.getExtras().getParcelable(Galgo.ARG_OPTIONS);
return mBinder;
}

Expand Down

0 comments on commit 5fd58f1

Please sign in to comment.