make back button return home before exiting

This commit is contained in:
sk
2022-05-21 23:33:53 +02:00
parent 080a320e12
commit ecd568503d

View File

@@ -255,9 +255,14 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
@Override @Override
public boolean onBackPressed(){ public boolean onBackPressed(){
if(currentTab==R.id.tab_profile) if(currentTab==R.id.tab_profile)
return profileFragment.onBackPressed(); if (profileFragment.onBackPressed()) return true;
if(currentTab==R.id.tab_search) if(currentTab==R.id.tab_search)
return searchFragment.onBackPressed(); if (searchFragment.onBackPressed()) return true;
if (currentTab!=R.id.tab_home) {
tabBar.selectTab(R.id.tab_home);
onTabSelected(R.id.tab_home);
return true;
}
return false; return false;
} }