diff --git a/ReactNativeClient/android/app/build.gradle b/ReactNativeClient/android/app/build.gradle index 141e035ab..0c936baab 100644 --- a/ReactNativeClient/android/app/build.gradle +++ b/ReactNativeClient/android/app/build.gradle @@ -90,8 +90,8 @@ android { applicationId "net.cozic.joplin" minSdkVersion 16 targetSdkVersion 22 - versionCode 50 - versionName "0.9.37" + versionCode 52 + versionName "0.9.39" ndk { abiFilters "armeabi-v7a", "x86" } diff --git a/ReactNativeClient/lib/components/app-nav.js b/ReactNativeClient/lib/components/app-nav.js index a8cdfb061..da4f0389c 100644 --- a/ReactNativeClient/lib/components/app-nav.js +++ b/ReactNativeClient/lib/components/app-nav.js @@ -4,6 +4,7 @@ import { NotesScreen } from 'lib/components/screens/notes.js'; import { SearchScreen } from 'lib/components/screens/search.js'; import { View } from 'react-native'; import { _ } from 'lib/locale.js'; +import { themeStyle } from 'lib/components/global-style.js'; class AppNavComponent extends Component { @@ -38,8 +39,12 @@ class AppNavComponent extends Component { this.previousRouteName_ = route.routeName; + const theme = themeStyle(this.props.theme); + + const style = { flex: 1, backgroundColor: theme.backgroundColor } + return ( - + { searchScreenLoaded && } { (!notesScreenVisible && !searchScreenVisible) && } @@ -53,6 +58,7 @@ const AppNav = connect( (state) => { return { route: state.route, + theme: state.settings.theme, }; } )(AppNavComponent) diff --git a/ReactNativeClient/lib/components/note-body-viewer.js b/ReactNativeClient/lib/components/note-body-viewer.js index f00178bb9..304e139ac 100644 --- a/ReactNativeClient/lib/components/note-body-viewer.js +++ b/ReactNativeClient/lib/components/note-body-viewer.js @@ -3,6 +3,7 @@ import { WebView, View, Linking } from 'react-native'; import { globalStyle } from 'lib/components/global-style.js'; import { Resource } from 'lib/models/resource.js'; import { shim } from 'lib/shim.js'; +import { reg } from 'lib/registry.js'; import marked from 'lib/marked.js'; const Entities = require('html-entities').AllHtmlEntities; const htmlentities = (new Entities()).encode; @@ -172,8 +173,6 @@ class NoteBodyViewer extends Component { html = '' + html + scriptHtml + ''; - // console.info(html); - return html; } @@ -203,6 +202,7 @@ class NoteBodyViewer extends Component { style={webViewStyle} source={{ html: html }} onLoadEnd={() => this.onLoadEnd()} + onError={(e) => reg.logger().error('WebView error', e) } onMessage={(event) => { let msg = event.nativeEvent.data; diff --git a/ReactNativeClient/lib/components/side-menu-content.js b/ReactNativeClient/lib/components/side-menu-content.js index ba1510afe..49c5a036b 100644 --- a/ReactNativeClient/lib/components/side-menu-content.js +++ b/ReactNativeClient/lib/components/side-menu-content.js @@ -181,6 +181,8 @@ class SideMenuContentComponent extends Component { render() { let items = []; + const theme = themeStyle(this.props.theme); + // HACK: inner height of ScrollView doesn't appear to be calculated correctly when // using padding. So instead creating blank elements for padding bottom and top. items.push(); @@ -222,14 +224,23 @@ class SideMenuContentComponent extends Component { items.push(); + let style = { + flex:1, + borderRightWidth: 1, + borderRightColor: globalStyle.dividerColor, + backgroundColor: theme.backgroundColor, + }; + return ( - - - + + + + + + + { items } + - - { items } - ); } @@ -247,6 +258,7 @@ const SideMenuContent = connect( notesParentType: state.notesParentType, locale: state.settings.locale, theme: state.settings.theme, + opacity: state.sideMenuOpenPercent, }; } )(SideMenuContentComponent) diff --git a/ReactNativeClient/lib/reducer.js b/ReactNativeClient/lib/reducer.js index 6e1446b66..dced7006e 100644 --- a/ReactNativeClient/lib/reducer.js +++ b/ReactNativeClient/lib/reducer.js @@ -23,6 +23,7 @@ const defaultState = { searchQuery: '', settings: {}, appState: 'starting', + sideMenuOpenPercent: 0, route: { type: 'NAV_GO', routeName: 'Welcome', @@ -336,6 +337,12 @@ const reducer = (state = defaultState, action) => { newState.showSideMenu = false break; + case 'SIDE_MENU_OPEN_PERCENT': + + newState = Object.assign({}, state); + newState.sideMenuOpenPercent = action.value; + break; + case 'SYNC_STARTED': newState = Object.assign({}, state); diff --git a/ReactNativeClient/root.js b/ReactNativeClient/root.js index 3527c4708..a3681586d 100644 --- a/ReactNativeClient/root.js +++ b/ReactNativeClient/root.js @@ -38,7 +38,7 @@ import { PoorManIntervals } from 'lib/poor-man-intervals.js'; import { reducer, defaultState } from 'lib/reducer.js'; const generalMiddleware = store => next => async (action) => { - reg.logger().info('Reducer action', action.type); + if (action.type !== 'SIDE_MENU_OPEN_PERCENT') reg.logger().info('Reducer action', action.type); PoorManIntervals.update(); // This function needs to be called regularly so put it here const result = next(action); @@ -254,7 +254,16 @@ class AppComponent extends React.Component { }; return ( - this.sideMenu_change(isOpen)}> + this.sideMenu_change(isOpen)} + onSliding={(percent) => { + this.props.dispatch({ + type: 'SIDE_MENU_OPEN_PERCENT', + value: percent, + }); + }} + >