Quickly and easily check if your app is multiwindowed
npm install react-native-is-multi-windowQuickly and easily check if your app is multiwindow
| Android | iOS, iPad OS |
``sh`
npm install react-native-is-multi-window
Add following to MainActivity.java or MainActivity.kt
#### MainActivity.java
`java
import android.content.Intent;
@Override
public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
super.onMultiWindowModeChanged(isInMultiWindowMode);
Intent intent = new Intent("onMultiWindowModeChanged");
intent.putExtra("isInMultiWindowMode", isInMultiWindowMode);
this.sendBroadcast(intent);
}
`
#### MainActivity.kt
`kotlin
import android.content.Intent
override fun onMultiWindowModeChanged(isInMultiWindowMode: Boolean) {
super.onMultiWindowModeChanged(isInMultiWindowMode)
val intent =
Intent("onMultiWindowModeChanged").apply {
putExtra("isInMultiWindowMode", isInMultiWindowMode)
}
sendBroadcast(intent)
}
`
`js
import { isMultiWindowMode } from 'react-native-is-multi-window';
// ...
const result = await isMultiWindowMode();
`
`js
import { useMultiWindowMode } from 'react-native-is-multi-window';
// ...
const { isMultiMode } = useMultiWindowMode();
useEffect(() => {
console.log(MultiMode => ${isMultiMode});``
}, [isMultiMode]);
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
---
Made with create-react-native-library