
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-native-hidenavbar
Advanced tools
fork from react-native-immersive but only hiding navbar
Add Toggle for Android Immersive FullScreen Layout
Note:
v2.0.0 and above will build with gradle@>=3v1.0.0 and above should be used with react-native@>=0.47v0.0.5 should be used with react-native@<=0.46Download from npm: npm i react-native-immersive
Run react-native link to automatically link the library.
Edit android/settings.gradle:
+ include ':react-native-immersive'
+ project(':react-native-immersive').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-immersive/android')
Edit android/app/build.gradle: (for versions before v2.0.0, use compile instead of implementation for gradle@<=2)
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
+ implementation project(':react-native-immersive')
}
Edit android/app/src/main/java/.../MainApplication.java:
+ import com.rnimmersive.RNImmersivePackage;
...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage()
+ , new RNImmersivePackage()
);
}
import { Immersive } from 'react-native-immersive'
// methods (Android only, will throw Error on iOS in __DEV__ mode)
Immersive.on()
Immersive.setImmersive(true)
Immersive.off()
Immersive.setImmersive(false)
The Immersive State do not last forever (SYSTEM_UI_FLAG_IMMERSIVE_STICKY is not sticky enough). The Immersive State will get reset when:
To restore the Immersive State, add an additional listener.
// listener for Immersive State recover
const restoreImmersive = () => {
__DEV__ && console.warn('Immersive State Changed!')
Immersive.on()
}
Immersive.addImmersiveListener(restoreImmersive)
Immersive.removeImmersiveListener(restoreImmersive)
The Native Module itself will cover some basic Immersive State change (but not something like Modal + Alert).
To get all Immersive State change, edit android/app/src/main/java/.../MainActivity.java:
+ import com.rnimmersive.RNImmersiveModule;
...
public class MainActivity extends ReactActivity {
...
+ @Override
+ public void onWindowFocusChanged(boolean hasFocus) {
+ super.onWindowFocusChanged(hasFocus);
+
+ if (hasFocus && RNImmersiveModule.getInstance() != null) {
+ RNImmersiveModule.getInstance().emitImmersiveStateChangeEvent();
+ }
+ }
}
Change the code of index.js for testing:
example/index.sample.js
When compile ReactNative android, different package may set different compileSdkVersion and buildToolsVersion.
To force all the submodules to use the specified compileSdkVersion and buildToolsVersion,
add the following code to android/build.gradle:
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
}
}
}
}
Around 2018/12/10,
JCenter received a request from Google, to remove several binaries from their repository.
But some repos were removed by mistake,
causing error like: Could not resolve com.android.tools.build:gradle:2.3.+..
As google removed gradle v2.2.* from JCenter, so many plugins not work.
To patch repositories for specific submodules,
add the following code to android/build.gradle:
buildscript { ... }
allprojects { ... }
subprojects {
if (project.name.contains('react-native-immersive')) {
buildscript {
repositories {
jcenter()
maven { url "https://dl.bintray.com/android/android-tools/" }
}
}
}
}
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.