1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

Mobile: Optimised loading of large notes that contain many images.

This commit is contained in:
Laurent Cozic 2018-12-15 01:42:19 +01:00
parent c223cdf10a
commit 6dca4a0d6b
2 changed files with 17 additions and 2 deletions

View File

@ -13,9 +13,10 @@ const globalStyle = {
colorFaded: "#777777", // For less important text
fontSizeSmaller: 14,
dividerColor: "#dddddd",
strongDividerColor: "#aaaaaa",
selectedColor: '#e5e5e5',
disabledOpacity: 0.2,
colorUrl: '#000CFF',
colorUrl: '#7B81FF',
textSelectionColor: "#0096FF",
raisedBackgroundColor: "#0080EF",
@ -72,6 +73,9 @@ function addExtraStyles(style) {
style.lineInput = {
color: style.color,
backgroundColor: style.backgroundColor,
borderBottomWidth: 1,
borderColor: style.strongDividerColor,
paddingBottom: 0,
};
if (Platform.OS === 'ios') {
@ -114,6 +118,7 @@ function themeStyle(theme) {
output.color = '#dddddd';
output.colorFaded = '#777777';
output.dividerColor = '#555555';
output.strongDividerColor = '#888888';
output.selectedColor = '#333333';
output.textSelectionColor = '#00AEFF';
@ -125,6 +130,8 @@ function themeStyle(theme) {
output.htmlBackgroundColor = 'rgb(29,32,36)';
output.htmlLinkColor = 'rgb(166,166,255)';
output.colorUrl = '#7B81FF';
themeCache_[theme] = output;
return addExtraStyles(themeCache_[theme]);
}

View File

@ -76,7 +76,15 @@ class NoteBodyViewer extends Component {
const mdOptions = {
onResourceLoaded: () => {
this.forceUpdate();
if (this.resourceLoadedTimeoutId_) {
clearTimeout(this.resourceLoadedTimeoutId_);
this.resourceLoadedTimeoutId_ = null;
}
this.resourceLoadedTimeoutId_ = setTimeout(() => {
this.resourceLoadedTimeoutId_ = null;
this.forceUpdate();
}, 100);
},
paddingBottom: '3.8em', // Extra bottom padding to make it possible to scroll past the action button (so that it doesn't overlap the text)
};