Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about Modals #19

Open
JanOwiesniak opened this issue Jan 27, 2019 · 3 comments
Open

Question about Modals #19

JanOwiesniak opened this issue Jan 27, 2019 · 3 comments

Comments

@JanOwiesniak
Copy link

JanOwiesniak commented Jan 27, 2019

What i have done

I followed the installation process and these instructions to integrate the package into my project but things are not behaving like i expected.

What i'm trying to achieve

I want to disable Androids System Bottom Navigation wherever possible because it conflicts with my UI.

What i observed

It seems like every kind of modal opens the Android Navigation.

Other examples in my code base which opens the Android Navigation

screenshot_20190127-142648

screenshot_20190127-174346

screenshot_20190127-175540

@gazedash
Copy link

gazedash commented Jun 4, 2019

If that helps someone, here's what I did in MainActivity, manually without this package:

  // Set the content to appear under the system bars so that the
  // content doesn't resize when the system bars hide and show.
  | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
  | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
  | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
  // Hide the nav bar and status bar
  | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
 // This flag below hides status bar, try to uncomment if needed to hide status bar:
 // | View.SYSTEM_UI_FLAG_FULLSCREEN

 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  final View decorView = getWindow().getDecorView();
  decorView
   .setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {

    @Override
    public void onSystemUiVisibilityChange(int visibility) {
     if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
      decorView.setSystemUiVisibility(flags);
     }
    }
   });
  decorView.setSystemUiVisibility(
   flags
  );
 }

 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
  super.onWindowFocusChanged(hasFocus);
  if (hasFocus) {
   getWindow().getDecorView().setSystemUiVisibility(
    flags);
  }
 }

But maybe this is also possible with react-native-immersive

@timomeara
Copy link

If that helps someone, here's what I did in MainActivity, manually without this package:

  // Set the content to appear under the system bars so that the
  // content doesn't resize when the system bars hide and show.
  | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
  | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
  | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
  // Hide the nav bar and status bar
  | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
 // This flag below hides status bar, try to uncomment if needed to hide status bar:
 // | View.SYSTEM_UI_FLAG_FULLSCREEN

 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  final View decorView = getWindow().getDecorView();
  decorView
   .setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {

    @Override
    public void onSystemUiVisibilityChange(int visibility) {
     if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
      decorView.setSystemUiVisibility(flags);
     }
    }
   });
  decorView.setSystemUiVisibility(
   flags
  );
 }

 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
  super.onWindowFocusChanged(hasFocus);
  if (hasFocus) {
   getWindow().getDecorView().setSystemUiVisibility(
    flags);
  }
 }

But maybe this is also possible with react-native-immersive

does this work for you?
i've seen this example in quite a few places but my modals are still showing the nav/bottom bar
:|

@JanOwiesniak
Copy link
Author

If that helps someone, here's what I did in MainActivity, manually without this package:

  // Set the content to appear under the system bars so that the
  // content doesn't resize when the system bars hide and show.
  | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
  | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
  | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
  // Hide the nav bar and status bar
  | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
 // This flag below hides status bar, try to uncomment if needed to hide status bar:
 // | View.SYSTEM_UI_FLAG_FULLSCREEN

 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  final View decorView = getWindow().getDecorView();
  decorView
   .setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {

    @Override
    public void onSystemUiVisibilityChange(int visibility) {
     if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
      decorView.setSystemUiVisibility(flags);
     }
    }
   });
  decorView.setSystemUiVisibility(
   flags
  );
 }

 @Override
 public void onWindowFocusChanged(boolean hasFocus) {
  super.onWindowFocusChanged(hasFocus);
  if (hasFocus) {
   getWindow().getDecorView().setSystemUiVisibility(
    flags);
  }
 }

But maybe this is also possible with react-native-immersive

does this work for you?
i've seen this example in quite a few places but my modals are still showing the nav/bottom bar
:|

I've seen similar approaches as well. This does not work in my case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants