{"size": 1733, "ext": "js", "max_stars_repo_path": "src/main/ToolbarAndroidLoading.js", "max_stars_repo_name": "lengrensheng/gallery-react", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/main/ToolbarAndroidLoading.js", "max_issues_repo_name": "lengrensheng/gallery-react", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/main/ToolbarAndroidLoading.js", "max_forks_repo_name": "lengrensheng/gallery-react", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.2575757576, "max_line_length": 87, "alphanum_fraction": 0.499711483}
/**
 * Created by tiang on 2016/5/15.
 */
import React,{
    Text,
    View,
    Image,
    ToolbarAndroid,
    StyleSheet
}from 'react-native';

var toolbarActions = [
    {title: 'Create', icon: require('image!ic_create_black_48dp'), show: 'always'},
    {title: 'Filter'},
    {title: 'Settings', icon: require('image!ic_settings_black_48dp'), show: 'always'},
]
var ToolbarExample = React.createClass({
    getInitialState(){
        return {
            actionText: 'Example app with toolbar component',
            colorProps: {
                titleColor: '#3b5995',
                subtitleColor: '#6a7180'
            }
        }
    },
    _onActionSelected(position){
        this.setState({
            actionText: 'Selected:' + toolbarActions[position].title,
        });
    },
    render(){
        return (
            <View>
                <ToolbarAndroid
                    actions={toolbarActions}
                    navIcon={require('image!ic_menu_black_24dp')}
                    onActionSelected={this._onActionSelected}
                    onIconClicked={()=>{
                        this.setState({
                            actionText:'icon clicked',
                        });
                    }}
                    style={styles.toolbar}
                    subtitle={this.state.actionText}
                    title="ToolbarAndroid"/>
                <Text>{this.state.actionText}</Text>
            </View>
        )
    }
});
export default class ToolbarAndroidLoading extends ToolbarAndroid {
    render() {
        return (
            <ToolbarExample/>
        );
    }
}

var styles = StyleSheet.create({
    toolbar: {
        backgroundColor: '#e9eaed',
        height: 56,
    },
});
