Gather android folding feature information https://developer.android.com/reference/kotlin/androidx/window/layout/FoldingFeature
npm install react-native-folding-feature
Android set screen orientation at AndroidManifest.xml
android:screenOrientation="fullSensor"
import { FoldingFeatureProvider } from 'react-native-folding-feature';
...
<FoldingFeatureProvider option={options}>
... app component ...
</FoldingFeatureProvider>
...
Prop | Type | Default | Description |
---|---|---|---|
closeAngle | number | 20 | Specifies the angle for close pose |
import { useFoldingFeature } from 'react-native-folding-feature';
...
const { layoutInfo, isTableTop, isBook } = useFoldingFeature();
...
Prop | Type | Default | Description |
---|---|---|---|
layoutInfo | LayoutInfo | Folding Feature from android doc | |
hingeAngle | number | 180 | (range 0 - 180) acquire from SensorManager |
isTableTop | boolean | false | HALF_OPENED & HORIZONTAL |
isBook | boolean | false | HALF_OPENED & VERTICAL |
isFlat | boolean | true | |
isClosed | boolean | false | hingeAngle < closeAngle (default 20) |
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library