Пример #1
0
 componentDidUpdate(prevProps) {
   const {isOpen, platform} = this.props;
   if (prevProps.isOpen === isOpen) return;
   if (isOpen) {
     // Handle platform specific behavior.
     if (platform === 'ios')
       StatusBarIOS.setHidden(true, true);
     this.sideMenu.openMenu();
   }
   else {
     if (platform === 'ios')
       StatusBarIOS.setHidden(false, true);
     this.sideMenu.closeMenu();
   }
 }
export default function Init() {

  StatusBarIOS.setStyle('light-content')

  class Root extends Component {

    render() {
      return (
        <View style={styles.container}>
          <ScrollableTabView>
            <GridView tabLabel="Standard Grid" />
            <GridViewDimensions tabLabel="Dimensions Grid" />
            <GridViewFlex tabLabel="Flex Grid" itemsPerRow={3}/>
          </ScrollableTabView>
        </View>
      );
    }
  }

const styles = StyleSheet.create({
  container: {
    flex: 1,
  }
});

  AppRegistry.registerComponent('GridView', () => Root);
}
Пример #3
0
 render () {
   StatusBarIOS.setHidden(true)
   return (
     <View style={styles.container}>
       <Mapbox
         style={styles.map}
         direction={0}
         rotateEnabled={true}
         scrollEnabled={true}
         zoomEnabled={true}
         showsUserLocation={true}
         ref={mapRef}
         accessToken={secrets.development.mapboxToken}
         styleURL={this.mapStyles.emerald}
         userTrackingMode={this.userTrackingMode.none}
         centerCoordinate={this.state.center}
         zoomLevel={this.state.zoom}
         onRegionChange={this.onRegionChange}
         onRegionWillChange={this.onRegionWillChange}
         onUpdateUserLocation={this.onUpdateUserLocation}
         onLongPress={this.onLongPress}
          />
     </View>
   )
 }
Пример #4
0
 onSideMenuChange(isOpen) {
   const { device, onSideMenuChange } = this.props;
   if (device.platform === 'ios') {
     StatusBarIOS.setHidden(isOpen, true);
   }
   onSideMenuChange(isOpen);
 }
 constructor(props){
   StatusBarIOS.setHidden(true);
   super(props);
   this.state = {
     cca2: 'US'
   };
 }
Пример #6
0
 getInitialState: function () {
   StatusBarIOS.setStyle(0);
   return {
     selectedTab: this.props.isFirstTime==="1"? '我的帐户':'华大商城',
     isFirstTime: this.props.isFirstTime==="1"? true: false
   }
 },
Пример #7
0
    componentDidMount() {

        // StatusBarIOS sadece iOS'ta olan bir component. Bu yüzden StatusBarIOS'u kullanmadan
        // "if it's defined" check'i yapıyoruz! C/C++'taki NULL reference check'i gibi, 0'a karşı kontrol gibi...
        if (StatusBarIOS) {
            StatusBarIOS.setHidden(true, false);
        }

    }
Пример #8
0
 constructor(props) {
   super(props);
   this.state = {
     selectedNote: {},
     notes: {}
   };
   StatusBarIOS.setStyle('light-content');
   this.loadNotes();
 }
 addEventListener: function(
   type: string,
   handler: Function
 ) {
   _statusBarSizeHandlers[handler] = StatusBarIOS.addListener(
     DEVICE_STATUS_BAR_HEIGHT_EVENTS[type],
     (statusBarData) => {
       handler(statusBarData.frame.height);
     }
   );
 },
Пример #10
0
      .then(data => {
        var text = data.content;
        this.dispatch(EC.SERVER.TEXT_RECEIVE, {
          id: id,
          text: text
        });
        this.dispatch(EC.UI.SELECT_TEXT, text);

        StatusBarIOS.setNetworkActivityIndicatorVisible(false);

        return text;
      })
