diff --git a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java index c00ce50a..542151cd 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java @@ -313,6 +313,11 @@ public class MainActivity extends ThemedActivity AppLog.v(this, "Fragment was not visible. Replace it."); fm.beginTransaction().addToBackStack(null).replace(R.id.fragment_container, fragment, fragment.getFragmentTag()).commit(); invalidateOptionsMenu(); + if (appSettings.isIntellihideToolbars() && fragment.isAllowedIntellihide()) { + this.enableToolbarHiding(); + } else { + this.disableToolbarHiding(); + } } else { AppLog.v(this, "Fragment was already visible. Do nothing."); } @@ -576,16 +581,6 @@ public class MainActivity extends ThemedActivity LocalBroadcastManager.getInstance(this).registerReceiver(brOpenExternalLink, new IntentFilter(ACTION_OPEN_EXTERNAL_URL)); invalidateOptionsMenu(); this.appSettings = getAppSettings(); - boolean podSelection = getTopFragment() != null && getTopFragment().getFragmentTag().equals(PodSelectionFragment.TAG); - if (appSettings.isIntellihideToolbars()) { - if(podSelection) { - this.disableToolbarHiding(); - } else { - this.enableToolbarHiding(); - } - } else { - this.disableToolbarHiding(); - } updateNavigationViewEntryVisibilities(); } diff --git a/app/src/main/java/com/github/dfa/diaspora_android/activity/PodSelectionFragment.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/PodSelectionFragment.java index 806cda26..c323afc2 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/activity/PodSelectionFragment.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/PodSelectionFragment.java @@ -282,4 +282,9 @@ public class PodSelectionFragment extends ThemedFragment implements SearchView.O public boolean onBackPressed() { return false; } + + @Override + public boolean isAllowedIntellihide() { + return false; + } } \ No newline at end of file diff --git a/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/CustomFragment.java b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/CustomFragment.java index 8f7f26ae..0ef009bc 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/CustomFragment.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/ui/theme/CustomFragment.java @@ -65,5 +65,9 @@ public abstract class CustomFragment extends Fragment { * @return did we react to the back press? */ public abstract boolean onBackPressed(); + + public boolean isAllowedIntellihide() { + return true; + } }