Merge branch 'master' into m3_redesign

# Conflicts:
#	mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HashtagStatusDisplayItem.java
This commit is contained in:
Grishka 2023-05-28 20:58:27 +03:00
commit 31c7116a15
2 changed files with 9 additions and 0 deletions

View File

@ -98,6 +98,12 @@ public class TrendingHashtagsFragment extends BaseRecyclerFragment<Hashtag> impl
@Override
public void onBind(Hashtag item){
title.setText('#'+item.name);
if (item.history == null || item.history.isEmpty()) {
subtitle.setText(null);
chart.setVisibility(View.GONE);
return;
}
chart.setVisibility(View.VISIBLE);
int numPeople=item.history.get(0).accounts;
if(item.history.size()>1)
numPeople+=item.history.get(1).accounts;

View File

@ -1,6 +1,7 @@
package org.joinmastodon.android.ui.displayitems;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
@ -43,8 +44,10 @@ public class HashtagStatusDisplayItem extends StatusDisplayItem{
numPeople+=item.history.get(1).accounts;
subtitle.setText(itemView.getResources().getQuantityString(R.plurals.x_people_talking, numPeople, numPeople));
chart.setData(item.history);
chart.setVisibility(View.VISIBLE);
}else{
subtitle.setText(itemView.getResources().getQuantityString(R.plurals.x_posts, item.statusesCount, item.statusesCount));
chart.setVisibility(View.GONE);
}
}
}