Merge branch 'master' into m3_redesign
# Conflicts: # mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HashtagStatusDisplayItem.java
This commit is contained in:
commit
31c7116a15
|
@ -98,6 +98,12 @@ public class TrendingHashtagsFragment extends BaseRecyclerFragment<Hashtag> impl
|
||||||
@Override
|
@Override
|
||||||
public void onBind(Hashtag item){
|
public void onBind(Hashtag item){
|
||||||
title.setText('#'+item.name);
|
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;
|
int numPeople=item.history.get(0).accounts;
|
||||||
if(item.history.size()>1)
|
if(item.history.size()>1)
|
||||||
numPeople+=item.history.get(1).accounts;
|
numPeople+=item.history.get(1).accounts;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.joinmastodon.android.ui.displayitems;
|
package org.joinmastodon.android.ui.displayitems;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
@ -43,8 +44,10 @@ public class HashtagStatusDisplayItem extends StatusDisplayItem{
|
||||||
numPeople+=item.history.get(1).accounts;
|
numPeople+=item.history.get(1).accounts;
|
||||||
subtitle.setText(itemView.getResources().getQuantityString(R.plurals.x_people_talking, numPeople, numPeople));
|
subtitle.setText(itemView.getResources().getQuantityString(R.plurals.x_people_talking, numPeople, numPeople));
|
||||||
chart.setData(item.history);
|
chart.setData(item.history);
|
||||||
|
chart.setVisibility(View.VISIBLE);
|
||||||
}else{
|
}else{
|
||||||
subtitle.setText(itemView.getResources().getQuantityString(R.plurals.x_posts, item.statusesCount, item.statusesCount));
|
subtitle.setText(itemView.getResources().getQuantityString(R.plurals.x_posts, item.statusesCount, item.statusesCount));
|
||||||
|
chart.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue