0.3.0 • Published 9 months ago

@logicwind/react-native-fold-detection v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

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-detection

iOS

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

PropTypeDefaultDescription
layoutInfoLayoutInfoFolding Feature from android doc
isTableTopbooleanfalseHALF_OPENED & HORIZONTAL
isBookbooleanfalseHALF_OPENED & VERTICAL
isFlatbooleantrue

License

MIT


Made with create-react-native-library

0.3.0

9 months ago

0.2.0

2 years ago

0.1.0

2 years ago