Пример #11
0
      .catch(err => {
        StatusBarIOS.setNetworkActivityIndicatorVisible(false);

        AlertIOS.alert(
          "Error",
          "Can't fetch article text. Please try again.",
          [
            {text: "OK", onPress: () => {}}
          ]
        );

        this.flux.actions.analytics.error({
          name: "Readability",
          request: "Fetch text",
          err: (err && err.response) ? JSON.parse(err.response.text || {}) : err
        });

        return Q.reject(err);
      });
Пример #12
0
      return Q();
    }

    if (!this.flux.stores.settings.isConnected()) {
      AlertIOS.alert(
        "Error",
        "You must be connected to the internet to fetch text.",
        [
          {text: "OK", onPress: () => {}}
        ]
      );

      return Q.reject();
    }

    StatusBarIOS.setNetworkActivityIndicatorVisible(true);
    var article = this.flux.stores.articles.getArticle(id);
    return api.readability.fetchText(article.resolved_url)
      .then(data => {
        var text = data.content;
        this.dispatch(EC.SERVER.TEXT_RECEIVE, {
          id: id,
          text: text
        });
        this.dispatch(EC.UI.SELECT_TEXT, text);

        StatusBarIOS.setNetworkActivityIndicatorVisible(false);

        return text;
      })
      .catch(err => {
Пример #13
0
 /*挂载*/
 componentDidMount(){
     /*设置状态颜色*/
     if(Platform.OS==='ios'){
         StatusBarIOS.setStyle('light-content');
     }
 }
    handler: Function
  ) {
    if (!_statusBarSizeHandlers[handler]) {
      return;
    }
    _statusBarSizeHandlers[handler].remove();
    _statusBarSizeHandlers[handler] = null;
  },

  currentHeight: (null : ?number),

};

StatusBarIOS.addListener(
  DEVICE_STATUS_BAR_HEIGHT_EVENTS.didChange,
  (statusBarData) => {
    StatusBarSizeIOS.currentHeight = statusBarData.frame.height;
  }
);
//Wrap in try catch to avoid error on android
try {
  StatusBarManager.getHeight(
    (statusBarFrameData) => {
      StatusBarSizeIOS.currentHeight = statusBarFrameData.height;
    }
  );
} catch (e) {

}

module.exports = StatusBarSizeIOS;
Пример #15
0
 componentDidMount() {
   if (StatusBarIOS) {
     StatusBarIOS.setStyle('light-content', true);
     StatusBarIOS.setHidden(false, 'fade');
   }
 }
Пример #16
0
 constructor(props) {
   super(props);
   StatusBarIOS.setStyle('light-content');
 }
Пример #17
0
import Store from 'react-native-simple-store';
import RCTDeviceEventEmitter from 'RCTDeviceEventEmitter';

import HappyPurchase from './App/Views/Purchase/HappyPurchase';
import Plan from './App/Views/Plan/Plan';
import UserCenter from './App/Views/User/UserCenter';
import ShoppingCart from './App/Views/Cart/ShoppingCart';
import Test from './App/Test/test';
import Util from './App/Common/Util';
import * as net from './App/Network/Interface';

import _updateConfig from './update.json';
const {appKey} = _updateConfig[Platform.OS];

StatusBarIOS.setHidden(false);

