1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00

Android: Fixed image picker issues

This commit is contained in:
Laurent Cozic 2017-11-20 19:01:19 +00:00
parent 37de5fd4b3
commit 3d6fe4c2cd
40 changed files with 58 additions and 13 deletions

BIN
Assets/Icon-ios.psd Normal file

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 151 KiB

View File

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

BIN
Assets/iOSIcons/29.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
Assets/iOSIcons/29x2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
Assets/iOSIcons/29x3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
Assets/iOSIcons/40.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
Assets/iOSIcons/40x2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
Assets/iOSIcons/40x3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
Assets/iOSIcons/57.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
Assets/iOSIcons/57x2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
Assets/iOSIcons/60x2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
Assets/iOSIcons/60x3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -841,6 +841,16 @@ msgstr ""
msgid "Discard changes"
msgstr ""
#, javascript-format
msgid "Unsupported image type: %s"
msgstr ""
msgid "Attach image"
msgstr ""
msgid "Attach any other file"
msgstr ""
msgid "Delete note"
msgstr ""

View File

@ -906,6 +906,18 @@ msgstr "Enregistrer les changements"
msgid "Discard changes"
msgstr "Ignorer les changements"
#, fuzzy, javascript-format
msgid "Unsupported image type: %s"
msgstr "Lien ou message non géré : %s"
#, fuzzy
msgid "Attach image"
msgstr "Attacher un fichier"
#, fuzzy
msgid "Attach any other file"
msgstr "Attacher un fichier"
msgid "Delete note"
msgstr "Supprimer la note"

View File

@ -841,6 +841,16 @@ msgstr ""
msgid "Discard changes"
msgstr ""
#, javascript-format
msgid "Unsupported image type: %s"
msgstr ""
msgid "Attach image"
msgstr ""
msgid "Attach any other file"
msgstr ""
msgid "Delete note"
msgstr ""

View File

@ -917,6 +917,14 @@
"resolved": "https://registry.npmjs.org/node-bitmap/-/node-bitmap-0.0.1.tgz",
"integrity": "sha1-GA6scAPgxwdhjvMTaPYvhLKmkJE="
},
"node-emoji": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.8.1.tgz",
"integrity": "sha512-+ktMAh1Jwas+TnGodfCfjUbJKoANqPaJFN0z0iqh41eqD8dvguNzcitVSBSVK1pidz0AqGbLKcoVuVLRVZ/aVg==",
"requires": {
"lodash.toarray": "4.4.0"
}
},
"node-fetch": {
"version": "1.7.3",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz",

View File

@ -37,6 +37,7 @@
"md5": "^2.2.1",
"mime": "^2.0.3",
"moment": "^2.18.1",
"node-emoji": "^1.8.1",
"node-fetch": "^1.7.1",
"node-persist": "^2.1.0",
"os-tmpdir": "^1.0.2",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -90,8 +90,8 @@ android {
applicationId "net.cozic.joplin"
minSdkVersion 16
targetSdkVersion 22
versionCode 58
versionName "0.10.45"
versionCode 62
versionName "0.10.49"
ndk {
abiFilters "armeabi-v7a", "x86"
}

View File

@ -3,7 +3,6 @@ package net.cozic.joplin;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.rnfs.RNFSPackage;
import com.imagepicker.ImagePickerPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
@ -32,8 +31,7 @@ public class MainApplication extends Application implements ReactApplication {
return Arrays.<ReactPackage>asList(
new ImageResizerPackage(),
new MainReactPackage(),
new RNFSPackage(),
new ImagePickerPackage(),
new ImagePickerPackage(),
new ReactNativeDocumentPicker(),
new RNFetchBlobPackage(),
new RNFSPackage(),

View File

@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.+'
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

View File

@ -1,2 +1,2 @@
cd android
gradlew.bat installDebug
gradlew.bat installDebug --console plain

View File

@ -78,13 +78,15 @@ class NoteBodyViewer extends Component {
// rule "img { max-width: 100% }", works like scalesPageToFix=true on Android.
// So we use scalesPageToFix=false on iOS along with that CSS rule.
// `baseUrl` is where the images will be loaded from. So images must use a path relative to resourceDir.
const source = { html: html, baseUrl: 'file://' + Setting.value('resourceDir') + '/' };
return (
<View style={style}>
<WebView
scalesPageToFit={Platform.OS !== 'ios'}
style={webViewStyle}
{/* baseUrl is where the images will be loaded from. So images must use a path relative to resourceDir. */}
source={{ html: html, baseUrl: 'file://' + Setting.value('resourceDir') + '/' }}
source={source}
onLoadEnd={() => this.onLoadEnd()}
onError={(e) => reg.logger().error('WebView error', e) }
onMessage={(event) => {

View File

@ -350,8 +350,12 @@ class NoteScreenComponent extends BaseScreenComponent {
let output = [];
output.push({ title: _('Attach image'), onPress: () => { this.attachImage_onPress(); } });
output.push({ title: _('Attach any other file'), onPress: () => { this.attachFile_onPress(); } });
// The file attachement modules only work in Android >= 5 (Version 21)
// https://github.com/react-community/react-native-image-picker/issues/606
if (Platform.Version >= 21) {
output.push({ title: _('Attach image'), onPress: () => { this.attachImage_onPress(); } });
output.push({ title: _('Attach any other file'), onPress: () => { this.attachFile_onPress(); } });
}
output.push({ title: _('Delete note'), onPress: () => { this.deleteNote_onPress(); } });
// if (isTodo) {