npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-show-touches-ios

v1.0.5

Published

Show customizable touch indicators on iOS in React Native

Downloads

140

Readme

react-native-show-touches-ios

Use react-native-show-touches to show customizable touch indicators for any touches recieved on iOS.
App UI components will continue to function as expected.

Has no effect on Android.

Getting started

1. Install with package manager

$ yarn add react-native-show-touches-ios

or

$ npm install react-native-show-touches-ios --save

2. Install CocoaPod

cd ios && pod install

Usage

Basic touch indicators

import ShowTouches from "react-native-show-touches-ios";

// Wrap your root component to show default touch indicator for all touches
const App = () => {
  return (
    <ShowTouches>
      <SafeAreaView style={styles.container}>{/* Your app... */}</SafeAreaView>
    </ShowTouches>
  );
};

Customization

import ShowTouches from "react-native-show-touches-ios";

const App = () => {
  return (
    <ShowTouches
      color="red"
      opacity={0.1}
      radius={100}
      borderColor="orange"
      borderOpacity={0.9}
      borderWidth={5}
      fadeDuration={1}
    >
      <SafeAreaView style={styles.container}>{/* Your app... */}</SafeAreaView>
    </ShowTouches>
  );
};

***Usage with react-navigation

When using with an app that uses react-navigation, you can wrap your root component with <ShowTouches> just as you normally would.
In order for your underlying UI components to work, you must use react-native-gesture-handler as described in the react-navigation docs.

Proper usage with react-native-gesture-handler:


import ShowTouches from 'react-native-show-touches-ios';
import {TouchableOpacity} from 'react-native-gesture-handler

const App = () => {
  return (
    <ShowTouches
      color="red"
      opacity={0.1}
      radius={100}
      borderColor="orange"
      borderOpacity={0.9}
      borderWidth={5}
      fadeDuration={1}>
        ... REACT-NAVIGATION-CONTAINER ...
            <TouchableOpacity
              onPress={() => {
                console.log('pressed');
              }}>
              <Text>Press Me</Text>
            </TouchableOpacity>
        ... REACT-NAVIGATION-CONTAINER END ...
    </ShowTouches>
  );
};

Incorrect usage with react-native-gesture-handler:

TouchableOpacity from react-native will not work when using react-navigation - must use the component provided by react-native-gesture handler when using react-navigation

import ShowTouches from "react-native-show-touches-ios";
import { TouchableOpacity } from "react-native";

const App = () => {
  return (
    <ShowTouches
      color="red"
      opacity={0.1}
      radius={100}
      borderColor="orange"
      borderOpacity={0.9}
      borderWidth={5}
      fadeDuration={1}
    >
      ... REACT-NAVIGATION-CONTAINER ...
      <TouchableOpacity
        onPress={() => {
          console.log("pressed");
        }}
      >
        <Text>Press Me</Text>
      </TouchableOpacity>
      ... REACT-NAVIGATION-CONTAINER END ...
    </ShowTouches>
  );
};

Props

| Name | Description | Type | Default Value | | :------------ | :------------------------------------------------------------------ | :----- | :---------------------------------------------------------------------------------------: | | color | the inner color of the touch indicator | String | #007bff '#007bff' (UIColor.systemBlue) | | opacity | the inner opacity of the touch indicator | Number | 0.5 | | radius | the radius of the touch indicator | Number | 40 | | borderColor | the border color | String | #007bff '#007bff' (UIColor.systemBlue) | | borderOpacity | the opacity of the border | Number | 1 | | borderWidth | the width of the border | Number | 2 | | fadeDuration | the duration of the touch indicator's fade out animation in seconds | Number | 0.3 |

Todo

  • [x] iOS support
  • [ ] Android support
  • [ ] More animation customization options

Author

Michael Kiley

License

MIT