Automatically switch to account tab if no results for tags

This commit is contained in:
Thomas 2023-01-11 17:51:21 +01:00
parent bc8dfec325
commit ac503cdf0c
3 changed files with 13 additions and 3 deletions

View file

@ -188,6 +188,10 @@ public class SearchResultTabActivity extends BaseBarActivity {
} }
public void moveToAccount() {
binding.searchViewpager.setCurrentItem(1);
}
/** /**
* Pager adapter for the 4 fragments * Pager adapter for the 4 fragments
*/ */

View file

@ -33,6 +33,7 @@ import java.util.List;
import app.fedilab.android.BaseMainActivity; import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.R; 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.api.Tag;
import app.fedilab.android.client.entities.app.Timeline; import app.fedilab.android.client.entities.app.Timeline;
import app.fedilab.android.databinding.FragmentPaginationBinding; import app.fedilab.android.databinding.FragmentPaginationBinding;
@ -144,6 +145,9 @@ public class FragmentMastodonTag extends Fragment {
router(); router();
}); });
if (tags == null || tags.size() == 0) { if (tags == null || tags.size() == 0) {
if (requireActivity() instanceof SearchResultTabActivity) {
((SearchResultTabActivity) requireActivity()).moveToAccount();
}
binding.recyclerView.setVisibility(View.GONE); binding.recyclerView.setVisibility(View.GONE);
binding.noAction.setVisibility(View.VISIBLE); binding.noAction.setVisibility(View.VISIBLE);
binding.noActionText.setText(R.string.no_tags); binding.noActionText.setText(R.string.no_tags);

View file

@ -1,10 +1,12 @@
Added: Added:
- Search bar display suggestions - Search bar: display suggestions when starting by "@" or "#"
Changed: Changed:
- Preload media in timelines - Preload media in timelines to avoid jumps
- Search: Automatically switch to account tab if no results for tags
Fixed: Fixed:
- Fix fetch more jumps - Fix jumps with the fetch more feature
- Fix videos cannot be saved - Fix videos cannot be saved
- Tags cannot be pinned when there are no custom tabs
- Fix crashes - Fix crashes