wix-incubator / react-native-action-view Goto Github PK
View Code? Open in Web Editor NEWAn easy to use component that allows displaying swipeable buttons with a variety of transitions.
License: MIT License
An easy to use component that allows displaying swipeable buttons with a variety of transitions.
License: MIT License
When setting LeftButtons and RightButtons, RightButtons are not assigned. Instead, LeftButtons appear on both sides
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.
Get this for NativeModules.SwipeActionViewManager.SwipeTransitions
ios 14.1
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,
}
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.