1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Mobile: Fixes #1057: Handle more cases where the title text field disappear

This commit is contained in:
Laurent Cozic 2018-12-29 03:12:23 +01:00
parent 7cfc537870
commit 1b3e0f65e1
4 changed files with 17 additions and 10 deletions

View File

@ -90,8 +90,8 @@ android {
applicationId "net.cozic.joplin"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 2097461
versionName "1.0.225"
versionCode 2097467
versionName "1.0.231"
ndk {
abiFilters "armeabi-v7a", "x86"
}

View File

@ -29,6 +29,10 @@ class NoteBodyViewer extends Component {
}
onLoadEnd() {
setTimeout(() => {
if (this.props.onLoadEnd) this.props.onLoadEnd();
}, 100);
if (this.state.webViewLoaded) return;
// Need to display after a delay to avoid a white flash before
@ -37,8 +41,6 @@ class NoteBodyViewer extends Component {
if (!this.isMounted_) return;
this.setState({ webViewLoaded: true });
}, 100);
if (this.props.onLoadEnd) this.props.onLoadEnd();
}
shouldComponentUpdate(nextProps, nextState) {

View File

@ -604,7 +604,9 @@ class NoteScreenComponent extends BaseScreenComponent {
keywords = SearchEngine.instance().allParsedQueryTerms(parsedQuery);
}
bodyComponent = <NoteBodyViewer
// Note: as of 2018-12-29 it's important not to display the viewer if the note body is empty,
// to avoid the HACK_webviewLoadingState related bug.
bodyComponent = !note || !note.body.trim() ? null : <NoteBodyViewer
onJoplinLinkClick={this.onJoplinLinkClick_}
ref="noteBodyViewer"
style={this.styles().noteBodyViewer}
@ -614,11 +616,11 @@ class NoteScreenComponent extends BaseScreenComponent {
onCheckboxChange={(newBody) => { onCheckboxChange(newBody) }}
onLoadEnd={() => {
setTimeout(() => {
this.setState({ HACK_webviewLoadingState: this.state.HACK_webviewLoadingState + 1 });
this.setState({ HACK_webviewLoadingState: 1 });
setTimeout(() => {
this.setState({ HACK_webviewLoadingState: this.state.HACK_webviewLoadingState + 1 });
this.setState({ HACK_webviewLoadingState: 0 });
}, 50);
}, 50);
}, 5);
}}
/>
} else {

View File

@ -47,6 +47,8 @@ function gradleVersionName(content) {
}
async function main() {
console.info('Updating version numbers in build.gradle...');
const projectName = 'joplin-android';
const newContent = updateGradleConfig();
const version = gradleVersionName(newContent);
@ -59,10 +61,10 @@ async function main() {
console.info('Running from: ' + process.cwd());
console.info('Building APK file...');
console.info('Building APK file v' + version + '...');
let restoreDir = null;
let apkBuildCmd = 'assembleRelease -PbuildDir=build --console plain';
let apkBuildCmd = 'assembleRelease -PbuildDir=build'; // --console plain
if (await fileExists('/mnt/c/Windows/System32/cmd.exe')) {
apkBuildCmd = '/mnt/c/Windows/System32/cmd.exe /c "cd ReactNativeClient\\android && gradlew.bat ' + apkBuildCmd + '"';
} else {
@ -72,6 +74,7 @@ async function main() {
}
// const output = await execCommand('/mnt/c/Windows/System32/cmd.exe /c "cd ReactNativeClient\\android && gradlew.bat assembleRelease -PbuildDir=build --console plain"');
console.info(apkBuildCmd);
const output = await execCommand(apkBuildCmd);
console.info(output);