Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Memo/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["react-native"]
}
6 changes: 6 additions & 0 deletions Memo/.buckconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

[android]
target = Google Inc.:Google APIs:23

[maven_repositories]
central = https://repo1.maven.org/maven2
47 changes: 47 additions & 0 deletions Memo/.flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[ignore]
; We fork some components by platform
.*/*[.]android.js

; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*

; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
.*/Libraries/react-native/ReactNative.js

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow
flow/

[options]
emoji=true

module.system=haste

experimental.strict_type_args=true

munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-5]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-5]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

unsafe.enable_getters_and_setters=true

[version]
^0.45.0
1 change: 1 addition & 0 deletions Memo/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pbxproj -text
53 changes: 53 additions & 0 deletions Memo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# OSX
#
.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
*.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
1 change: 1 addition & 0 deletions Memo/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
135 changes: 135 additions & 0 deletions Memo/MemoEdit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/**
* Created by Think on 2017/7/4.
*/
import React, { Component } from 'react';
import {
StyleSheet,
Text,
TextInput,
ScrollView,
View,
TouchableNativeFeedback,
Dimensions,
} from 'react-native';

import { NativeRouter, Route, Link, AndroidBackButton, Redirect } from 'react-router-native';
import { Avatar, Button, Divider, Card } from 'react-native-material-design';

import { NavigationActions } from 'react-navigation';

export default class MemoEdit extends Component {
static navigationOptions = {
title: 'Tiny Memo',
};

constructor(props) {
super(props);

const { title, content, time } = this.props.navigation.state.params.memo;
const index = this.props.navigation.state.params.index;

this.state = {
title: title,
content: content,
time: new Date(),
index: index
}
}

handleRedirect = () => {


const navigateAction = NavigationActions.navigate({

routeName: 'Index',

params: {
memo: this.state,
index: this.state.index
},

action: NavigationActions.navigate({ routeName: 'index'})
});

this.props.navigation.dispatch(navigateAction);

// this.props.navigation.navigate('Index', {}, {
// memo: {
// title: this.state.title,
// content: this.state.content,
// time: new Date()
// },
// index: this.state.index
// })
};

handleDelete = () => {

};

render() {
return (
<View style={styles.container}>
<ScrollView>
<View style={styles.memo__title__container}>
<Text style={styles.memo__title}>Title:</Text>
<TextInput
autoFocus={true}
style={{height: 40, flex: 1}}
onChangeText={(title) => this.setState({title})}
value={this.state.title}
/>
</View>
<View style={styles.memo__content__container}>
<View>
<Text style={styles.memo__content}>Content: </Text>
<TextInput
style={{height: 80}}
onChangeText={(content) => this.setState({content})}
value={this.state.content}
multiline={true}
maxLength={1024}
/>
</View>
<Text>
Last Updated Time: {this.state.time.toLocaleString()}
</Text>
</View>
<Button text="删除" overrides={{
textColor: '#ffffff',
backgroundColor: '#00BCD4',
rippleColor: '#333333'
}} raised={true} value="delete" onPress={() => this.handleDelete()}/>
<Button text="保存" overrides={{
textColor: '#ffffff',
backgroundColor: '#00BCD4',
rippleColor: '#333333'
}} raised={true} value="save" onPress={() => this.handleRedirect()}/>
</ScrollView>
</View>
);
}
}

const styles = StyleSheet.create({
container: {
marginTop: 32,
marginLeft: 16,
},
memo__title__container: {
alignItems: 'center',
flexDirection: 'row',
},
memo__title: {
color: 'black',
},
memo__content__container: {
justifyContent: 'space-between',
},
memo__content: {
color: 'black',
},
memo__time: {
fontSize: 14
}
});
Loading