var somira = React.createClass({
  getDefaultProps () {
  },
  getInitialState(){
    this.getNotice();
    this.isShowPlan();
    this.getCartCount();
    return {
      selectedTab: '',
      notifyHpCartCount: 0,
      notifyPlanCartCount: 0,
      showPlan: false,
      notifyUserCount: 0,
      showModal: false,
Пример #18
0
 componentDidMount() {
   StatusBarIOS.setHidden(true);
 }
Пример #19
0
 componentDidMount() {
   if (StatusBarIOS && StatusBarIOS.setBarStyle) StatusBarIOS.setBarStyle('light-content');
 }
Пример #20
0
import WebViewScreen from './screens/web_view';
import Link, {SetNavigator} from './components/link';
import styles from './styles/base';
import _ from 'lodash';

import { NAVIGATOR_CHANGE } from './module_dal/actions/actions';

const SCREEN_WIDTH  = Dimensions.get('window').width;
const BaseConfig    = Navigator.SceneConfigs.FloatFromRight;
BaseConfig.gestures = {};

/**
 * Перекрашиваем текст в StatusBarIOS в белый цвет
 * незабыть добавить в info.plist -  UIViewControllerBasedStatusBarAppearance : NO
 */
StatusBarIOS.setStyle(1);

/**
 *
 * @type {{snapVelocity: number, edgeHitWidth: *}}
 */
const CustomLeftToRightGesture = {
  ...BaseConfig.gestures,
  snapVelocity: 8,
  edgeHitWidth: SCREEN_WIDTH
}

/**
 *
 * @type {{springTension: number, springFriction: number, gestures: {pop: {snapVelocity: number, edgeHitWidth: *}}}}
 */
Пример #21
0
 componentDidMount() {
   if (Platform.OS === 'ios') {
     StatusBarIOS.setHidden(true)
   }
 }
Пример #22
0
 getInitialState: function () {
   StatusBarIOS.setStyle(0);
   return({
     isFirstTime: this.props.isFirstTime
   })
 },
 componentDidMount() {
   StatusBarIOS.setStyle("light-content");
 }
Пример #24
0
 componentDidMount() {
   StatusBarIOS && StatusBarIOS.setStyle('light-content');
 }
Пример #25
0
 componentDidMount() {
   if (Platform.OS === 'ios') StatusBarIOS.setStyle('light-content');
   this.props.soundActions.soundsInit();
   this.props.themeActions.getTheme();
 }
Пример #26
0
import { StatusBarIOS, Platform } from 'react-native';
import constants from '../constants';
import { createReducer } from '../utils';

let initialState = {};

const settingReducers = {
  toggleMenu(state, bool) {
    if (Platform.OS === 'ios') {
      StatusBarIOS.setHidden(bool, 'slide');
    }
    return state;
  }
};

export default createReducer(initialState, {
  [constants.SETTINGS_MENU]: (state, action) => settingReducers.toggleMenu(state, action.bool)
});
Пример #27
0
 componentDidMount() {
   StatusBarIOS.setStyle(1);
 }
Пример #28
0
 componentWillMount() {
     StatusBarIOS.setHidden(true);
 }
Пример #29
0
'use strict';

import React, {
    AppRegistry,
    Component,
    Navigator,
    StatusBarIOS,
} from 'react-native';

import SimpleStore from 'react-native-simple-store';

import MainMenuScreen from './src/main-menu-screen.js';

SimpleStore.save('currentStreak', 0);

StatusBarIOS.setStyle('light-content');

class QuizGame extends Component {
    render() {
        return (
            <Navigator
                initialRoute={{name: 'MainMenuScreen', component: MainMenuScreen}}
                configureScene={() => {
                        return Navigator.SceneConfigs.FloatFromRight;
                }}
                renderScene={(route, navigator) => {
                        if (route.component) {
                                return React.createElement(route.component, { navigator });
                        }
                }}
            />
Пример #30
0
    navigator.geolocation.getCurrentPosition(
      position => this.updateLocation,
      error => console.log(error.message),
      locationOpts
    );
    this.watchID = navigator.geolocation.watchPosition(
      this.updateLocation,
      error => console.log(error.message),
      locationOpts
    );

    // Statusbar style
    if (Platform.OS === 'ios') {

      StatusBarIOS.setHidden(false)
      StatusBarIOS.setStyle('light-content')

      // check for updates when app is resumed
      AppStateIOS.addEventListener('change', state => {
        if (state === 'active') {
          checkForUpdates();
        }
      });

      // and check once on startup
      checkForUpdates();
    }
  },

  componentWillUnmount() {