20181229

最近有好多悲伤的事,比如有一件不能说,很无奈又必须得面对的事,比如有一件预感会被鸽,然后就是被鸽的事情。都很悲伤,从心底散发出来的悲伤。

20181211

不管多忙,永远不能停止思考,永远要保持大脑的活跃度和敏捷度,除了日常的游戏,还应该经常做做自己喜欢的题,现在事情变多了,也不能怠慢啊。
感觉事情越多越有挑战力呢٩(ˊᗜˋ*)و

解决React Native的WebView的文件上传问题

React Native:0.34.0

解决方案:https://github.com/Oblongmana/react-native-webview-file-upload-android

package.json

"react-native-webview-file-upload-android": "^1.1.2",

按照ReadMe弄下来以后,原生这边有点问题:

com.oblongmana.webviewfileuploadandroid的AndroidWebViewPackage修改为

public class AndroidWebViewPackage implements ReactPackage {
    private AndroidWebViewManager manager;
    private AndroidWebViewModule module;

    @Override public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
        manager = new AndroidWebViewManager();
        manager.setPackage(this);
        return Arrays.<ViewManager>asList(manager);
    }

    @Override public List<NativeModule> createNativeModules( ReactApplicationContext reactContext) {
        List<NativeModule> modules = new ArrayList<>();
        module = new AndroidWebViewModule(reactContext);
        module.setPackage(this);
        modules.add(module);
        return modules;
    }

    +@Override
    +public List<Class<? extends JavaScriptModule>> createJSModules() {
    +    return Collections.emptyList();
    +}

    public AndroidWebViewManager getManager(){
        return manager;
    }

    public AndroidWebViewModule getModule(){
        return module;
    }
}

node_modules里面要修改为
AndroidWebView.js

import React, {
  Component,
    PropTypes
} from 'react';
import ReactNative, {
  EdgeInsetsPropType,
  ActivityIndicator,
  StyleSheet,
  UIManager,
  View,
  requireNativeComponent,
} from 'react-native';
import WebViewShared from './WebViewShared';
import warning from 'warning';
import keyMirror from 'keymirror';
import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource';
// import PropTypes from 'prop-types';

...

static propTypes = {
    // ...View.PropTypes,
    renderError: PropTypes.func,
    renderLoading: PropTypes.func,
    onLoad: PropTypes.func,
    onLoadEnd: PropTypes.func,
    onLoadStart: PropTypes.func,
    onError: PropTypes.func,
    automaticallyAdjustContentInsets: PropTypes.bool,
    contentInset: EdgeInsetsPropType,
    onNavigationStateChange: PropTypes.func,
    onMessage: PropTypes.func,
    onContentSizeChange: PropTypes.func,
    startInLoadingState: PropTypes.bool, // force WebView to show loadingView on first load
    style: View.propTypes.style,


...

否则会出现 ‘style’ of undefined

20181203

对自己的病症状记录:

前天晚上醒来嗓子干疼,到周一感冒变成并发症,头部疼痛,四肢冰凉,头部发热,眼睛乏力,注意力无法集中,鼻子堵塞。

感想:冬天没躲过感冒,想想好好的时间又浪费了……