From d8cd151c7e9a76514a4eaf49db0c2a142218efb1 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Mon, 20 Feb 2023 14:00:55 -0300 Subject: [PATCH] Adding the local timelines feature and some polishes --- .../fragments/EditTimelinesFragment.java | 20 ++++++++++++++++++- mastodon/src/main/res/values/strings_mo.xml | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) 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 08352ebbe..c73af0629 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/EditTimelinesFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/EditTimelinesFragment.java @@ -15,6 +15,7 @@ import android.view.SubMenu; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; +import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; @@ -50,6 +51,7 @@ import me.grishka.appkit.api.Callback; import me.grishka.appkit.api.ErrorResponse; import me.grishka.appkit.fragments.BaseRecyclerFragment; import me.grishka.appkit.utils.BindableViewHolder; +import me.grishka.appkit.utils.V; import me.grishka.appkit.views.UsableRecyclerView; public class EditTimelinesFragment extends BaseRecyclerFragment implements ScrollableToTop { @@ -145,7 +147,23 @@ public class EditTimelinesFragment extends BaseRecyclerFragment { + TimelineDefinition tl = TimelineDefinition.ofCustomLocalTimeline(input.getText().toString().trim()); + data.add(tl); + saveTimelines(); + }) + .setNegativeButton(R.string.cancel, (d, which) -> { + }) + .show(); } private void addTimelineToOptions(TimelineDefinition tl, Menu menu) { diff --git a/mastodon/src/main/res/values/strings_mo.xml b/mastodon/src/main/res/values/strings_mo.xml index a25e9666e..b38d0afff 100644 --- a/mastodon/src/main/res/values/strings_mo.xml +++ b/mastodon/src/main/res/values/strings_mo.xml @@ -25,6 +25,7 @@ Filtered: %s Disable "Relocate publish button" to allow customization Disable reminder to add alt text + Add a custom server\'s local timeline Add new poll option