mirror of
https://github.com/gsantner/dandelion
synced 2024-11-25 13:52:08 +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.");
|
AppLog.v(this, "Fragment was not visible. Replace it.");
|
||||||
fm.beginTransaction().addToBackStack(null).replace(R.id.fragment_container, fragment, fragment.getFragmentTag()).commit();
|
fm.beginTransaction().addToBackStack(null).replace(R.id.fragment_container, fragment, fragment.getFragmentTag()).commit();
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
|
if (appSettings.isIntellihideToolbars() && fragment.isAllowedIntellihide()) {
|
||||||
|
this.enableToolbarHiding();
|
||||||
|
} else {
|
||||||
|
this.disableToolbarHiding();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
AppLog.v(this, "Fragment was already visible. Do nothing.");
|
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));
|
LocalBroadcastManager.getInstance(this).registerReceiver(brOpenExternalLink, new IntentFilter(ACTION_OPEN_EXTERNAL_URL));
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
this.appSettings = getAppSettings();
|
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();
|
updateNavigationViewEntryVisibilities();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -282,4 +282,9 @@ public class PodSelectionFragment extends ThemedFragment implements SearchView.O
|
||||||
public boolean onBackPressed() {
|
public boolean onBackPressed() {
|
||||||
return false;
|
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?
|
* @return did we react to the back press?
|
||||||
*/
|
*/
|
||||||
public abstract boolean onBackPressed();
|
public abstract boolean onBackPressed();
|
||||||
|
|
||||||
|
public boolean isAllowedIntellihide() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue