@logicwind/react-native-fold-detection
v0.3.2
Published
The purpose of the package is to provide details regarding the Android folding capability.
Readme
react-native-fold-detection
The purpose of the package is to provide details regarding the Android folding capability.
Installation
npm install @logicwind/react-native-fold-detectioniOS
You'll need to disable auto-linking for this package. To do so, create react-native.config.js in the root of your project with this content:
module.exports = {
dependencies: {
"react-native-fold-detection": {
platforms: {
ios: null, // this will disable autolinking for this package on iOS
},
},
},
};In App.js Wrap your app with FoldingFeatureProvider
import * as React from "react";
import { FoldingFeatureProvider } from "@logicwind/react-native-fold-detection";
import SampleScreen from "./SampleScreen";
export default function App() {
return (
<FoldingFeatureProvider>
<SampleScreen />
</FoldingFeatureProvider>
);
}In other screens
import { useFoldingFeature } from "@logicwind/react-native-fold-detection";
const { layoutInfo, isTableTop, isBook, isFlat } = useFoldingFeature();useFoldingFeature Props
| Prop | Type | Default | Description | | ---------- | ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------ | | layoutInfo | LayoutInfo | | Folding Feature from android doc | | isTableTop | boolean | false | HALF_OPENED & HORIZONTAL | | isBook | boolean | false | HALF_OPENED & VERTICAL | | isFlat | boolean | true | |
react-native-fold-detection is crafted mindfully at Logicwind
We are a 130+ people company developing and designing multiplatform applications using the Lean & Agile methodology. To get more information on the solutions that would suit your needs, feel free to get in touch by email or through or contact form!
We will always answer you with pleasure 😁
License
This project is licensed under the MIT License - see the LICENSE file for details
