Quickly and easily check if your app is multiwindow
Android | iOS, iPad OS |
npm install react-native-is-multi-window
Add following to MainActivity.java
or MainActivity.kt
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);
}
import android.content.Intent
override fun onMultiWindowModeChanged(isInMultiWindowMode: Boolean) {
super.onMultiWindowModeChanged(isInMultiWindowMode)
val intent =
Intent("onMultiWindowModeChanged").apply {
putExtra("isInMultiWindowMode", isInMultiWindowMode)
}
sendBroadcast(intent)
}
import { isMultiWindowMode } from 'react-native-is-multi-window';
// ...
const result = await isMultiWindowMode();
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