Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit fbd917b

Browse files
authored
Merge pull request #147 from BoostIO/new-style
New style
2 parents f5bb7d8 + a87b997 commit fbd917b

File tree

18 files changed

+467
-373
lines changed

18 files changed

+467
-373
lines changed

android/app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ android {
138138
}
139139

140140
dependencies {
141+
compile project(':react-native-svg')
141142
compile project(':react-native-device-info')
142143
compile project(':react-native-code-push')
143144
compile project(':react-native-fetch-blob')

android/app/src/main/java/io/boostnote/MainApplication.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44

55
import com.RNFetchBlob.RNFetchBlobPackage;
66
import com.facebook.react.ReactApplication;
7+
import com.horcrux.svg.SvgPackage;
78
import com.facebook.react.ReactNativeHost;
89
import com.facebook.react.ReactPackage;
910
import com.facebook.soloader.SoLoader;
1011
import com.learnium.RNDeviceInfo.RNDeviceInfo;
1112
import com.microsoft.codepush.react.CodePush;
13+
import com.horcrux.svg.SvgPackage;
1214

1315
import java.util.Arrays;
1416
import java.util.List;
@@ -33,7 +35,8 @@ protected List<ReactPackage> getPackages() {
3335
new MyMainReactPackage(),
3436
new RNDeviceInfo(),
3537
new RNFetchBlobPackage(),
36-
new CodePush("byLfL38UaCCfKxo_2kTLHuR190e81a2d16b3-a6fd-494f-8deb-050bb34a68be", MainApplication.this, BuildConfig.DEBUG)
38+
new CodePush("byLfL38UaCCfKxo_2kTLHuR190e81a2d16b3-a6fd-494f-8deb-050bb34a68be", MainApplication.this, BuildConfig.DEBUG),
39+
new SvgPackage()
3740
);
3841
}
3942
};

android/settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
rootProject.name = 'boostnotemobile'
2+
include ':react-native-svg'
3+
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
24
include ':react-native-device-info'
35
project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')
46
include ':react-native-fetch-blob'

app/App.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@ const DEFAULT_FOLDER = "DEFAULT_FOLDER"
3737

