File tree Expand file tree Collapse file tree 2 files changed +63
-2
lines changed
Expand file tree Collapse file tree 2 files changed +63
-2
lines changed Original file line number Diff line number Diff line change 1- # react-native-double-click
1+ # react-native-double-click
2+
3+ A Component Wrapper for Double Click/Tap, made for React Native, works on both Android and iOS.
4+
5+ ## Running Example
6+ * ` git clone https://github.com/dwicao/react-native-double-click.git `
7+ * ` cd example `
8+ * ` npm install `
9+ * ` react-native run-android `
10+
11+ ## Installation
12+ * ` npm install --save react-native-double-click `
13+
14+ ## Usage
15+ ``` js
16+ import React , { Component } from ' react' ;
17+ import {
18+ Text ,
19+ View ,
20+ Alert ,
21+ } from ' react-native' ;
22+ import DoubleClick from ' react-native-double-click' ;
23+
24+ export default class doubleClicker extends Component {
25+ constructor () {
26+ super ();
27+
28+ this .handleClick = this .handleClick .bind (this );
29+ }
30+
31+ handleClick () {
32+ Alert .alert (' This is awesome \n Double tap succeed' );
33+ }
34+
35+ render () {
36+ return (
37+ < View style= {{ flex: 1 , marginTop: 50 }}>
38+ < Text style= {{ fontSize: 20 }}>
39+ Welcome to React Native!
40+ < / Text >
41+ < DoubleClick onClick= {this .handleClick }>
42+ < Text style= {{ fontSize: 26 }}>
43+ Please tap me twice!
44+ < / Text >
45+ < / DoubleClick>
46+ < / View>
47+ );
48+ }
49+ }
50+ ```
51+
52+ ## Props
53+
54+ | Property | Type | Default | Description |
55+ | --- | --- | --- | --- |
56+ | delay | number | 300 | (in milliseconds) How fast double click/tap be pressed (number below 200 might not worked) |
57+ | radius | number | 20 | Radius for click/tap |
58+ | onClick | function | () => Alert.alert('Double Tap Succeed') | Execute function after double click/tap be pressed |
59+
60+ ## License
61+ MIT
62+
Original file line number Diff line number Diff line change 2020 "android-signkey" : " keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000" ,
2121 "android-release" : " cd android && ./gradlew assembleRelease" ,
2222 "android-signer" : " cd android/app/build/outputs/apk/ && jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android -keypass android app-release-unsigned.apk androiddebugkey" ,
23- "android-dev" : " source ~/.bashrc && adb uninstall com.splazzz && react-native run-android && adb reverse tcp:8081 tcp:8081 && react-native start" ,
23+ "android-dev" : " source ~/.bashrc && adb uninstall com.doubleClicker && react-native run-android && adb reverse tcp:8081 tcp:8081 && react-native start" ,
2424 "android-bundle" : " react-native bundle --platform android --dev false --entry-file ./index.android.js --bundle-output ./android/app/src/main/assets/index.android.bundle --sourcemap-output ./android/app/src/main/assets/index.android.map --assets-dest ./android/app/src/main/res/"
2525 },
2626 "dependencies" : {
You can’t perform that action at this time.
0 commit comments