Fix an issue
This commit is contained in:
parent
f716688a8d
commit
381bab2028
|
@ -2545,7 +2545,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
||||||
TextView actionView = item.getActionView().findViewById(R.id.counter);
|
TextView actionView = item.getActionView().findViewById(R.id.counter);
|
||||||
if(actionView != null) {
|
if(actionView != null) {
|
||||||
if (unread > 0) {
|
if (unread > 0) {
|
||||||
actionView.setText(unread);
|
actionView.setText(String.valueOf(unread));
|
||||||
actionView.setVisibility(View.VISIBLE);
|
actionView.setVisibility(View.VISIBLE);
|
||||||
}else{
|
}else{
|
||||||
actionView.setVisibility(View.GONE);
|
actionView.setVisibility(View.GONE);
|
||||||
|
|
|
@ -620,22 +620,13 @@ public class API {
|
||||||
if( resobj.getString("ends_at").compareTo("null") != 0) {
|
if( resobj.getString("ends_at").compareTo("null") != 0) {
|
||||||
announcement.setEndAt(Helper.mstStringToDate(context, resobj.getString("ends_at")));
|
announcement.setEndAt(Helper.mstStringToDate(context, resobj.getString("ends_at")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
announcement.setRead(resobj.getBoolean("read"));
|
announcement.setRead(resobj.getBoolean("read"));
|
||||||
|
|
||||||
announcement.setReactions(parseReaction(resobj.getJSONArray("reactions")));
|
announcement.setReactions(parseReaction(resobj.getJSONArray("reactions")));
|
||||||
|
|
||||||
List<Mention> mentions = new ArrayList<>();
|
|
||||||
JSONArray arrayMention = resobj.getJSONArray("mentions");
|
|
||||||
for (int j = 0; j < arrayMention.length(); j++) {
|
|
||||||
JSONObject menObj = arrayMention.getJSONObject(j);
|
|
||||||
Mention mention = new Mention();
|
|
||||||
mention.setId(menObj.get("id").toString());
|
|
||||||
mention.setUrl(menObj.get("url").toString());
|
|
||||||
mention.setAcct(menObj.get("acct").toString());
|
|
||||||
mention.setUsername(menObj.get("username").toString());
|
|
||||||
mentions.add(mention);
|
|
||||||
}
|
|
||||||
announcement.setMentions(mentions);
|
|
||||||
|
|
||||||
List<Tag> tags = new ArrayList<>();
|
List<Tag> tags = new ArrayList<>();
|
||||||
JSONArray arrayTag = resobj.getJSONArray("tags");
|
JSONArray arrayTag = resobj.getJSONArray("tags");
|
||||||
|
@ -661,6 +652,23 @@ public class API {
|
||||||
announcement.setEmojis(new ArrayList<>());
|
announcement.setEmojis(new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Mention> mentions = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
JSONArray arrayMention = resobj.getJSONArray("mentions");
|
||||||
|
for (int j = 0; j < arrayMention.length(); j++) {
|
||||||
|
JSONObject menObj = arrayMention.getJSONObject(j);
|
||||||
|
Mention mention = new Mention();
|
||||||
|
mention.setId(menObj.get("id").toString());
|
||||||
|
mention.setUrl(menObj.get("url").toString());
|
||||||
|
mention.setAcct(menObj.get("acct").toString());
|
||||||
|
mention.setUsername(menObj.get("username").toString());
|
||||||
|
mentions.add(mention);
|
||||||
|
}
|
||||||
|
announcement.setMentions(mentions);
|
||||||
|
} catch (Exception e) {
|
||||||
|
announcement.setMentions(new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
} catch (JSONException | ParseException e) {
|
} catch (JSONException | ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1692,6 +1692,9 @@ public class Helper {
|
||||||
MenuItem nav_trends = menu.findItem(R.id.nav_trends);
|
MenuItem nav_trends = menu.findItem(R.id.nav_trends);
|
||||||
if (nav_trends != null)
|
if (nav_trends != null)
|
||||||
nav_trends.setVisible(false);
|
nav_trends.setVisible(false);
|
||||||
|
MenuItem nav_announcements = menu.findItem(R.id.nav_announcements);
|
||||||
|
if (nav_announcements != null)
|
||||||
|
nav_announcements.setVisible(false);
|
||||||
MenuItem nav_peertube = menu.findItem(R.id.nav_peertube);
|
MenuItem nav_peertube = menu.findItem(R.id.nav_peertube);
|
||||||
if (nav_peertube != null)
|
if (nav_peertube != null)
|
||||||
nav_peertube.setVisible(false);
|
nav_peertube.setVisible(false);
|
||||||
|
|
Loading…
Reference in New Issue