1.0.0 • Published 8 years ago

react-native-unlock v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

react-native-unlock

WIP

Feature

  • Smooth gesture base on ReactART
  • Simple & Advanced usage
  • Fully customized ability

Changelogs

Show Cases

WIP

Getting Started

Installation

$ npm i react-native -g
$ react-native init examples
$ cd examples
$ npm i react-native-unlock -S

Note: this component base on ART.xcodeproj, we should manual linking it with few steps:

npm.io

  1. Open your project in Xcode

    $ open ios/examples.xcodeproj
  2. Drag ART.xcodeproj(in node_modules/react-native/Libraries/ART/) over to Libraries section in XCode

  3. Add libART.a under "Build Phases" -> "Link Binary With Libraries"

That's all, then restart the simulator.

Basic Usage

import React from 'react'
import { AppRegistry, View } from 'react-native'
import Unlock from 'react-native-unlock'
AppRegistry.registerComponent('examples', () => () => <View style={{flex: 1}}>
  <Unlock />
</View>)

Components

import Unlock, { Circle, Line, Text, Group } from 'react-native-unlock'

Expose Circle, Line, Text, Group for more custom ability.

Properties

PropDefaultTypeDescription
widthundefindnumberif unset autoLayout base on outer size.
heightundefiendnumberif unset autoLayout base on outer size.
gapSizetruenumbergap size between outer circle.
stroketruestringgap size between outer circle.
fonttruestringgap size between outer circle.
styletrueobjectwrapper style will overrer the default.
autoResetTimeouttruenumberonly auto reset if set.
cleartrueboolclear current state, usefully if you want reset through state.
outertrueelementProvide your cumstom outer component.
outerPropstrueobjectcumstom outer component.
outerOverPropstrueobjectcumstom outer component.
outerErrorPropstrueobjectcumstom outer component.
outerSuccessPropstrueobjectcumstom outer component.
innertrueelementProvide your cumstom inner component.
innerPropstrueobjectcumstom inner component.
innerOverPropstrueobjectcumstom inner component.
innerErrorPropstrueobjectcumstom inner component.
innerSuccessPropstrueobjectcumstom inner component.
onReleasetruefunconPanResponderRelease handle.
onGranttruefunconPanResponderGrant handle.
linetrueobjectline style .
lineSuccesstrueobjectline style for success.
lineErrortrueobjectline style for error.
interactivetrueoneOf('', 'READY', 'SUCCESS', 'ERROR')interactive state.
showTailtrueboolwhether show tail line.
showTexttrueboolwhether show inner text.
maxLengthtruenumberthe max length of password.
modetrueoneOf('gesture', 'touch')show mode.

Examples

  • Unlock mode

  • Setting mode

  • Touch mode (like iOS native)

Development

$ cd examples
$ npm i
$ npm run dev
$ react-native run-ios