From ea997ff4f06806e63f4dbae18a7c90a99d655593 Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Mon, 11 Sep 2017 11:26:18 -0500 Subject: [PATCH] Thememing progress --- .../java/com/sn_react/MainApplication.java | 2 - index.android.js | 3 +- index.ios.js | 3 +- src/Styles.js | 244 ++++++++++-------- src/app.js | 78 +++--- src/components/SectionedAccessoryTableCell.js | 4 +- src/containers/NoteCell.js | 160 ++++++------ src/containers/NoteList.js | 14 +- src/img/placeholder.png | Bin 0 -> 17706 bytes src/screens/Account.js | 14 +- src/screens/Compose.js | 110 ++++---- src/screens/Filter.js | 5 +- src/screens/Notes.js | 8 +- 13 files changed, 343 insertions(+), 302 deletions(-) create mode 100644 src/img/placeholder.png diff --git a/android/app/src/main/java/com/sn_react/MainApplication.java b/android/app/src/main/java/com/sn_react/MainApplication.java index 92d67b89..e28e0b77 100644 --- a/android/app/src/main/java/com/sn_react/MainApplication.java +++ b/android/app/src/main/java/com/sn_react/MainApplication.java @@ -3,7 +3,6 @@ package com.sn_react; import android.app.Application; //import com.facebook.react.ReactApplication; -import com.reactnativenavigation.NavigationReactPackage; import com.oblador.keychain.KeychainPackage; import com.oblador.vectoricons.VectorIconsPackage; import com.tectiv3.aes.RCTAesPackage; @@ -31,7 +30,6 @@ public class MainApplication extends NavigationApplication { protected List getPackages() { return Arrays.asList( new MainReactPackage(), - new NavigationReactPackage(), new KeychainPackage(), new VectorIconsPackage(), new RCTAesPackage() diff --git a/index.android.js b/index.android.js index bc74c5f1..c81e3790 100644 --- a/index.android.js +++ b/index.android.js @@ -1 +1,2 @@ -import App from './src/app'; +import App from './src/App'; +App.get().start(); diff --git a/index.ios.js b/index.ios.js index bc74c5f1..c81e3790 100644 --- a/index.ios.js +++ b/index.ios.js @@ -1 +1,2 @@ -import App from './src/app'; +import App from './src/App'; +App.get().start(); diff --git a/src/Styles.js b/src/Styles.js index 67007c21..5dbb7e4a 100644 --- a/src/Styles.js +++ b/src/Styles.js @@ -1,6 +1,7 @@ var _ = require('lodash') -import { StyleSheet } from 'react-native'; +import { StyleSheet, StatusBar } from 'react-native'; +import App from "./App" export default class Styles { @@ -15,123 +16,156 @@ export default class Styles { } static styles() { - return this.get()._styles.rules; + return this.get().styles.rules; } static constants() { - return this.get()._styles.constants; + return this.get().styles.constants; } constructor() { - this._styles = defaultStyles; + this.loadDefaults(); + } - setTimeout(function () { - this.changeTheme(); - }.bind(this), 1000); + loadDefaults() { + var constants = this.defaultConstants(); + this.setStyles(this.defaultRules(constants), constants, "dark-content"); + } + + setStyles(rules, constants, statusBar) { + this.constants = constants; + this.styles = { + rules: StyleSheet.create(rules), + constants: constants + } + + StatusBar.setBarStyle(statusBar, true); } changeTheme() { var theme = { constants: { - mainTintColor: "green" - } + mainTintColor: "#a366c3", + mainBackgroundColor: "#0f0f0f", + mainTextColor: "white", + plainCellBorderColor: "#1b1b1b", + selectedBackgroundColor: "#a366c3", + composeBorderColor: "#1b1b1b" + }, + + rules: { + + }, + + statusBar: "light-content" } - this._styles = _.merge(defaultStyles, theme); + var constants = _.merge(this.defaultConstants(), theme.constants); + var rules = _.merge(this.defaultRules(constants), theme.rules); + this.setStyles(rules, constants, theme.statusBar); + + console.log("New styles", this.styles); + App.get().reload(); } -} - -let mainTintColor = "#fb0206"; -let PaddingLeft = 14; - -const constants = { - themeColor: "#086DD6", - mainBackgroundColor: "white", - mainTintColor: mainTintColor, - plainCellBorderColor: "#efefef", - sectionedCellHorizontalPadding: PaddingLeft, - textColor: "black", -} - -const defaultStyles = { - rules: StyleSheet.create({ - - container: { - backgroundColor: "white", - height: "100%", - }, - - tableSection: { - marginTop: 10, - marginBottom: 10, - }, - - sectionHeader: { - color: "gray", - fontSize: 12, - paddingLeft: PaddingLeft, - paddingBottom: 10, - paddingTop: 10 - }, - - sectionedTableCell: { - borderBottomColor: "#ebebf0", - borderBottomWidth: 1, - paddingLeft: PaddingLeft, - paddingTop: 13, - backgroundColor: "white", - height: 45 - }, - - sectionedTableCellTextInput: { - fontSize: 16, - height: "100%" - }, - - sectionedTableCellFirst: { - borderTopColor: "#ebebf0", - borderTopWidth: 1, - }, - - sectionedAccessoryTableCell: { - paddingLeft: PaddingLeft, - paddingRight: PaddingLeft, - }, - - sectionedAccessoryTableCellLabel: { - paddingTop: 12, - fontSize: 16, - color: constants.textColor - }, - - textInputCell: { - paddingTop: 0 - }, - - buttonCell: { - paddingLeft: 0, - paddingTop: 0 - }, - - buttonCellButton: { - textAlign: "center", - color: mainTintColor, - fontSize: 15, - height: "100%", - paddingTop: 13 - }, - - buttonCellButtonLeft: { - textAlign: "left", - paddingLeft: PaddingLeft - }, - - bold: { - fontWeight: "bold" - }, - - - }), - - constants: constants + + + defaultConstants() { + return { + themeColor: "#086DD6", + mainBackgroundColor: "white", + mainTintColor: "#fb0206", + plainCellBorderColor: "#efefef", + sectionedCellHorizontalPadding: 14, + mainTextColor: "black", + selectedBackgroundColor: "#efefef", + paddingLeft: 14, + composeBorderColor: "#F5F5F5" + } + } + + defaultRules(constants) { + return { + container: { + backgroundColor: constants.mainBackgroundColor, + height: "100%", + }, + + view: { + backgroundColor: constants.mainBackgroundColor, + }, + + tableSection: { + marginTop: 10, + marginBottom: 10, + backgroundColor: constants.mainBackgroundColor, + }, + + sectionHeader: { + color: "gray", + fontSize: 12, + paddingLeft: constants.paddingLeft, + paddingBottom: 10, + paddingTop: 10 + }, + + sectionedTableCell: { + borderBottomColor: constants.plainCellBorderColor, + borderBottomWidth: 1, + paddingLeft: constants.paddingLeft, + paddingTop: 13, + backgroundColor: constants.mainBackgroundColor, + height: 45 + }, + + sectionedTableCellTextInput: { + fontSize: 16, + height: "100%" + }, + + sectionedTableCellFirst: { + borderTopColor: constants.plainCellBorderColor, + borderTopWidth: 1, + }, + + sectionedAccessoryTableCell: { + paddingLeft: constants.paddingLeft, + paddingRight: constants.paddingLeft, + backgroundColor: constants.mainBackgroundColor + }, + + sectionedAccessoryTableCellLabel: { + paddingTop: 12, + fontSize: 16, + color: constants.mainTextColor + }, + + textInputCell: { + paddingTop: 0 + }, + + buttonCell: { + paddingLeft: 0, + paddingTop: 0, + backgroundColor: constants.mainBackgroundColor, + }, + + buttonCellButton: { + textAlign: "center", + color: constants.mainTintColor, + fontSize: 15, + height: "100%", + paddingTop: 13 + }, + + buttonCellButtonLeft: { + textAlign: "left", + paddingLeft: constants.paddingLeft + }, + + bold: { + fontWeight: "bold" + }, + } + } + } diff --git a/src/app.js b/src/app.js index ddc50bce..d7f0a17e 100644 --- a/src/app.js +++ b/src/app.js @@ -8,15 +8,12 @@ import React, { Component } from 'react'; import { AppRegistry, StyleSheet, - StatusBar, Text, View, FlatList } from 'react-native'; import {Platform} from 'react-native'; -StatusBar.setBarStyle('dark-content', true); - import {Navigation} from 'react-native-navigation'; import {registerScreens, registerScreenVisibilityListener} from './screens'; @@ -25,9 +22,6 @@ import Sync from './lib/sync' import GlobalStyles from "./Styles" -registerScreens(); -registerScreenVisibilityListener(); - const tabs = [{ label: 'Notes', screen: 'sn.Notes', @@ -40,31 +34,53 @@ const tabs = [{ } ]; -function startApp() { - Navigation.startTabBasedApp({ - tabs, - animationType: Platform.OS === 'ios' ? 'slide-down' : 'fade', - - tabsStyle: { - tabBarBackgroundColor: GlobalStyles.constants().mainBackgroundColor, - tabBarButtonColor: 'gray', - tabBarSelectedButtonColor: GlobalStyles.constants().mainTintColor, - statusBarColor: 'black', - tabFontFamily: 'BioRhyme-Bold', - }, - - appStyle: { - navBarButtonColor: GlobalStyles.constants().mainTintColor, - navBarTextColor: GlobalStyles.constants().mainTintColor, - navigationBarColor: 'black', // android built in bar - navBarBackgroundColor: GlobalStyles.constants().mainBackgroundColor, // actual top nav bar - statusBarColor: '#002b4c', - }, - }); +// android will fail to load if icon is not specified here +if(Platform.OS === "android") { + tabs.forEach(function(tab){ + tab.icon = require("./img/placeholder.png") + }) } -startApp(); +registerScreens(); +registerScreenVisibilityListener(); -setTimeout(function () { - // startApp(); -}, 1500); +export default class App { + + static instance = null; + + static get() { + if (this.instance == null) { + this.instance = new App(); + } + + return this.instance; + } + + start() { + Navigation.startTabBasedApp({ + tabs, + animationType: Platform.OS === 'ios' ? 'slide-down' : 'fade', + + tabsStyle: { + tabBarBackgroundColor: GlobalStyles.constants().mainBackgroundColor, + tabBarButtonColor: 'gray', + tabBarSelectedButtonColor: GlobalStyles.constants().mainTintColor, + statusBarColor: 'black', + tabFontFamily: 'BioRhyme-Bold', + }, + + appStyle: { + navBarButtonColor: GlobalStyles.constants().mainTintColor, + navBarTextColor: GlobalStyles.constants().mainTintColor, + navigationBarColor: 'black', // android built in bar + navBarBackgroundColor: GlobalStyles.constants().mainBackgroundColor, // actual top nav bar + statusBarColor: '#002b4c', + screenBackgroundColor: GlobalStyles.constants().mainBackgroundColor + }, + }); + } + + reload() { + this.start(); + } +} diff --git a/src/components/SectionedAccessoryTableCell.js b/src/components/SectionedAccessoryTableCell.js index 1af559c5..240eb1ac 100644 --- a/src/components/SectionedAccessoryTableCell.js +++ b/src/components/SectionedAccessoryTableCell.js @@ -9,7 +9,7 @@ import Icon from 'react-native-vector-icons/Ionicons'; export default class SectionedAccessoryTableCell extends SectionedTableCell { rules() { - return super.rules().concat([GlobalStyles.styles().sectionedAccessoryTableCell]); + return super.rules().concat([GlobalStyles.styles().view, GlobalStyles.styles().sectionedAccessoryTableCell]); } onPress = () => { @@ -26,7 +26,7 @@ export default class SectionedAccessoryTableCell extends SectionedTableCell { render() { var iconName = (this.props.selected && this.props.selected()) ? "ios-checkmark-circle" : null; return ( - + {this.props.text} {iconName && diff --git a/src/containers/NoteCell.js b/src/containers/NoteCell.js index db6ea3c1..6c913fe6 100644 --- a/src/containers/NoteCell.js +++ b/src/containers/NoteCell.js @@ -4,9 +4,81 @@ import Icon from 'react-native-vector-icons/Ionicons'; import GlobalStyles from "../Styles" export default class NoteCell extends React.PureComponent { + + constructor(props) { super(props); this.state = {selected: false}; + + let Padding = 14; + + this.styles = StyleSheet.create({ + + noteCell: { + padding: Padding, + paddingRight: Padding * 2, + borderBottomColor: GlobalStyles.constants().plainCellBorderColor, + borderBottomWidth: 1, + backgroundColor: GlobalStyles.constants().mainBackgroundColor, + }, + + noteCellSelected: { + backgroundColor: GlobalStyles.constants().selectedBackgroundColor, + }, + + noteTags: { + flex: 1, + flexDirection: 'row', + marginBottom: 5, + }, + + pinnedView: { + flex: 1, + flexDirection: 'row', + marginBottom: 5, + }, + + pinnedText: { + color: GlobalStyles.constants().mainTintColor, + marginLeft: 8, + fontWeight: "bold", + fontSize: 12 + }, + + noteTag: { + marginRight: 2, + fontSize: 12, + color: GlobalStyles.constants().mainTextColor, + opacity: 0.5, + }, + + noteTitle: { + fontWeight: "bold", + fontSize: 16, + color: GlobalStyles.constants().mainTextColor + }, + + + noteText: { + fontSize: 15, + marginTop: 4, + color: GlobalStyles.constants().mainTextColor + }, + + + noteDate: { + marginTop: 5, + fontSize: 12, + color: GlobalStyles.constants().mainTextColor, + opacity: 0.5 + }, + + deleting: { + color: GlobalStyles.constants().mainTintColor, + marginBottom: 5, + + } + }); } _onPress = () => { @@ -43,22 +115,22 @@ export default class NoteCell extends React.PureComponent { var note = this.props.item; return ( - + {note.deleted && - Deleting... + Deleting... } {note.pinned && - + - Pinned + Pinned } {note.tags.length > 0 && - - + + {note.tags.map(function(tag, i){ var text = "#" + tag.title; if(i != note.tags.length - 1) { @@ -71,87 +143,17 @@ export default class NoteCell extends React.PureComponent { } {note.safeTitle().length > 0 && - {note.title} + {note.title} } {note.safeText().length > 0 && - {note.text} + {note.text} } - {note.createdAt()} + {note.createdAt()} ) } } - -let Padding = 14; - -const styles = StyleSheet.create({ - - - noteCell: { - padding: Padding, - paddingRight: Padding * 2, - borderBottomColor: GlobalStyles.constants().plainCellBorderColor, - borderBottomWidth: 1 - }, - - noteCellSelected: { - backgroundColor: "#efefef", - }, - - noteTags: { - flex: 1, - flexDirection: 'row', - marginBottom: 5, - }, - - pinnedView: { - flex: 1, - flexDirection: 'row', - marginBottom: 5, - }, - - pinnedText: { - color: GlobalStyles.constants().mainTintColor, - marginLeft: 8, - fontWeight: "bold", - fontSize: 12 - }, - - noteTag: { - marginRight: 2, - fontSize: 12, - color: "black", - opacity: 0.5, - }, - - noteTitle: { - fontWeight: "bold", - fontSize: 16, - color: "black" - }, - - - noteText: { - fontSize: 15, - marginTop: 4, - color: "black" - }, - - - noteDate: { - marginTop: 5, - fontSize: 12, - color: "black", - opacity: 0.5 - }, - - deleting: { - color: GlobalStyles.constants().mainTintColor, - marginBottom: 5, - - } -}); diff --git a/src/containers/NoteList.js b/src/containers/NoteList.js index 8bf505bc..ee4d01cc 100644 --- a/src/containers/NoteList.js +++ b/src/containers/NoteList.js @@ -8,7 +8,7 @@ export default class NoteList extends Component { renderHeader = () => { return ( - + + OwnX@paPrjs7XZk)vq+@X ztNl3w4&R@{ML3a22riGqUD?v*^59`lZt#XAfo_aJmR941GBaRn{VjogaUg~fO+*$tM;$Vk0Fex*!@&Ts(N-5lzExsbF9QI!nNj*@tu@|M&o`)&T2%dG zN45Ni&8B;7bZcvDRBYtvk&Aenmly1^(Tiz3tEs;k{kxT>ag~REOd?kaRpWh0$%3o= zjw+K;tyd8xJInfp%v`EgTbzX7K8nsk8TFLt5v^*+S#$R5B5uab^U!uqFmc3s?js|- z9W@6nct7A`*V|uCSa}05-1Q-*!U20Es@TKgcZCb2vK+I8d+blj-=Pbzsqt!=X?J+% z7g`)JJ<)q7-(R^co=B?4RK1ulZB!eGLDgNeIcIJln@DRor(K|sU$^k=ngYr4y>DsF z=R#)9iL$GbHJue=gP<<9cBHsa+#WjSAQtHw&u)`7la<`#QL{`tF~|A*(#x~|sh#g< zh>fK<8tB}g6F(QNvOSJeYo)yMRe18~-G%<@{==*@F9eroKR&wHE$NO= zYeS#Ii=-ElZ$cClV^nw7$1(L5q|KL}&s-2P|4g#W=>>Q9FQ_MD%&@PLdsCECINlWf zQvDsO3Af~qt~$E(sD?h8oSSz#?@6A#_mFo3IX-uz*Uln)ZzHd+T-o1`<$LF)uYTpF z;l<2dnG>7G%;AtNe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.hasPasscode} + onEnable={this.onPasscodeEnable} + onDisable={this.onPasscodeDisable} + title={"Local Passcode"} + /> @@ -200,6 +201,7 @@ class AuthSection extends Component { autoCorrect={false} autoCapitalize={'none'} keyboardType={'email-address'} + underlineColorAndroid={'transparent'} /> @@ -210,6 +212,7 @@ class AuthSection extends Component { onChangeText={(text) => this.setState({password: text})} value={this.state.password} secureTextEntry={true} + underlineColorAndroid={'transparent'} /> @@ -223,6 +226,7 @@ class AuthSection extends Component { autoCorrect={false} autoCapitalize={'none'} keyboardType={'url'} + underlineColorAndroid={'transparent'} /> } diff --git a/src/screens/Compose.js b/src/screens/Compose.js index 6b392c0e..a9f23d1b 100644 --- a/src/screens/Compose.js +++ b/src/screens/Compose.js @@ -8,7 +8,6 @@ import Abstract from "./Abstract" import { AppRegistry, StyleSheet, - StatusBar, TextInput, View, FlatList, @@ -38,6 +37,7 @@ export default class Compose extends Abstract { } this.state = {note: note, text: note.text}; this.configureNavBar(); + this.loadStyles(); this.syncObserver = Sync.getInstance().registerSyncObserver(function(changesMade){ if(changesMade) { @@ -200,9 +200,9 @@ export default class Compose extends Abstract { render() { return ( - + - - + + ); } + + loadStyles() { + this.rawStyles = { + container: { + flex: 1, + flexDirection: 'column', + height: "100%", + }, + + noteTitle: { + fontWeight: "600", + fontSize: 16, + color: GlobalStyles.constants().mainTextColor, + height: 50, + borderBottomColor: GlobalStyles.constants().composeBorderColor, + borderBottomWidth: 1, + paddingTop: Platform.OS === "ios" ? 5 : 12, + paddingLeft: GlobalStyles.constants().paddingLeft, + paddingRight: GlobalStyles.constants().paddingLeft, + }, + + textContainer: { + flexGrow: 1, + flex: 1, + }, + + contentContainer: { + flexGrow: 1 + }, + + noteText: { + height: "100%", + flexGrow: 1, + fontSize: 17, + marginTop: 0, + paddingTop: 10, + paddingBottom: 10, + color: GlobalStyles.constants().mainTextColor, + paddingLeft: GlobalStyles.constants().paddingLeft, + paddingRight: GlobalStyles.constants().paddingLeft, + textAlignVertical: 'top', + paddingVertical: 0, + lineHeight: 22, + } + } + + this.styles = StyleSheet.create(this.rawStyles); + + } } - -let PaddingLeft = 14; - -const rawStyles = { - container: { - flex: 1, - backgroundColor: 'white', - flexDirection: 'column', - height: "100%", - }, - - noteTitle: { - fontWeight: "600", - fontSize: 16, - color: "black", - height: 50, - borderBottomColor: "#F5F5F5", - borderBottomWidth: 1, - paddingTop: Platform.OS === "ios" ? 5 : 12, - paddingLeft: PaddingLeft, - paddingRight: PaddingLeft, - }, - - textContainer: { - flexGrow: 1, - flex: 1, - }, - - contentContainer: { - flexGrow: 1 - }, - - noteText: { - height: "100%", - flexGrow: 1, - fontSize: 17, - marginTop: 0, - paddingTop: 10, - paddingBottom: 10, - color: "black", - paddingLeft: PaddingLeft, - paddingRight: PaddingLeft, - textAlignVertical: 'top', - paddingVertical: 0, - lineHeight: 22, - }, -} - -const styles = StyleSheet.create(rawStyles); diff --git a/src/screens/Filter.js b/src/screens/Filter.js index e855fcd3..ef6ef574 100644 --- a/src/screens/Filter.js +++ b/src/screens/Filter.js @@ -193,7 +193,7 @@ export default class Filter extends Abstract { render() { return ( - + {!this.note && @@ -221,6 +221,7 @@ export default class Filter extends Abstract { } } + class TagsSection extends Component { constructor(props) { super(props); @@ -238,7 +239,7 @@ class TagsSection extends Component { render() { let root = this; return ( - + {this.props.tags.map(function(tag, i){ return ( diff --git a/src/screens/Notes.js b/src/screens/Notes.js index 05172cb9..177087cb 100644 --- a/src/screens/Notes.js +++ b/src/screens/Notes.js @@ -26,14 +26,9 @@ export default class Notes extends Abstract { this.loadTabbarIcons(); this.initializeOptionsAndNotes(); this.beginSyncTimer(); - - setTimeout(function () { - // this.forceUpdate(); - }.bind(this), 1500); } componentWillUnmount() { - console.log("Notes component will unmount"); Sync.getInstance().removeSyncObserver(this.syncObserver); Auth.getInstance().removeSignoutObserver(this.signoutObserver); clearInterval(this.syncTimer); @@ -275,7 +270,7 @@ export default class Notes extends Abstract { render() { return ( - + Decrypting notes... @@ -298,7 +293,6 @@ const styles = StyleSheet.create({ container: { flex: 1, - backgroundColor: 'white', }, decryptNoticeContainer: {