From 06c46719cd322447c348bc17636ab8aff6ec6189 Mon Sep 17 00:00:00 2001 From: sk Date: Mon, 27 Nov 2023 22:46:29 +0100 Subject: [PATCH] merge: rename ListTimeline to FollowList --- .../api/requests/lists/CreateList.java | 10 ++--- .../api/requests/lists/DeleteList.java | 1 - .../android/api/requests/lists/GetList.java | 6 +-- .../android/api/requests/lists/GetLists.java | 15 +++---- .../api/requests/lists/UpdateList.java | 8 ++-- .../events/ListUpdatedCreatedEvent.java | 6 +-- .../fragments/EditTimelinesFragment.java | 10 ++--- .../android/fragments/HomeTabFragment.java | 10 ++--- .../fragments/ListTimelineFragment.java | 16 +++---- .../android/fragments/ListsFragment.java | 24 +++++------ .../android/model/FollowList.java | 43 +++++++++++++++++++ .../android/model/ListTimeline.java | 38 ---------------- .../android/model/TimelineDefinition.java | 2 +- .../android/ui/views/ListEditor.java | 18 ++++---- 14 files changed, 104 insertions(+), 103 deletions(-) create mode 100644 mastodon/src/main/java/org/joinmastodon/android/model/FollowList.java delete mode 100644 mastodon/src/main/java/org/joinmastodon/android/model/ListTimeline.java diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/CreateList.java b/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/CreateList.java index 1ec4204e5d..add21e6711 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/CreateList.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/CreateList.java @@ -1,11 +1,11 @@ package org.joinmastodon.android.api.requests.lists; import org.joinmastodon.android.api.MastodonAPIRequest; -import org.joinmastodon.android.model.ListTimeline; +import org.joinmastodon.android.model.FollowList; -public class CreateList extends MastodonAPIRequest { - public CreateList(String title, boolean exclusive, ListTimeline.RepliesPolicy repliesPolicy) { - super(HttpMethod.POST, "/lists", ListTimeline.class); +public class CreateList extends MastodonAPIRequest { + public CreateList(String title, boolean exclusive, FollowList.RepliesPolicy repliesPolicy) { + super(HttpMethod.POST, "/lists", FollowList.class); Request req = new Request(); req.title = title; req.exclusive = exclusive; @@ -16,6 +16,6 @@ public CreateList(String title, boolean exclusive, ListTimeline.RepliesPolicy re public static class Request { public String title; public boolean exclusive; - public ListTimeline.RepliesPolicy repliesPolicy; + public FollowList.RepliesPolicy repliesPolicy; } } diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/DeleteList.java b/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/DeleteList.java index 64620adac8..925ed2bcfa 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/DeleteList.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/DeleteList.java @@ -1,7 +1,6 @@ package org.joinmastodon.android.api.requests.lists; import org.joinmastodon.android.api.MastodonAPIRequest; -import org.joinmastodon.android.model.ListTimeline; public class DeleteList extends MastodonAPIRequest { public DeleteList(String id) { diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/GetList.java b/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/GetList.java index 19bda79ca7..340af55232 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/GetList.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/GetList.java @@ -1,10 +1,10 @@ package org.joinmastodon.android.api.requests.lists; import org.joinmastodon.android.api.MastodonAPIRequest; -import org.joinmastodon.android.model.ListTimeline; +import org.joinmastodon.android.model.FollowList; -public class GetList extends MastodonAPIRequest { +public class GetList extends MastodonAPIRequest { public GetList(String id) { - super(HttpMethod.GET, "/lists/" + id, ListTimeline.class); + super(HttpMethod.GET, "/lists/" + id, FollowList.class); } } diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/GetLists.java b/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/GetLists.java index 61abeb03a4..eed62b0d56 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/GetLists.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/GetLists.java @@ -3,15 +3,12 @@ import com.google.gson.reflect.TypeToken; import org.joinmastodon.android.api.MastodonAPIRequest; -import org.joinmastodon.android.model.ListTimeline; +import org.joinmastodon.android.model.FollowList; import java.util.List; -public class GetLists extends MastodonAPIRequest>{ - public GetLists() { - super(HttpMethod.GET, "/lists", new TypeToken<>(){}); - } - public GetLists(String accountID) { - super(HttpMethod.GET, "/accounts/"+accountID+"/lists", new TypeToken<>(){}); - } -} +public class GetLists extends MastodonAPIRequest>{ + public GetLists(){ + super(HttpMethod.GET, "/lists", new TypeToken<>(){}); + } +} \ No newline at end of file diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/UpdateList.java b/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/UpdateList.java index 64073fd3d8..e37a5a2353 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/UpdateList.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/requests/lists/UpdateList.java @@ -1,11 +1,11 @@ package org.joinmastodon.android.api.requests.lists; import org.joinmastodon.android.api.MastodonAPIRequest; -import org.joinmastodon.android.model.ListTimeline; +import org.joinmastodon.android.model.FollowList; -public class UpdateList extends MastodonAPIRequest { - public UpdateList(String id, String title, boolean exclusive, ListTimeline.RepliesPolicy repliesPolicy) { - super(HttpMethod.PUT, "/lists/" + id, ListTimeline.class); +public class UpdateList extends MastodonAPIRequest { + public UpdateList(String id, String title, boolean exclusive, FollowList.RepliesPolicy repliesPolicy) { + super(HttpMethod.PUT, "/lists/" + id, FollowList.class); CreateList.Request req = new CreateList.Request(); req.title = title; req.exclusive = exclusive; diff --git a/mastodon/src/main/java/org/joinmastodon/android/events/ListUpdatedCreatedEvent.java b/mastodon/src/main/java/org/joinmastodon/android/events/ListUpdatedCreatedEvent.java index 26e0081e6b..919a2950a0 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/events/ListUpdatedCreatedEvent.java +++ b/mastodon/src/main/java/org/joinmastodon/android/events/ListUpdatedCreatedEvent.java @@ -1,14 +1,14 @@ package org.joinmastodon.android.events; -import org.joinmastodon.android.model.ListTimeline; +import org.joinmastodon.android.model.FollowList; public class ListUpdatedCreatedEvent { public final String id; public final String title; - public final ListTimeline.RepliesPolicy repliesPolicy; + public final FollowList.RepliesPolicy repliesPolicy; public final boolean exclusive; - public ListUpdatedCreatedEvent(String id, String title, boolean exclusive, ListTimeline.RepliesPolicy repliesPolicy) { + public ListUpdatedCreatedEvent(String id, String title, boolean exclusive, FollowList.RepliesPolicy repliesPolicy) { this.id = id; this.title = title; this.exclusive = exclusive; diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/EditTimelinesFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/EditTimelinesFragment.java index 53894974ba..0a10ef03c3 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/EditTimelinesFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/EditTimelinesFragment.java @@ -39,9 +39,9 @@ import org.joinmastodon.android.api.requests.tags.GetFollowedHashtags; import org.joinmastodon.android.api.session.AccountLocalPreferences; import org.joinmastodon.android.api.session.AccountSessionManager; +import org.joinmastodon.android.model.FollowList; import org.joinmastodon.android.model.Hashtag; import org.joinmastodon.android.model.HeaderPaginationList; -import org.joinmastodon.android.model.ListTimeline; import org.joinmastodon.android.model.TimelineDefinition; import org.joinmastodon.android.ui.DividerItemDecoration; import org.joinmastodon.android.ui.M3AlertDialogBuilder; @@ -67,7 +67,7 @@ public class EditTimelinesFragment extends MastodonRecyclerFragment timelineByMenuItem=new HashMap<>(); - private final List listTimelines=new ArrayList<>(); + private final List followLists =new ArrayList<>(); private final List hashtags=new ArrayList<>(); private MenuItem addHashtagItem; @@ -86,8 +86,8 @@ public void onCreate(Bundle savedInstanceState){ new GetLists().setCallback(new Callback<>(){ @Override - public void onSuccess(List result){ - listTimelines.addAll(result); + public void onSuccess(List result){ + followLists.addAll(result); updateOptionsMenu(); } @@ -189,7 +189,7 @@ private void updateOptionsMenu(){ makeBackItem(hashtagsMenu); TimelineDefinition.getAllTimelines(accountID).stream().forEach(tl->addTimelineToOptions(tl, timelinesMenu)); - listTimelines.stream().map(TimelineDefinition::ofList).forEach(tl->addTimelineToOptions(tl, listsMenu)); + followLists.stream().map(TimelineDefinition::ofList).forEach(tl->addTimelineToOptions(tl, listsMenu)); addHashtagItem=addOptionsItem(hashtagsMenu, getContext().getString(R.string.sk_timelines_add), R.drawable.ic_fluent_add_24_regular); hashtags.stream().map(TimelineDefinition::ofHashtag).forEach(tl->addTimelineToOptions(tl, hashtagsMenu)); diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTabFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTabFragment.java index 85a79b7edb..6911c09460 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTabFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTabFragment.java @@ -51,9 +51,9 @@ import org.joinmastodon.android.events.SelfUpdateStateChangedEvent; import org.joinmastodon.android.fragments.settings.SettingsMainFragment; import org.joinmastodon.android.model.Announcement; +import org.joinmastodon.android.model.FollowList; import org.joinmastodon.android.model.Hashtag; import org.joinmastodon.android.model.HeaderPaginationList; -import org.joinmastodon.android.model.ListTimeline; import org.joinmastodon.android.model.TimelineDefinition; import org.joinmastodon.android.ui.SimpleViewHolder; import org.joinmastodon.android.ui.utils.UiUtils; @@ -95,7 +95,7 @@ public class HomeTabFragment extends MastodonToolbarFragment implements Scrollab private ImageView collapsedChevron; private TextView timelineTitle; private PopupMenu switcherPopup; - private final Map listItems = new HashMap<>(); + private final Map listItems = new HashMap<>(); private final Map hashtagsItems = new HashMap<>(); private List timelinesList; private int count; @@ -266,7 +266,7 @@ public void onPageSelected(int position){ new GetLists().setCallback(new Callback<>() { @Override - public void onSuccess(List lists) { + public void onSuccess(List lists) { updateList(lists, listItems); } @@ -508,7 +508,7 @@ public boolean onOptionsItemSelected(MenuItem item){ Bundle args=new Bundle(); args.putString("account", accountID); int id = item.getItemId(); - ListTimeline list; + FollowList list; Hashtag hashtag; if (item.getItemId() == R.id.menu_back) { @@ -697,7 +697,7 @@ public void onListDeletedEvent(ListDeletedEvent event) { @Subscribe public void onListUpdatedCreatedEvent(ListUpdatedCreatedEvent event) { handleListEvent(listItems, l -> l.id.equals(event.id), true, () -> { - ListTimeline list = new ListTimeline(); + FollowList list = new FollowList(); list.id = event.id; list.title = event.title; list.repliesPolicy = event.repliesPolicy; diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ListTimelineFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ListTimelineFragment.java index fb357d9911..b8ec041d3f 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ListTimelineFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ListTimelineFragment.java @@ -20,7 +20,7 @@ import org.joinmastodon.android.events.ListDeletedEvent; import org.joinmastodon.android.events.ListUpdatedCreatedEvent; import org.joinmastodon.android.model.FilterContext; -import org.joinmastodon.android.model.ListTimeline; +import org.joinmastodon.android.model.FollowList; import org.joinmastodon.android.model.Status; import org.joinmastodon.android.model.TimelineDefinition; import org.joinmastodon.android.ui.M3AlertDialogBuilder; @@ -39,7 +39,7 @@ public class ListTimelineFragment extends PinnableStatusListFragment { private String listID; private String listTitle; @Nullable - private ListTimeline.RepliesPolicy repliesPolicy; + private FollowList.RepliesPolicy repliesPolicy; private boolean exclusive; @Override @@ -54,19 +54,19 @@ public void onAttach(Activity activity){ listID = args.getString("listID"); listTitle = args.getString("listTitle"); exclusive = args.getBoolean("listIsExclusive"); - repliesPolicy = ListTimeline.RepliesPolicy.values()[args.getInt("repliesPolicy", 0)]; + repliesPolicy = FollowList.RepliesPolicy.values()[args.getInt("repliesPolicy", 0)]; setTitle(listTitle); setHasOptionsMenu(true); new GetList(listID).setCallback(new Callback<>() { @Override - public void onSuccess(ListTimeline listTimeline) { + public void onSuccess(FollowList followList) { if(getActivity()==null) return; // TODO: save updated info - if (!listTimeline.title.equals(listTitle)) setTitle(listTimeline.title); - if (listTimeline.repliesPolicy != null && !listTimeline.repliesPolicy.equals(repliesPolicy)) { - repliesPolicy = listTimeline.repliesPolicy; + if (!followList.title.equals(listTitle)) setTitle(followList.title); + if (followList.repliesPolicy != null && !followList.repliesPolicy.equals(repliesPolicy)) { + repliesPolicy = followList.repliesPolicy; } } @@ -99,7 +99,7 @@ public boolean onOptionsItemSelected(MenuItem item) { setTitle(newTitle); new UpdateList(listID, newTitle, editor.isExclusive(), editor.getRepliesPolicy()).setCallback(new Callback<>() { @Override - public void onSuccess(ListTimeline list) { + public void onSuccess(FollowList list) { if(getActivity()==null) return; setTitle(list.title); listTitle = list.title; diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ListsFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ListsFragment.java index 8e92bb5ea0..df33ffc34d 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ListsFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ListsFragment.java @@ -24,7 +24,7 @@ import org.joinmastodon.android.api.requests.lists.RemoveAccountsFromList; import org.joinmastodon.android.events.ListDeletedEvent; import org.joinmastodon.android.events.ListUpdatedCreatedEvent; -import org.joinmastodon.android.model.ListTimeline; +import org.joinmastodon.android.model.FollowList; import org.joinmastodon.android.ui.DividerItemDecoration; import org.joinmastodon.android.ui.M3AlertDialogBuilder; import org.joinmastodon.android.ui.views.ListEditor; @@ -42,7 +42,7 @@ import me.grishka.appkit.utils.BindableViewHolder; import me.grishka.appkit.views.UsableRecyclerView; -public class ListsFragment extends MastodonRecyclerFragment implements ScrollableToTop, ProvidesAssistContent.ProvidesWebUri { +public class ListsFragment extends MastodonRecyclerFragment implements ScrollableToTop, ProvidesAssistContent.ProvidesWebUri { private String accountID; private String profileAccountId; private final HashMap userInListBefore = new HashMap<>(); @@ -99,7 +99,7 @@ public boolean onOptionsItemSelected(MenuItem item) { .setPositiveButton(R.string.sk_create, (d, which) -> new CreateList(editor.getTitle(), editor.isExclusive(), editor.getRepliesPolicy()).setCallback(new Callback<>() { @Override - public void onSuccess(ListTimeline list) { + public void onSuccess(FollowList list) { data.add(0, list); adapter.notifyItemRangeInserted(0, 1); E.post(new ListUpdatedCreatedEvent(list.id, list.title, list.exclusive, list.repliesPolicy)); @@ -139,19 +139,19 @@ protected void doLoadData(int offset, int count){ currentRequest=(profileAccountId != null ? new GetLists(profileAccountId) : new GetLists()) .setCallback(new SimpleCallback<>(this) { @Override - public void onSuccess(List lists) { + public void onSuccess(List lists) { if(getActivity()==null) return; - for (ListTimeline l : lists) userInListBefore.put(l.id, true); + for (FollowList l : lists) userInListBefore.put(l.id, true); userInList.putAll(userInListBefore); if (profileAccountId == null || !lists.isEmpty()) onDataLoaded(lists, false); if (profileAccountId == null) return; currentRequest=new GetLists().setCallback(new SimpleCallback<>(ListsFragment.this) { @Override - public void onSuccess(List allLists) { + public void onSuccess(List allLists) { if(getActivity()==null) return; - List newLists = new ArrayList<>(); - for (ListTimeline l : allLists) { + List newLists = new ArrayList<>(); + for (FollowList l : allLists) { if (lists.stream().noneMatch(e -> e.id.equals(l.id))) newLists.add(l); if (!userInListBefore.containsKey(l.id)) { userInListBefore.put(l.id, false); @@ -169,7 +169,7 @@ public void onSuccess(List allLists) { @Subscribe public void onListDeletedEvent(ListDeletedEvent event) { for (int i = 0; i < data.size(); i++) { - ListTimeline item = data.get(i); + FollowList item = data.get(i); if (item.id.equals(event.id)) { data.remove(i); adapter.notifyItemRemoved(i); @@ -181,7 +181,7 @@ public void onListDeletedEvent(ListDeletedEvent event) { @Subscribe public void onListUpdatedCreatedEvent(ListUpdatedCreatedEvent event) { for (int i = 0; i < data.size(); i++) { - ListTimeline item = data.get(i); + FollowList item = data.get(i); if (item.id.equals(event.id)) { item.title = event.title; item.repliesPolicy = event.repliesPolicy; @@ -230,7 +230,7 @@ public int getItemCount() { } } - private class ListViewHolder extends BindableViewHolder implements UsableRecyclerView.Clickable{ + private class ListViewHolder extends BindableViewHolder implements UsableRecyclerView.Clickable{ private final TextView title; private final CheckBox listToggle; @@ -241,7 +241,7 @@ public ListViewHolder(){ } @Override - public void onBind(ListTimeline item) { + public void onBind(FollowList item) { title.setText(item.title); title.setCompoundDrawablesRelativeWithIntrinsicBounds(itemView.getContext().getDrawable( item.exclusive ? R.drawable.ic_fluent_rss_24_regular : R.drawable.ic_fluent_people_24_regular diff --git a/mastodon/src/main/java/org/joinmastodon/android/model/FollowList.java b/mastodon/src/main/java/org/joinmastodon/android/model/FollowList.java new file mode 100644 index 0000000000..564c69ff37 --- /dev/null +++ b/mastodon/src/main/java/org/joinmastodon/android/model/FollowList.java @@ -0,0 +1,43 @@ +package org.joinmastodon.android.model; + +import com.google.gson.annotations.SerializedName; + +import org.joinmastodon.android.api.AllFieldsAreRequired; +import org.joinmastodon.android.api.ObjectValidationException; +import org.parceler.Parcel; + +// Called like this to avoid conflict with java.util.List +@AllFieldsAreRequired +@Parcel +public class FollowList extends BaseModel{ + public String id; + public String title; + public RepliesPolicy repliesPolicy=RepliesPolicy.LIST; + public boolean exclusive; + + @Override + public String toString(){ + return "FollowList{"+ + "id='"+id+'\''+ + ", title='"+title+'\''+ + ", repliesPolicy="+repliesPolicy+ + ", exclusive="+exclusive+ + '}'; + } + + @Override + public void postprocess() throws ObjectValidationException{ + if(repliesPolicy==null) + repliesPolicy=RepliesPolicy.LIST; + super.postprocess(); + } + + public enum RepliesPolicy{ + @SerializedName("followed") + FOLLOWED, + @SerializedName("list") + LIST, + @SerializedName("none") + NONE + } +} \ No newline at end of file diff --git a/mastodon/src/main/java/org/joinmastodon/android/model/ListTimeline.java b/mastodon/src/main/java/org/joinmastodon/android/model/ListTimeline.java deleted file mode 100644 index 4bd06e9356..0000000000 --- a/mastodon/src/main/java/org/joinmastodon/android/model/ListTimeline.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.joinmastodon.android.model; - -import androidx.annotation.NonNull; - -import com.google.gson.annotations.SerializedName; - -import org.joinmastodon.android.api.RequiredField; -import org.parceler.Parcel; - -@Parcel -public class ListTimeline extends BaseModel { - @RequiredField - public String id; - @RequiredField - public String title; - public RepliesPolicy repliesPolicy; - public boolean exclusive; - - @NonNull - @Override - public String toString() { - return "List{" + - "id='" + id + '\'' + - ", title='" + title + '\'' + - ", repliesPolicy=" + repliesPolicy + - ", exclusive=" + exclusive + - '}'; - } - - public enum RepliesPolicy{ - @SerializedName("followed") - FOLLOWED, - @SerializedName("list") - LIST, - @SerializedName("none") - NONE - } -} diff --git a/mastodon/src/main/java/org/joinmastodon/android/model/TimelineDefinition.java b/mastodon/src/main/java/org/joinmastodon/android/model/TimelineDefinition.java index 71ad02d1e9..6eeb9b9d66 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/model/TimelineDefinition.java +++ b/mastodon/src/main/java/org/joinmastodon/android/model/TimelineDefinition.java @@ -50,7 +50,7 @@ public static TimelineDefinition ofList(String listId, String listTitle, boolean return def; } - public static TimelineDefinition ofList(ListTimeline list) { + public static TimelineDefinition ofList(FollowList list) { return ofList(list.id, list.title, list.exclusive); } diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/views/ListEditor.java b/mastodon/src/main/java/org/joinmastodon/android/ui/views/ListEditor.java index 1ebe466d2e..de4454c360 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/views/ListEditor.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/views/ListEditor.java @@ -15,10 +15,10 @@ import androidx.annotation.Nullable; import org.joinmastodon.android.R; -import org.joinmastodon.android.model.ListTimeline; +import org.joinmastodon.android.model.FollowList; public class ListEditor extends LinearLayout { - private ListTimeline.RepliesPolicy policy = null; + private FollowList.RepliesPolicy policy = null; private final TextInputFrameLayout input; private final Button button; private final Switch exclusiveSwitch; @@ -42,10 +42,10 @@ public ListEditor(Context context, AttributeSet attrs, int defStyleAttr, int def findViewById(R.id.exclusive) .setOnClickListener(v -> exclusiveSwitch.setChecked(!exclusiveSwitch.isChecked())); - setRepliesPolicy(ListTimeline.RepliesPolicy.LIST); + setRepliesPolicy(FollowList.RepliesPolicy.LIST); } - public void applyList(String title, boolean exclusive, @Nullable ListTimeline.RepliesPolicy policy) { + public void applyList(String title, boolean exclusive, @Nullable FollowList.RepliesPolicy policy) { input.getEditText().setText(title); exclusiveSwitch.setChecked(exclusive); if (policy != null) setRepliesPolicy(policy); @@ -55,7 +55,7 @@ public String getTitle() { return input.getEditText().getText().toString(); } - public ListTimeline.RepliesPolicy getRepliesPolicy() { + public FollowList.RepliesPolicy getRepliesPolicy() { return policy; } @@ -63,7 +63,7 @@ public boolean isExclusive() { return exclusiveSwitch.isChecked(); } - public void setRepliesPolicy(@NonNull ListTimeline.RepliesPolicy policy) { + public void setRepliesPolicy(@NonNull FollowList.RepliesPolicy policy) { this.policy = policy; switch (policy) { case FOLLOWED -> button.setText(R.string.sk_list_replies_policy_followed); @@ -74,11 +74,11 @@ public void setRepliesPolicy(@NonNull ListTimeline.RepliesPolicy policy) { private boolean onMenuItemClick(MenuItem i) { if (i.getItemId() == R.id.reply_policy_none) { - setRepliesPolicy(ListTimeline.RepliesPolicy.NONE); + setRepliesPolicy(FollowList.RepliesPolicy.NONE); } else if (i.getItemId() == R.id.reply_policy_followed) { - setRepliesPolicy(ListTimeline.RepliesPolicy.FOLLOWED); + setRepliesPolicy(FollowList.RepliesPolicy.FOLLOWED); } else if (i.getItemId() == R.id.reply_policy_list) { - setRepliesPolicy(ListTimeline.RepliesPolicy.LIST); + setRepliesPolicy(FollowList.RepliesPolicy.LIST); } return true; }