kadiraydinli / react-native-system-navigation-bar

React Native lets you customize the navigation bar for Android.
https://www.npmjs.com/package/react-native-system-navigation-bar
MIT License
265 stars 19 forks source link

not hidding the status and navigation bar in modal #51

Open rehan-taiftec opened 1 year ago

rehan-taiftec commented 1 year ago

Description

I am using a modal from react-native i wanted to hide the status bar and navigation bar on modal as well but its showing on the modal

Screenshot 2023-05-04 at 10 25 30 AM

react-native-system-navigation-bar version

2.6.0

React Native version

0.71

Snack, code example, screenshot, or link to a repository

No response

kadiraydinli commented 1 year ago

Hi @rehan-taiftec, can you share the snack code so I can test it?

uncoolclub commented 1 year ago

@kadiraydinli

Same issue here. 🥺

Description

I want to use Immersive mode to cover both the status bar and the bottom navigation, but when I use the modal provided by react-native, the bottom navigation is visible.

react-native-system-navigation-bar version

2.6.0

React Native version

0.71.6

Snack, code example, screenshot, or link to a repository

// ImmersiveModeHandler.js
import { AppState, Platform } from 'react-native';
import SystemNavigationBar from 'react-native-system-navigation-bar';

import { PLATFORM } from '@Constants';

const setImmersiveMode = () => {
  SystemNavigationBar.immersive();
};

const initImmersiveMode = () => {
  if (Platform.OS === PLATFORM.IOS) {
    return;
  }

  setImmersiveMode();
  AppState.addEventListener('change', setImmersiveMode);
};

export { initImmersiveMode, setImmersiveMode };
// LoadingScreen.jsx
...
componentDidMount = async () => {
   ...
   await Promise.all([setImmersiveMode(), ...]);
  };
// Example > ModalComponent.jsx
import { Modal } from 'react-native';

...

return (
  <Modal
    transparent
    statusBarTranslucent
    visible={modalVisible}
    accessible={false}
    style={getStyle().container}
  > 
...
kadiraydinli commented 1 year ago

Hi @uncoolclub, thank you for your comment. 🙏🏼 I was able to see the problem when I tested your snack code. This issue was fixed in react-native before(https://github.com/facebook/react-native/commit/f8a4d281e2be5b68fbebf53f930d37d96236829c), but now it doesn't seem to work properly for Android SDK Level 33 (Android 13). It works correctly when I tested it on Android SDK Level 28 (Android 9). I'm looking at what I can do to fix this issue. I'll let you know when I find a solution.

kadiraydinli commented 1 year ago

Hello again @uncoolclub , sorry to be back late. This issue is a React Native related issue. If I can find the time and do it, I'm thinking of opening a pull request for this in React Native. Unfortunately this issue cannot be resolved in my package.

uncoolclub commented 1 year ago

Hello, @kadiraydinli. It's okay, thanks for comment! I am aware of that. Could you tell me what specifically was an issue in the react native? Is it the same issue as the one you linked above (https://github.com/facebook/react-native/commit/f8a4d281e2be5b68fbebf53f930d37d96236829c)?

kadiraydinli commented 1 year ago

Yes,same issue as above link. @uncoolclub

valery-lavrik commented 1 year ago

Faced with the same problem. There are no workarounds? (rn - 0.71.8)

kadiraydinli commented 1 year ago

@valery-lavrik As far as I know there is no workaround. Maybe you can patch react-native in your node_modules with patch-package.

valery-lavrik commented 1 year ago

unfortunately, I don't know react-native so well

NazarKuryl0 commented 1 year ago

Faced with the same problem

JoaoVitorJJV commented 12 months ago

same problem here....

Joaquim-Frances commented 9 months ago

Same problem here!! thanks for the work!

wangchongwei commented 9 months ago

Same problem here.

knro commented 8 months ago

Any workarounds? For current react-native, any patch we can apply to fix this?

ciaoamigoschat commented 6 months ago

news?

ThilinaHewagama commented 3 months ago

Not working for modals ??

decky-grande commented 2 months ago

Yes in React Native Modal it still show