Skip to content

Commit 0b012a3

Browse files
committed
docs: update readme
1 parent 7a82777 commit 0b012a3

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,33 @@ npm install react-native-folding-feature
1515

1616
Android set screen orientation at AndroidManifest.xml
1717

18-
example: android:screenOrientation="fullSensor"
18+
```
19+
android:screenOrientation="fullSensor"
20+
```
1921

2022

21-
### warp App component with FoldingFeatureProvider
23+
### Warp App component with FoldingFeatureProvider
2224
```tsx
2325
import { FoldingFeatureProvider } from 'react-native-folding-feature';
2426

2527
...
26-
<FoldingFeatureProvider>
28+
<FoldingFeatureProvider option={options}>
2729
... app component ...
2830
</FoldingFeatureProvider>
2931
...
3032

3133
```
3234

35+
36+
### Options
37+
| Prop | Type | Default | Description |
38+
| ---- | ---- | --------| ----------- |
39+
| closeAngle | number | 20 | Specifies the angle for close pose
40+
41+
42+
43+
44+
3345
### Get the folding feature information
3446

3547
```js
@@ -40,6 +52,16 @@ const { layoutInfo, isTableTop, isBook } = useFoldingFeature();
4052
...
4153
```
4254

55+
### useFoldingFeature Props
56+
| Prop | Type | Default | Description |
57+
|------|------|---------|-------------|
58+
|layoutInfo | LayoutInfo | |Folding Feature from [android doc](https://developer.android.com/reference/kotlin/androidx/window/layout/FoldingFeature) |
59+
| hingeAngle | number | 180 |(range 0 - 180) acquire from [SensorManager](https://developer.android.com/reference/android/hardware/Sensor#TYPE_HINGE_ANGLE) |
60+
| isTableTop | boolean | false | HALF_OPENED & HORIZONTAL |
61+
| isBook | boolean | false| HALF_OPENED & VERTICAL |
62+
| isFlat | boolean | true | |
63+
| isClosed | boolean | false | hingeAngle < closeAngle (default 20)|
64+
4365

4466
## Contributing
4567

0 commit comments

Comments
 (0)