Giter Site home page Giter Site logo

schachris / react-native-visibility-aware-view Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 459 KB

License: MIT License

Makefile 1.92% C++ 0.76% Java 48.18% JavaScript 2.93% Ruby 6.09% Swift 0.12% C 0.17% Objective-C 22.18% Objective-C++ 9.22% TypeScript 8.43%

react-native-visibility-aware-view's Introduction

react-native-visibility-aware-view

Supports iOS and Android npm

A view which is aware of its visibility. It also tracks itself when the view is scrolled or moved.

This library supports both architectures. The old one and fabric (new arch).

Installation

npm install react-native-visibility-aware-view

Usage

import { VisibilityAwareView } from 'react-native-visibility-aware-view';

// ...

<VisibilityAwareView
  minVisibleArea={0.5}
  ignoreAppState={ignoreAppState}
  onBecomeVisible={(event) => {}}
  onBecomeInvisible={(event) => {}}
  style={styles.box}
/>;

Testing

New Arch

iOS

Navigate to example/package.json and set RCT_NEW_ARCH_ENABLED=1 in pods script

then run

yarn clean
yarn
# and then
yarn example ios

Android

Navigate to example/android/gradle.properties and set newArchEnabled=true then run

yarn clean
yarn
# and then
yarn example android
generate Artifacts
cd ./example/android
./gradlew generateCodegenArtifactsFromSchema
cd ../../
yarn example android

# or
cd ./example/android && ./gradlew generateCodegenArtifactsFromSchema && cd ../../ && yarn example android

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

react-native-visibility-aware-view's People

Stargazers

Levi avatar Hamdi Jomaa avatar

Watchers

Christian Schaffrath avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.