From ac503cdf0cfb62470100c0085859c0d69aadf9a4 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 11 Jan 2023 17:51:21 +0100 Subject: [PATCH] Automatically switch to account tab if no results for tags --- .../android/activities/SearchResultTabActivity.java | 4 ++++ .../android/ui/fragment/timeline/FragmentMastodonTag.java | 4 ++++ .../fastlane/metadata/android/en/changelogs/463.txt | 8 +++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/activities/SearchResultTabActivity.java b/app/src/main/java/app/fedilab/android/activities/SearchResultTabActivity.java index 2e6584a8..1fe2cf44 100644 --- a/app/src/main/java/app/fedilab/android/activities/SearchResultTabActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/SearchResultTabActivity.java @@ -188,6 +188,10 @@ public class SearchResultTabActivity extends BaseBarActivity { } + public void moveToAccount() { + binding.searchViewpager.setCurrentItem(1); + } + /** * Pager adapter for the 4 fragments */ diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTag.java b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTag.java index b6bf6b18..97af1720 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTag.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/timeline/FragmentMastodonTag.java @@ -33,6 +33,7 @@ import java.util.List; import app.fedilab.android.BaseMainActivity; import app.fedilab.android.R; +import app.fedilab.android.activities.SearchResultTabActivity; import app.fedilab.android.client.entities.api.Tag; import app.fedilab.android.client.entities.app.Timeline; import app.fedilab.android.databinding.FragmentPaginationBinding; @@ -144,6 +145,9 @@ public class FragmentMastodonTag extends Fragment { router(); }); if (tags == null || tags.size() == 0) { + if (requireActivity() instanceof SearchResultTabActivity) { + ((SearchResultTabActivity) requireActivity()).moveToAccount(); + } binding.recyclerView.setVisibility(View.GONE); binding.noAction.setVisibility(View.VISIBLE); binding.noActionText.setText(R.string.no_tags); diff --git a/src/fdroid/fastlane/metadata/android/en/changelogs/463.txt b/src/fdroid/fastlane/metadata/android/en/changelogs/463.txt index 7bdeead2..eaebdeb2 100644 --- a/src/fdroid/fastlane/metadata/android/en/changelogs/463.txt +++ b/src/fdroid/fastlane/metadata/android/en/changelogs/463.txt @@ -1,10 +1,12 @@ Added: -- Search bar display suggestions +- Search bar: display suggestions when starting by "@" or "#" Changed: -- Preload media in timelines +- Preload media in timelines to avoid jumps +- Search: Automatically switch to account tab if no results for tags Fixed: -- Fix fetch more jumps +- Fix jumps with the fetch more feature - Fix videos cannot be saved +- Tags cannot be pinned when there are no custom tabs - Fix crashes \ No newline at end of file