-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix checkbox type value formatting (#238)
We should be expecting an array of JSON objects, with `label` and `value` in each object.
- Loading branch information
Showing
34 changed files
with
303 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,11 +77,6 @@ afterEvaluate { | |
name = 'Zhe Lu' | ||
email = '[email protected]' | ||
} | ||
developer { | ||
id = 'priyaashah' | ||
name = 'Priya Shah' | ||
email = '[email protected]' | ||
} | ||
} | ||
scm { | ||
connection = gitUrl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.ifttt.connect.api" /> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" /> |
58 changes: 58 additions & 0 deletions
58
connect-api/src/main/java/com/ifttt/connect/api/CheckBoxFieldValue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package com.ifttt.connect.api; | ||
|
||
import android.os.Parcel; | ||
import android.os.Parcelable; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
/** | ||
* Data structure representing the checkbox field values. | ||
*/ | ||
public final class CheckBoxFieldValue implements Parcelable { | ||
|
||
public final List<CheckBoxValue> value; | ||
|
||
public CheckBoxFieldValue(List<CheckBoxValue> value) { | ||
this.value = value; | ||
} | ||
|
||
protected CheckBoxFieldValue(Parcel in) { | ||
value = in.createTypedArrayList(CheckBoxValue.CREATOR); | ||
} | ||
|
||
public static final Creator<CheckBoxFieldValue> CREATOR = new Creator<CheckBoxFieldValue>() { | ||
@Override | ||
public CheckBoxFieldValue createFromParcel(Parcel in) { | ||
return new CheckBoxFieldValue(in); | ||
} | ||
|
||
@Override | ||
public CheckBoxFieldValue[] newArray(int size) { | ||
return new CheckBoxFieldValue[size]; | ||
} | ||
}; | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
CheckBoxFieldValue that = (CheckBoxFieldValue) o; | ||
return Objects.equals(value, that.value); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(value); | ||
} | ||
|
||
@Override | ||
public int describeContents() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void writeToParcel(Parcel dest, int flags) { | ||
dest.writeTypedList(value); | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
connect-api/src/main/java/com/ifttt/connect/api/CheckBoxValue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.ifttt.connect.api; | ||
|
||
import android.os.Parcel; | ||
import android.os.Parcelable; | ||
|
||
import java.util.Objects; | ||
|
||
public final class CheckBoxValue implements Parcelable { | ||
public final String label; | ||
public final String value; | ||
|
||
public CheckBoxValue(String label, String value) { | ||
this.label = label; | ||
this.value = value; | ||
} | ||
|
||
protected CheckBoxValue(Parcel in) { | ||
label = in.readString(); | ||
value = in.readString(); | ||
} | ||
|
||
public static final Creator<CheckBoxValue> CREATOR = new Creator<CheckBoxValue>() { | ||
@Override | ||
public CheckBoxValue createFromParcel(Parcel in) { | ||
return new CheckBoxValue(in); | ||
} | ||
|
||
@Override | ||
public CheckBoxValue[] newArray(int size) { | ||
return new CheckBoxValue[size]; | ||
} | ||
}; | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
CheckBoxValue that = (CheckBoxValue) o; | ||
return Objects.equals(label, that.label) && Objects.equals(value, that.value); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(label, value); | ||
} | ||
|
||
@Override | ||
public int describeContents() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void writeToParcel(Parcel dest, int flags) { | ||
dest.writeString(label); | ||
dest.writeString(value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 0 additions & 42 deletions
42
connect-api/src/main/java/com/ifttt/connect/api/StringArrayFieldValue.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
connect-api/src/test/java/com/ifttt/connect/api/ConnectionApiClientTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.