Skip to content

Commit

Permalink
Merge pull request nickbutcher#35 from nickbutcher/dn_story
Browse files Browse the repository at this point in the history
Improved Designer News experience.
  • Loading branch information
nickbutcher committed Nov 9, 2015
2 parents 126aff3 + 17f12ce commit 4261b3e
Show file tree
Hide file tree
Showing 27 changed files with 770 additions and 187 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
import java.util.Map;

import io.plaidapp.data.api.designernews.model.AccessToken;
import io.plaidapp.data.api.designernews.model.Comment;
import io.plaidapp.data.api.designernews.model.NewStoryRequest;
import io.plaidapp.data.api.designernews.model.StoriesResponse;
import io.plaidapp.data.api.designernews.model.Story;
import io.plaidapp.data.api.designernews.model.StoryResponse;
import io.plaidapp.data.api.designernews.model.UserResponse;
import retrofit.Callback;
import retrofit.http.Body;
import retrofit.http.Field;
import retrofit.http.FieldMap;
import retrofit.http.FormUrlEncoded;
import retrofit.http.GET;
Expand Down Expand Up @@ -77,4 +78,10 @@ void upvoteStory(@Path("id") long storyId,
void postStory(@Body NewStoryRequest story,
Callback<StoriesResponse> callback);

@FormUrlEncoded
@POST("/api/v1/stories/{id}/reply")
void comment(@Path("id") long storyId,
@Field("comment[body]") String comment,
Callback<Comment> callback);

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@
*/
public class Comment implements Parcelable {

@SuppressWarnings("unused")
public static final Parcelable.Creator<Comment> CREATOR = new Parcelable.Creator<Comment>() {
@Override
public Comment createFromParcel(Parcel in) {
return new Comment(in);
}

@Override
public Comment[] newArray(int size) {
return new Comment[size];
}
};
public final long id;
public final String body;
public final String body_html;
Expand Down Expand Up @@ -120,4 +108,18 @@ public void writeToParcel(Parcel dest, int flags) {
dest.writeList(comments);
}
}

@SuppressWarnings("unused")
public static final Parcelable.Creator<Comment> CREATOR = new Parcelable.Creator<Comment>() {
@Override
public Comment createFromParcel(Parcel in) {
return new Comment(in);
}

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

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,6 @@
*/
public class Story extends PlaidItem implements Parcelable {

@SuppressWarnings("unused")
public static final Parcelable.Creator<Story> CREATOR = new Parcelable.Creator<Story>() {
@Override
public Story createFromParcel(Parcel in) {
return new Story(in);
}

@Override
public Story[] newArray(int size) {
return new Story[size];
}
};
public final String comment;
public final String comment_html;
public final int comment_count;
Expand Down Expand Up @@ -141,4 +129,18 @@ public void writeToParcel(Parcel dest, int flags) {
dest.writeList(comments);
}
}

@SuppressWarnings("unused")
public static final Parcelable.Creator<Story> CREATOR = new Parcelable.Creator<Story>() {
@Override
public Story createFromParcel(Parcel in) {
return new Story(in);
}

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

}
Loading

0 comments on commit 4261b3e

Please sign in to comment.