fixes In nearby tab when back button is pressed nothing happen(#4096) (#4102)

* fixes #4096

* reformed the codechange

* reformed the codechange
This commit is contained in:
Prince kushwaha 2020-12-28 21:02:55 +05:30 committed by GitHub
parent c3700c9234
commit 6286607fc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -241,7 +241,12 @@ public class MainActivity extends BaseActivity
contributionsFragment.backButtonClicked();
} else if (nearbyParentFragment != null && activeFragment == ActiveFragment.NEARBY) {
// Means that nearby fragment is visible
nearbyParentFragment.backButtonClicked();
/* If function nearbyParentFragment.backButtonClick() returns false, it means that the bottomsheet is
not expanded. So if the back button is pressed, then go back to the Contributions tab */
if(!nearbyParentFragment.backButtonClicked()){
getSupportFragmentManager().beginTransaction().remove(nearbyParentFragment).commit();
setSelectedItemId(NavTab.CONTRIBUTIONS.code());
}
} else if (exploreFragment != null && activeFragment == ActiveFragment.EXPLORE) {
// Means that explore fragment is visible
exploreFragment.onBackPressed();