1.0.15 • Published 4 years ago

react-native-quick-controls v1.0.15

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

react-native-quick-controls

Getting started

$ npm install react-native-quick-controls --save

Mostly automatic installation

$ react-native link react-native-quick-controls

Usage

import React from "react"
import { View, Text, Image } from "react-native"
import QuickControls from 'react-native-quick-controls';

const QuickControlsApp = props => {

    return (
        <QuickControls
            duration={300}
            landscapeStyle={{ marginTop: 20 }}
            viewMode={val => console.log(val)}
            portraitEndPoint={0.7}
            landscapeEndPoint={0.5}
            children={
                <View style={{ flex: 1 }}>
                    <Text>This is a children component</Text>
                </View>
            }
            parent={
                <Image 
                    style = {{ alignSelf: 'center', width: 25, height: 50, resizeMode: 'contain' }}
                    source = {{ uri: "https://cdn3.iconfinder.com/data/icons/o-shaped-flag-1/128/O_shaped_asian_flag-21-256.png" }}
                />
            }
            first_action={() => console.log("First action pressed!")}
            first_child={<Image 
                style = {{ alignSelf: 'center', width: 36, height: 36, resizeMode: 'contain' }}
                source = {{ uri: "https://cdn3.iconfinder.com/data/icons/o-shaped-flag-1/128/O_shaped_asian_flag-21-256.png" }}
            />}
            second_action={() => console.log("Second action pressed!")}
            second_child={<Image 
                style = {{ alignSelf: 'center', width: 36, height: 36, resizeMode: 'contain' }}
                source = {{ uri: "https://cdn3.iconfinder.com/data/icons/o-shaped-flag-1/128/O_shaped_asian_flag-27-128.png" }}
            />}
            third_action={() => console.log("Third action pressed!")}
            third_child={<Image 
                style = {{ alignSelf: 'center', width: 36, height: 36, resizeMode: 'contain' }}
                source = {{ uri: "https://cdn3.iconfinder.com/data/icons/o-shaped-flag-1/128/O_shaped_asian_flag-16-256.png" }}
            />}
        />
    )

}

Props

PropTypeRequiredDefaultDescription
parentcomponentYesThe parent component
first_childcomponentYesThe first child to show
first_actionActionYesThe action perform after first child clicked
second_childcomponentYesThe second child to show
second_actionActionYesThe action perform after second child clicked
third_childcomponentYesThe third child to show
first_actionActionYesThe action perform after third child clicked
durationmillisecondsNo500The duration of animation
portraitEndPointdoubleNo0.7The limit of the menu can reached in portrait mode
landscapeEndPointdoubleNo0.5The limit of the menu can reached in landscape mode
viewModeFunctionNoCallback function for screen mode changed
commonStylestyleNoCommon style for both portrait and landscape mode
portraitStylestyleNoStyle for portrait mode
landscapeStylestyleNoStyle for landscape mode

MIT Licensed

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.9

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago