diff --git a/src/components/HeaderTitleView.js b/src/components/HeaderTitleView.js index a7b15e1a..05d47292 100644 --- a/src/components/HeaderTitleView.js +++ b/src/components/HeaderTitleView.js @@ -12,15 +12,19 @@ export default class HeaderTitleView extends Component { render() { let styles = this.getStyles(); + let subtitleStyles = styles.get('headerSubtitle'); + if(this.props.subtitleColor) { + subtitleStyles[0].color = this.props.subtitleColor; + subtitleStyles[0].opacity = 1.0; + } + return ( + {this.props.title} + {this.props.subtitle && - + {this.props.subtitle} } diff --git a/src/screens/Abstract.js b/src/screens/Abstract.js index 01469fa1..1443e3a6 100644 --- a/src/screens/Abstract.js +++ b/src/screens/Abstract.js @@ -22,7 +22,11 @@ export default class Abstract extends ThemedComponent { // this way, things like title and the Done button in the top left are visible during transition if(!templateOptions) { templateOptions = {}; } let options = { - headerTitle:, + headerTitle:, headerStyle: { backgroundColor: StyleKit.variables.stylekitContrastBackgroundColor, borderBottomColor: StyleKit.variables.stylekitContrastBorderColor, @@ -170,9 +174,10 @@ export default class Abstract extends ThemedComponent { this.props.navigation.setParams(options); } - setSubTitle(subtitle) { + setSubTitle(subtitle, color) { let options = {}; options.subtitle = subtitle; + options.subtitleColor = color; this.props.navigation.setParams(options); } diff --git a/src/screens/Compose.js b/src/screens/Compose.js index c94383b6..d697ab56 100644 --- a/src/screens/Compose.js +++ b/src/screens/Compose.js @@ -323,7 +323,7 @@ export default class Compose extends Abstract { this.statusTimeout = setTimeout(function(){ this.saveError = true; this.syncTakingTooLong = false; - this.setSubTitle("Error syncing (changes saved offline)"); + this.setSubTitle("Sync Unavailable (changes saved offline)", StyleKit.variables.stylekitWarningColor); }.bind(this), 200) } } diff --git a/src/screens/Root.js b/src/screens/Root.js index 9d2ac6ee..06b32184 100644 --- a/src/screens/Root.js +++ b/src/screens/Root.js @@ -62,27 +62,27 @@ export default class Root extends Abstract { this.showingErrorStatus = true; setTimeout( () => { // need timeout for syncing on app launch - this.setStatusBarText(text); + this.setSubTitle(text, StyleKit.variables.stylekitWarningColor); }, 250); } else if(status.retrievedCount > 20) { var text = `Downloading ${status.retrievedCount} items. Keep app open.` - this.setStatusBarText(text); + this.setSubTitle(text); this.showingDownloadStatus = true; } else if(this.showingDownloadStatus) { this.showingDownloadStatus = false; var text = "Download Complete."; - this.setStatusBarText(text); + this.setSubTitle(text); setTimeout(() => { - this.setStatusBarText(null); + this.setSubTitle(null); }, 2000); } else if(this.showingErrorStatus) { - this.setStatusBarText(null); + this.setSubTitle(null); } }) this.signoutObserver = Auth.get().addEventHandler((event) => { if(event == SFAuthManager.DidSignOutEvent) { - this.setStatusBarText(null); + this.setSubTitle(null); let notifyObservers = false; ApplicationState.getOptions().reset(notifyObservers); this.reloadOptionsToDefault(); @@ -156,10 +156,10 @@ export default class Root extends Abstract { initializeData() { let encryptionEnabled = KeysManager.get().isOfflineEncryptionEnabled(); - this.setStatusBarText(encryptionEnabled ? "Decrypting items..." : "Loading items..."); + this.setSubTitle(encryptionEnabled ? "Decrypting items..." : "Loading items..."); let incrementalCallback = (current, total) => { let notesString = `${current}/${total} items...` - this.setStatusBarText(encryptionEnabled ? `Decrypting ${notesString}` : `Loading ${notesString}`); + this.setSubTitle(encryptionEnabled ? `Decrypting ${notesString}` : `Loading ${notesString}`); // Incremental Callback if(!this.dataLoaded) { this.dataLoaded = true; @@ -168,11 +168,11 @@ export default class Root extends Abstract { } let loadLocalCompletion = (items) => { - this.setStatusBarText("Syncing..."); + this.setSubTitle("Syncing..."); this.dataLoaded = true; // perform initial sync Sync.get().sync().then(() => { - this.setStatusBarText(null); + this.setSubTitle(null); }); } @@ -217,10 +217,6 @@ export default class Root extends Abstract { }); } - setStatusBarText(text) { - this.setSubTitle(text); - } - onNoteSelect = (note) => { this.composer.setNote(note); this.setState({selectedTagId: this.notesRef.options.selectedTagIds.length && this.notesRef.options.selectedTagIds[0]});