fix hashtag search crash on akkoma servers
closes mastodon#468 closes sk22#523
This commit is contained in:
parent
285eb25706
commit
8053e8bb05
|
@ -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;
|
||||||
|
|
||||||
|
@ -37,6 +38,12 @@ public class HashtagStatusDisplayItem extends StatusDisplayItem{
|
||||||
public void onBind(HashtagStatusDisplayItem _item){
|
public void onBind(HashtagStatusDisplayItem _item){
|
||||||
Hashtag item=_item.tag;
|
Hashtag item=_item.tag;
|
||||||
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;
|
||||||
|
|
Loading…
Reference in New Issue