fix: fix compilation errors

This commit is contained in:
LucasGGamerM 2023-05-27 09:40:04 -03:00
parent c6ded3d505
commit 73944675fa
4 changed files with 12 additions and 14 deletions

View File

@ -71,4 +71,9 @@ public class CustomLocalTimelineFragment extends StatusListFragment {
if(!getArguments().getBoolean("noAutoLoad") && !loaded && !dataLoading) if(!getArguments().getBoolean("noAutoLoad") && !loaded && !dataLoading)
loadData(); loadData();
} }
@Override
protected Filter.FilterContext getFilterContext() {
return null;
}
} }

View File

@ -45,14 +45,6 @@ public class FileStatusDisplayItem extends StatusDisplayItem{
} }
@Override @Override
public void onBind(FileStatusDisplayItem item){
title.setText(item.attachment.description == null ? title.getContext().getText(R.string.media_no_description) : item.attachment.description);
domain.setText(Uri.parse(item.attachment.remoteUrl == null ? item.attachment.url : item.attachment.remoteUrl).getHost());
}
private void onClick(View v){
UiUtils.openURL(itemView.getContext(), item.parentFragment.getAccountID(), item.attachment.remoteUrl == null ? item.attachment.url : item.attachment.remoteUrl);
public void onBind(FileStatusDisplayItem item) { public void onBind(FileStatusDisplayItem item) {
Uri url = Uri.parse(getUrl()); Uri url = Uri.parse(getUrl());
title.setText(item.attachment.description != null title.setText(item.attachment.description != null

View File

@ -185,11 +185,11 @@ public abstract class StatusDisplayItem{
statusForContent.mediaAttachments.stream() statusForContent.mediaAttachments.stream()
.filter(att->att.type.equals(Attachment.Type.UNKNOWN)) .filter(att->att.type.equals(Attachment.Type.UNKNOWN))
.map(att -> new FileStatusDisplayItem(parentID, fragment, att)) .map(att -> new FileStatusDisplayItem(parentID, fragment, att, statusForContent))
.forEach(items::add); .forEach(items::add);
if(statusForContent.poll!=null){ if(statusForContent.poll!=null){
buildPollItems(parentID, fragment, statusForContent.poll, items); buildPollItems(parentID, fragment, statusForContent.poll, items, statusForContent);
} }
if(statusForContent.card!=null && statusForContent.mediaAttachments.isEmpty() && TextUtils.isEmpty(statusForContent.spoilerText)){ if(statusForContent.card!=null && statusForContent.mediaAttachments.isEmpty() && TextUtils.isEmpty(statusForContent.spoilerText)){
items.add(new LinkCardStatusDisplayItem(parentID, fragment, statusForContent)); items.add(new LinkCardStatusDisplayItem(parentID, fragment, statusForContent));
@ -222,11 +222,11 @@ public abstract class StatusDisplayItem{
return result; return result;
} }
public static void buildPollItems(String parentID, BaseStatusListFragment fragment, Poll poll, List<StatusDisplayItem> items){ public static void buildPollItems(String parentID, BaseStatusListFragment fragment, Poll poll, List<StatusDisplayItem> items, Status status){
for(Poll.Option opt:poll.options){ for(Poll.Option opt:poll.options){
items.add(new PollOptionStatusDisplayItem(parentID, poll, opt, fragment)); items.add(new PollOptionStatusDisplayItem(parentID, poll, opt, fragment, status));
} }
items.add(new PollFooterStatusDisplayItem(parentID, fragment, poll)); items.add(new PollFooterStatusDisplayItem(parentID, fragment, poll, status));
} }
public enum Type{ public enum Type{

View File

@ -16,6 +16,7 @@ import org.joinmastodon.android.model.Status;
import org.joinmastodon.android.ui.drawables.SawtoothTearDrawable; import org.joinmastodon.android.ui.drawables.SawtoothTearDrawable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
// Mind the gap! // Mind the gap!
public class WarningFilteredStatusDisplayItem extends StatusDisplayItem{ public class WarningFilteredStatusDisplayItem extends StatusDisplayItem{
@ -40,7 +41,7 @@ public class WarningFilteredStatusDisplayItem extends StatusDisplayItem{
public final View warningWrap; public final View warningWrap;
public final Button showBtn; public final Button showBtn;
public final TextView text; public final TextView text;
public ArrayList<StatusDisplayItem> filteredItems; public List<StatusDisplayItem> filteredItems;
public Holder(Context context, ViewGroup parent){ public Holder(Context context, ViewGroup parent){
super(context, R.layout.display_item_warning, parent); super(context, R.layout.display_item_warning, parent);