From 73944675faf7f1feb93571690dbf1c014f4b7718 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Sat, 27 May 2023 09:40:04 -0300 Subject: [PATCH] fix: fix compilation errors --- .../android/fragments/CustomLocalTimelineFragment.java | 5 +++++ .../android/ui/displayitems/FileStatusDisplayItem.java | 8 -------- .../android/ui/displayitems/StatusDisplayItem.java | 10 +++++----- .../displayitems/WarningFilteredStatusDisplayItem.java | 3 ++- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/CustomLocalTimelineFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/CustomLocalTimelineFragment.java index 3fa1dd8fb..2c98428bd 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/CustomLocalTimelineFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/CustomLocalTimelineFragment.java @@ -71,4 +71,9 @@ public class CustomLocalTimelineFragment extends StatusListFragment { if(!getArguments().getBoolean("noAutoLoad") && !loaded && !dataLoading) loadData(); } + + @Override + protected Filter.FilterContext getFilterContext() { + return null; + } } diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/FileStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/FileStatusDisplayItem.java index 9fa428f70..b8cc356c4 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/FileStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/FileStatusDisplayItem.java @@ -45,14 +45,6 @@ public class FileStatusDisplayItem extends StatusDisplayItem{ } @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) { Uri url = Uri.parse(getUrl()); title.setText(item.attachment.description != null diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java index b7e1de674..5ebb49209 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java @@ -185,11 +185,11 @@ public abstract class StatusDisplayItem{ statusForContent.mediaAttachments.stream() .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); 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)){ items.add(new LinkCardStatusDisplayItem(parentID, fragment, statusForContent)); @@ -222,11 +222,11 @@ public abstract class StatusDisplayItem{ return result; } - public static void buildPollItems(String parentID, BaseStatusListFragment fragment, Poll poll, List items){ + public static void buildPollItems(String parentID, BaseStatusListFragment fragment, Poll poll, List items, Status status){ 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{ diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/WarningFilteredStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/WarningFilteredStatusDisplayItem.java index 9c35fdd87..4f0ae55b3 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/WarningFilteredStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/WarningFilteredStatusDisplayItem.java @@ -16,6 +16,7 @@ import org.joinmastodon.android.model.Status; import org.joinmastodon.android.ui.drawables.SawtoothTearDrawable; import java.util.ArrayList; +import java.util.List; // Mind the gap! public class WarningFilteredStatusDisplayItem extends StatusDisplayItem{ @@ -40,7 +41,7 @@ public class WarningFilteredStatusDisplayItem extends StatusDisplayItem{ public final View warningWrap; public final Button showBtn; public final TextView text; - public ArrayList filteredItems; + public List filteredItems; public Holder(Context context, ViewGroup parent){ super(context, R.layout.display_item_warning, parent);