mirror of
https://github.com/gsantner/dandelion
synced 2024-12-22 19:08:03 +01:00
Fixed #91 in a better way
This commit is contained in:
parent
6e1e473aff
commit
d34c75a647
3 changed files with 14 additions and 10 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -282,4 +282,9 @@ public class PodSelectionFragment extends ThemedFragment implements SearchView.O
|
|||
public boolean onBackPressed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAllowedIntellihide() {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue