Last active
September 23, 2016 10:45
-
-
Save yeknava/4a3255c0e917e6f75de48a8c83258397 to your computer and use it in GitHub Desktop.
Revisions
-
yeknava revised this gist
Sep 23, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ```` import React, { Component } from 'react'; import { Text, View, StyleSheet } from 'react-native'; @@ -52,4 +52,4 @@ var styles = StyleSheet.create({ color: '#fff', } }); ```` -
yeknava revised this gist
Sep 23, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ```javascript import React, { Component } from 'react'; import { Text, View, StyleSheet } from 'react-native'; -
yeknava revised this gist
Sep 23, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ``` import React, { Component } from 'react'; import { Text, View, StyleSheet } from 'react-native'; @@ -52,4 +52,4 @@ var styles = StyleSheet.create({ color: '#fff', } }); ``` -
yeknava created this gist
Sep 23, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,55 @@ ```` import React, { Component } from 'react'; import { Text, View, StyleSheet } from 'react-native'; export default class ProgressBar extends Component { constructor(props) { super(props); this.state = { }; } render() { var color = this.props.color; var percentage = this.props.percentage; var emptyProgressBar = parseFloat(1-this.props.percentage); var direction = this.props.direction == 'right' || this.props.direction == 'rtl' ? 'row-reverse' : 'row'; return ( <View style={[styles.progress, {flexDirection:direction}]}> <View style={[styles.progressBar, {flex:percentage, backgroundColor:color}]}> <Text style={styles.text}> {this.props.title} </Text> </View> <View style={[styles.emptyProgressBar, {flex:emptyProgressBar}]}> </View> </View> ); } }; var styles = StyleSheet.create({ progress: { height: 20, marginBottom: 20, overflow: 'hidden', backgroundColor: '#f5f5f5', borderRadius: 4, flex: 1, alignItems: 'stretch', flexDirection: 'row' }, progressBar: { backgroundColor: 'red', alignItems: 'center', borderRadius: 4, }, emptyProgressBar: { backgroundColor: '#f5f5f5', borderRadius: 4, }, text: { color: '#fff', } }); ````