updates API

This commit is contained in:
tom79 2017-10-20 06:57:53 +02:00
parent abd399a2da
commit 6cdfcd49c1
2 changed files with 18 additions and 3 deletions

View File

@ -1500,6 +1500,21 @@ public class API {
} }
status.setTags(tags); status.setTags(tags);
//Retrieves emjis
List<Emojis> emojiList = new ArrayList<>();
JSONArray emojisTag = resobj.getJSONArray("emojis");
if( arrayTag != null){
for(int j = 0 ; j < emojisTag.length() ; j++){
JSONObject emojisObj = emojisTag.getJSONObject(j);
Emojis emojis = new Emojis();
emojis.setShortcode(emojisObj.get("shortcode").toString());
emojis.setStatic_url(emojisObj.get("static_url").toString());
emojis.setUrl(emojisObj.get("url").toString());
emojiList.add(emojis);
}
}
status.setEmojis(emojiList);
status.setAccount(parseAccountResponse(context, resobj.getJSONObject("account"))); status.setAccount(parseAccountResponse(context, resobj.getJSONObject("account")));
status.setContent(resobj.get("content").toString()); status.setContent(resobj.get("content").toString());
status.setFavourites_count(Integer.valueOf(resobj.get("favourites_count").toString())); status.setFavourites_count(Integer.valueOf(resobj.get("favourites_count").toString()));

View File

@ -51,7 +51,7 @@ public class Status implements Parcelable {
private ArrayList<Attachment> media_attachments; private ArrayList<Attachment> media_attachments;
private List<Status> replies; private List<Status> replies;
private List<Mention> mentions; private List<Mention> mentions;
private List<Tag> emojis; private List<Emojis> emojis;
private List<Tag> tags; private List<Tag> tags;
private Application application; private Application application;
private String language; private String language;
@ -381,11 +381,11 @@ public class Status implements Parcelable {
isVisible = visible; isVisible = visible;
} }
public List<Tag> getEmojis() { public List<Emojis> getEmojis() {
return emojis; return emojis;
} }
public void setEmojis(List<Tag> emojis) { public void setEmojis(List<Emojis> emojis) {
this.emojis = emojis; this.emojis = emojis;
} }
} }