mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Check if setup tab is visible
This commit is contained in:
parent
5ac07d0e03
commit
8f95ab649f
2 changed files with 9 additions and 2 deletions
|
@ -112,6 +112,10 @@ public class FragmentOptions extends FragmentBase {
|
|||
getActivity().getIntent().removeExtra("tab");
|
||||
}
|
||||
|
||||
boolean isVisible(int position) {
|
||||
return (pager.getCurrentItem() == position);
|
||||
}
|
||||
|
||||
private class PagerAdapter extends FragmentStatePagerAdapter {
|
||||
public PagerAdapter(FragmentManager fm) {
|
||||
super(fm);
|
||||
|
|
|
@ -352,9 +352,12 @@ public class FragmentSetup extends FragmentBase {
|
|||
|
||||
@Override
|
||||
public boolean onBackPressed() {
|
||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED) &&
|
||||
((FragmentOptions) getParentFragment()).isVisible(0)) {
|
||||
onExit();
|
||||
return true;
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue