From c49b25454e14e41765b7213ccc9a87b8dcc8a0bb Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Mon, 4 Sep 2023 07:35:48 -0300 Subject: [PATCH] refactor(HomeFragment): refactor long click action for cleaner code --- .../android/fragments/HomeFragment.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java index d2f7eb786..4dcdd1e19 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java @@ -309,14 +309,11 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene return true; } if(tab==R.id.tab_search){ -// int previousTab = currentTab; - - onTabSelected(R.id.tab_search); - tabBar.selectTab(R.id.tab_search); - - if(!GlobalUserPreferences.doubleTapToSearch) - discoverFragment.openSearch(); - + if(currentTab!=R.id.tab_search){ + onTabSelected(R.id.tab_search); + tabBar.selectTab(R.id.tab_search); + } + discoverFragment.openSearch(); return true; } if(tab==R.id.tab_home){