3838
const styles = {
3939
iosHeader: {
40-
backgroundColor: '#239F85',
40+
backgroundColor: '#f9f9f9',
4141
},
4242
androidHeader: {
43-
backgroundColor: '#29BB9C',
43+
backgroundColor: '#f9f9f9',
4444
height: 70
4545
},
4646
iOsAppName: {
47-
color: '#ffffff',
48-
fontSize: 21,
49-
fontWeight: '300',
47+
color: '#1ec38b',
48+
fontSize: 18,
49+
fontWeight: '600',
5050
},
5151
androidAppName: {
52-
color: '#ffffff',
53-
fontSize: 21,
54-
fontWeight: '300',
52+
color: '#1ec38b',
53+
fontSize: 18,
54+
fontWeight: '600',
5555
},
5656
headerMenuButton: {
57-
color: '#ffffff',
57+
color: '#1ec38b',
5858
fontSize: 24,
5959
},
6060
headerRightMenuButton: {
@@ -80,7 +80,7 @@ const styles = {
8080
display: 'flex',
8181
alignItems: 'center',
8282
justifyContent: 'center',
83-
backgroundColor: '#D15419',
83+
backgroundColor: '#1ec38b',
8484
width: 60,
8585
height: 60,
8686
borderRadius: 50,
@@ -337,7 +337,7 @@ export default class App extends Component {
337337
<Left>
338338
<View>
339339
<Button transparent onPress={this.openDrawer}>
340-
<Icon name='md-list' style={styles.headerMenuButton}/>
340+
<Icon name='md-reorder' style={styles.headerMenuButton}/>
341341
</Button>
342342
</View>
343343
</Left>
@@ -347,7 +347,7 @@ export default class App extends Component {
347347
<Title style={Platform.OS === 'android' ? styles.androidAppName : styles.iOsAppName}>
348348
{
349349
mode === 0
350-
? 'NOTES'
350+
? 'All Notes'
351351
: 'Dropbox'
352352
}
353353
</Title>
@@ -380,7 +380,7 @@ export default class App extends Component {
380380
onPress={() => this.onPressActionButton()}
381381
style={styles.newPostButtonWrap}>
382382
<View style={styles.newPostButton}>
383-
<Icon name='md-create' style={{color: "#fff"}}/>
383+
<Icon name='md-add' style={{color: "#fff"}}/>
384384
</View>
385385
</Button>
386386
<NoteModal setIsOpen={this.setNoteModalIsOpen}
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

app/views/note/NoteModal.js

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,34 @@ import NoteInputSupport from './inputSupport/NoteInputSupport'
3434
const styles = {
3535
switchButton: {
3636
backgroundColor: 'transparent',
37-
borderColor: '#EFF1F5',
37+
borderColor: '#1ec38b',
3838
borderWidth: 1
3939
},
4040
switchButtonActive: {
4141
backgroundColor: '#EFF1F5',
42-
borderColor: '#EFF1F5',
42+
borderColor: '#1ec38b',
4343
borderWidth: 1
4444
},
45+
switchEditButton: {
46+
position:'absolute',
47+
width: 40,
48+
right: 20
49+
},
50+
switchEditText: {
51+
color: '#1ec38b',
52+
fontSize: 16,
53+
lineHeight: 16
54+
},
4555
noteDetailButton: {
46-
color: '#EFF1F5',
56+
color: '#1ec38b',
4757
fontSize: 23
4858
},
59+
backHomeText: {
60+
color: '#1ec38b',
61+
fontSize: 17,
62+
lineHeight: 17,
63+
paddingLeft: 10
64+
}
4965
}
5066

5167
export default class NoteModal extends React.Component {
@@ -57,7 +73,7 @@ export default class NoteModal extends React.Component {
5773
fileName: this.props.fileName,
5874
text: this.props.content,
5975
height: 0,
60-
isLeftSegmentActive: true,
76+
isEditting: true,
6177
visibleHeight: 230,
6278
endOfSelection: 0,
6379
}
@@ -73,7 +89,7 @@ export default class NoteModal extends React.Component {
7389

7490
// if user open an another file, set state.
7591
this.setState({
76-
isLeftSegmentActive: true,
92+
isEditting: true,
7793
fileName: props.fileName,
7894
text: props.content,
7995
})
@@ -110,7 +126,7 @@ export default class NoteModal extends React.Component {
110126
}
111127

112128
getNoteComponent() {
113-
if (this.state.isLeftSegmentActive) {
129+
if (this.state.isEditting) {
114130
return <View style={{flex: 1}}>
115131
<ScrollView keyboardShouldPersistTaps='always'>
116132
<TextInput
@@ -184,6 +200,12 @@ export default class NoteModal extends React.Component {
184200
this.onChangeText(lines.join('\n'))
185201
}
186202

203+
handleSwitchEditButtonClick () {
204+
this.setState({
205+
isEditting: !this.state.isEditting
206+
})
207+
}
208+
187209
render() {
188210
return (
189211
<Modal
@@ -193,33 +215,24 @@ export default class NoteModal extends React.Component {
193215
swipeToClose={false}
194216
onClosed={() => this.props.setIsOpen('', false)}>
195217
<Container>
196-
<Header style={Platform.OS === 'android' ? {height: 47,backgroundColor: '#6C81A6'} : {backgroundColor: '#6C81A6'}} androidStatusBarColor='#239F85'>
218+
<Header style={Platform.OS === 'android' ? {height: 47,backgroundColor: '#f9f9f9'} : {backgroundColor: '#f9f9f9'}} androidStatusBarColor='#239F85'>
197219
<Left style={Platform.OS === 'android' ? {top: 0} : null}>
198220
<Button transparent onPress={() => this.props.setIsOpen('', false)}>
199-
<Text><Icon name='md-close' style={styles.noteDetailButton}/></Text>
221+
<Text><Icon name='ios-arrow-back' style={styles.noteDetailButton}/></Text>
222+
<Text style={styles.backHomeText}>All Notes</Text>
200223
</Button>
201224
</Left>
202225

203-
<Body style={Platform.OS === 'android' ? {top: 0} : null}>
204-
<Segment style={Platform.OS === 'android' ? {paddingRight: 25, position: 'relative', backgroundColor: 'transparent', borderWidth:1} : {marginLeft: 50, position: 'absolute', top: -22, backgroundColor: 'transparent'}}>
205-
<Button onPress={() => {
206-
this.setState({isLeftSegmentActive: true})
207-
}} first active={this.state.isLeftSegmentActive}
208-
style={this.state.isLeftSegmentActive ? styles.switchButtonActive : styles.switchButton}>
209-
<Text><Icon name='create' style={this.state.isLeftSegmentActive ? {color: '#6C81A6'} : {}}/></Text>
210-
</Button>
211-
<Button onPress={() => {
212-
this.setState({isLeftSegmentActive: false})
213-
}} last active={!this.state.isLeftSegmentActive}
214-
style={this.state.isLeftSegmentActive ? styles.switchButton : styles.switchButtonActive}>
215-
<Text><Icon name='eye' style={this.state.isLeftSegmentActive ? {color: '#EFF1F5'} : {color: '#6C81A6'}}/></Text>
216-
</Button>
217-
</Segment>
218-
</Body>
219-
220-
<Right style={Platform.OS === 'android' ? {top: 0} : {top: 3}}>
226+
<Right style={Platform.OS === 'android' ? {top: 0} : {top: 3, flex: 1, flexDirection: 'row'}}>
221227
<View>
222228
<Root>
229+
<Button transparent
230+
style={styles.switchEditButton}
231+
onPress={this.handleSwitchEditButtonClick.bind(this)}>
232+
<Text style={styles.switchEditText}>
233+
{this.state.isEditting ? 'Done' : 'Edit'}
234+
</Text>
235+
</Button>
223236
<Button transparent onPress={() => ActionSheet.show(
224237
{
225238
options: ["Delete", "Cancel"],

0 commit comments

Comments
 (0)