|
public void publishTweet(String tweetContent, JsonHttpResponseHandler handler) { |
|
String apiUrl = getApiUrl("statuses/update.json"); |
|
// Can specify query string params directly or through RequestParams. |
|
RequestParams params = new RequestParams(); |
|
params.put("status", tweetContent); |
|
client.post(apiUrl, params, "", handler); |
|
} |
|
|
|
public void favoriteTweet(String tweetId, JsonHttpResponseHandler handler) { |
|
String apiUrl = getApiUrl("favorites/create.json"); |
|
// Can specify query string params directly or through RequestParams. |
|
RequestParams params = new RequestParams(); |
|
params.put("id", tweetId); |
|
client.post(apiUrl, params, "", handler); |
|
} |
|
|
|
public void unfavoriteTweet(String tweetId, JsonHttpResponseHandler handler) { |
|
String apiUrl = getApiUrl("favorites/destroy.json"); |
|
// Can specify query string params directly or through RequestParams. |
|
RequestParams params = new RequestParams(); |
|
params.put("id", tweetId); |
|
client.post(apiUrl, params, "", handler); |
|
} |
|
|
|
public void retweetTweet(String tweetId, JsonHttpResponseHandler handler) { |
|
String apiUrl = getApiUrl("statuses/retweet/" + tweetId + ".json"); |
|
// Can specify query string params directly or through RequestParams. |
|
RequestParams params = new RequestParams(); |
|
params.put("id", tweetId); |
|
client.post(apiUrl, params, "", handler); |
|
} |
|
|
|
public void unretweetTweet(String tweetId, JsonHttpResponseHandler handler) { |
|
String apiUrl = getApiUrl("statuses/unretweet/" + tweetId + ".json"); |
|
// Can specify query string params directly or through RequestParams. |
|
RequestParams params = new RequestParams(); |
|
params.put("id", tweetId); |
|
client.post(apiUrl, params, "", handler); |
|
} |
These methods are pretty identical, can move to a helper function that takes the URI as a param
Jitterr/app/src/main/java/com/codepath/apps/restclienttemplate/JitterClient.java
Lines 61 to 99 in 5c9a4c9
It's great to have a lot of comments for ambiguous parts of code. For clear descriptive lines, feel free to remove comment:
Jitterr/app/src/main/java/com/codepath/apps/restclienttemplate/TweetAdapter.java
Lines 156 to 157 in 5c9a4c9
Jitterr/app/src/main/java/com/codepath/apps/restclienttemplate/TweetAdapter.java
Line 173 in 5c9a4c9
Feel free to remove debugging logs. Or if it's important signal log, maybe remove "hopefully" =) . I explained about logs this week after you already committed this code, so no worries.
Jitterr/app/src/main/java/com/codepath/apps/restclienttemplate/TweetAdapter.java
Line 162 in 5c9a4c9
Great job providing descriptive commit names! Instead of listing "Finished required features and the following stretch features:... ", better to just name the feature you are adding, for readability.