1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Add simple sharing facilities for Android

- react code should be cross platform but support needs to be added
    for ios
  - only shares plain text notes for now
This commit is contained in:
Caleb John
2018-07-20 11:04:25 +02:00
parent f63668350b
commit 8840631266
12 changed files with 129 additions and 6 deletions

View File

@@ -34,6 +34,7 @@ const shared = require('lib/components/shared/note-screen-shared.js');
const ImagePicker = require('react-native-image-picker');
const AlarmService = require('lib/services/AlarmService.js');
const { SelectDateTimeDialog } = require('lib/components/select-date-time-dialog.js');
const ShareExtension = require('react-native-share-extension').default;
import FileViewer from 'react-native-file-viewer';
@@ -57,6 +58,7 @@ class NoteScreenComponent extends BaseScreenComponent {
alarmDialogShown: false,
heightBumpView:0,
noteTagDialogShown: false,
fromShare: false,
};
// iOS doesn't support multiline text fields properly so disable it
@@ -215,6 +217,10 @@ class NoteScreenComponent extends BaseScreenComponent {
componentWillUnmount() {
BackButtonService.removeHandler(this.backHandler);
NavService.removeHandler(this.navHandler);
if (this.state.fromShare) {
ShareExtension.close();
}
}
title_changeText(text) {
@@ -675,9 +681,10 @@ const NoteScreen = connect(
itemType: state.selectedItemType,
folders: state.folders,
theme: state.settings.theme,
sharedData: state.sharedData,
showAdvancedOptions: state.settings.showAdvancedOptions,
};
}
)(NoteScreenComponent)
module.exports = { NoteScreen };
module.exports = { NoteScreen };