XnUploadLoading.js 1.63 KB
/**
 * Created by DEV005 on 2017/10/27.
 */
import React, { Component } from 'react';
import { BackHandler, AppState, StyleSheet, View, Text
    , NativeModules, AsyncStorage, NavigationActions,
    ActivityIndicator, TouchableOpacity, Image, Touch, Platform, Dimensions, Modal,
} from 'react-native';

import { getHeaderHeight, getHeaderPadding, xnBorderWidth } from '../utils/utils';
import { height, width } from '../utils/publiscStyle';
import PercentageCircle from 'react-native-percentage-circle';

const zoom = 750 / parseInt(Dimensions.get('window').width);

export default class xnLoading extends Component {

  constructor(props) {
    super(props);
    this.state = {
    };
  }

  componentDidMount() {
  }
  onRequestClose=() => {

  }

  render() {
    return (
      <View style={styles.xnLoading}>
        <View style={styles.xnLoadingBd} >
          <PercentageCircle radius={50 / zoom} percent={this.props.progressNum || 0} color={'#c72a15'} />
          <Text style={styles.xnLoadingBdText}>上传中...</Text>
        </View>
      </View>
    );
  }

}

const styles = StyleSheet.create({

  xnLoading: {
    position: 'absolute',
    top: 0,
    left: 0,
    right: 0,
    bottom: 0,
    backgroundColor: 'transparent',
    alignItems: 'center',
    justifyContent: 'center',
  },

  xnLoadingBd: {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center',
    width: Dimensions.get('window').width / 2.5,
    height: Dimensions.get('window').width / 2.5,
    borderRadius: 20 / zoom,
    backgroundColor: 'rgba(0, 0, 0, 0.25)',
  },
  xnLoadingBdText: {
    marginLeft: 30 / zoom,
    fontSize: 14,
    color: '#fff',
  },
});