Coder Social home page Coder Social logo

wix-incubator / react-native-action-view Goto Github PK

View Code? Open in Web Editor NEW
187.0 187.0 18.0 16.83 MB

An easy to use component that allows displaying swipeable buttons with a variety of transitions.

License: MIT License

JavaScript 8.07% Objective-C 82.15% Java 6.34% Ruby 1.48% Starlark 1.95%

react-native-action-view's People

Contributors

andy-zy avatar artald avatar gran33 avatar guyca avatar leonatan avatar xxllexx avatar ykravv avatar yogevbd avatar zidail avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-action-view's Issues

How to set an image instead of title in buttons?

Hello,

Is it really possible to set an image in buttons as the Readme demonstrates?

I saw that there is a property image for buttons, but I'm not sure what is expected as type (string which should be the path of the image file I guess?).

I looked at the source code to see what's going on and this line makes me think that the image property of buttons (the code seems to consider the field icon instead) is not initialised and is always nil.

Does Not work

I installed react-native-action-view.
After that import react-native-action-view.
and copy your code ... but that is not work

import React, { Component } from 'react';
import {
    Platform,
    StyleSheet,
    Image,
    ScrollView,
    TouchableHighlight,
    Button,
    Alert,
    Text,
    View
} from 'react-native';
import { Actions } from 'react-native-router-flux';
import { SwipeActionView } from 'react-native-action-view';
import Header from '../components/default/header';

export default class Favorites extends Component<{}> {

    // static navigationOptions = {
    //     title: 'Favorites',
    //     headerRight: <Button title="Info"
    //                          onPress={()=>Alert.alert('You tapped the button!')}
    //     />
    // };
    //
    // _onPressButton() {
    //     Alert.alert('You tapped the button!')
    // }

    render() {
        return (
            <View>
                <ScrollView>
                    <Header/>
                    <View style={styles.favTitle}>
                        <Text style={styles.favTitleText}>Favorites</Text>
                    </View>
                    {/*<TouchableHighlight  onPress={() => { Actions.secondry(); }}>*/}
                        {/*<Text>Appp!</Text>*/}
                    {/*</TouchableHighlight>*/}
                    <View>
                        <SwipeActionView rightExpansionSettings={{buttonIndex: 0}}
                                         leftExpansionSettings={{buttonIndex: 0}}
                                         rightButtons={[{title: 'Red', color: 'rgb(255, 0, 0)', callback: () => {alert('Red button tapped.');}},
                                             {title: 'Green', color: 'rgb(0, 255, 0)', callback: () => {alert('Green button tapped.');}},
                                             {title: 'Blue', color: 'rgb(0, 0, 255)', callback: () => {alert('Blue button tapped.');}}]}
                                         leftButtons={[{title: 'Red', color: 'rgb(255, 0, 0)', callback: () => {alert('Red button tapped.');}},
                                             {title: 'Green', color: 'rgb(0, 255, 0)', callback: () => {alert('Green button tapped.');}},
                                             {title: 'Blue', color: 'rgb(0, 0, 255)', callback: () => {alert('Blue button tapped.');}}]}
                        >
                            <Text style={styles.actionViewText}>
                                Welcome to React Native!
                            </Text>
                            <Text style={styles.actionViewText}>
                                To get started, swipe this view.
                            </Text>
                            <Text style={styles.actionViewText}>
                                Tap on a button or swipe fully.
                            </Text>
                        </SwipeActionView>
                    </View>
                </ScrollView>
            </View>
        )
    }
}

const styles = StyleSheet.create({
    favTitle:{
        backgroundColor:'#fff',
        paddingTop:15,
        paddingBottom:15,
        paddingLeft:15,
    },
    favTitleText:{
        color:'#000',
        fontSize:20,
        fontWeight:'bold',
    },
    actionViewText:{
        backgroundColor:'red',
        paddingTop:15,
        paddingBottom:15,
    }
});

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.