nativescript-imagepicker
Advanced tools
Comparing version 7.0.0 to 7.1.0
@@ -151,2 +151,18 @@ "use strict"; | ||
}); | ||
Object.defineProperty(ImagePicker.prototype, "mimeTypes", { | ||
get: function () { | ||
var length = this.mediaType === "*/*" ? 2 : 1; | ||
var mimeTypes = Array.create(java.lang.String, length); | ||
if (this.mediaType === "*/*") { | ||
mimeTypes[0] = "image/*"; | ||
mimeTypes[1] = "video/*"; | ||
} | ||
else { | ||
mimeTypes[0] = this.mediaType; | ||
} | ||
return mimeTypes; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
ImagePicker.prototype.authorize = function () { | ||
@@ -213,15 +229,9 @@ if (android.os.Build.VERSION.SDK_INT >= 23) { | ||
intent.setType(_this.mediaType); | ||
var length = _this.mediaType === "*/*" ? 2 : 1; | ||
var mimeTypes = Array.create(java.lang.String, length); | ||
if (_this.mediaType === "*/*") { | ||
mimeTypes[0] = "image/*"; | ||
mimeTypes[1] = "video/*"; | ||
} | ||
else { | ||
mimeTypes[0] = _this.mediaType; | ||
} | ||
intent.putExtra(android.content.Intent.EXTRA_MIME_TYPES, mimeTypes); | ||
intent.putExtra(android.content.Intent.EXTRA_MIME_TYPES, _this.mimeTypes); | ||
if (_this.mode === 'multiple') { | ||
intent.putExtra("android.intent.extra.ALLOW_MULTIPLE", true); | ||
} | ||
if (_this._options.showAdvanced) { | ||
intent.putExtra("android.content.extra.SHOW_ADVANCED", true); | ||
} | ||
intent.putExtra(android.content.Intent.EXTRA_LOCAL_ONLY, true); | ||
@@ -228,0 +238,0 @@ intent.setAction("android.intent.action.OPEN_DOCUMENT"); |
@@ -7,2 +7,5 @@ import { Observable } from "tns-core-modules/data/observable"; | ||
export class ImagePicker { | ||
constructor(options?: Options); | ||
/** | ||
@@ -71,2 +74,8 @@ * Call this before 'present' to request any additional permissions that may be necessary. | ||
/** | ||
* Show internal and removable storage options on Android. | ||
* Not supported officially, see https://issuetracker.google.com/issues/72053350 | | ||
*/ | ||
showAdvanced?: boolean; | ||
android?: { | ||
@@ -78,2 +87,3 @@ /** | ||
}; | ||
} | ||
@@ -80,0 +90,0 @@ |
{ | ||
"name": "nativescript-imagepicker", | ||
"version": "7.0.0", | ||
"version": "7.1.0", | ||
"description": "A plugin for the NativeScript framework implementing multiple image picker", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -25,4 +25,2 @@ # NativeScript Image Picker ![apple](https://cdn3.iconfinder.com/data/icons/picons-social/57/16-apple-32.png) ![android](https://cdn4.iconfinder.com/data/icons/logos-3/228/android-32.png) | ||
- [Methods](#methods) | ||
- [Properties](#properties) | ||
- [Image properties](#image-properties) | ||
- [Contribute](#contribute) | ||
@@ -138,2 +136,3 @@ - [Get Help](#get-help) | ||
| mediaType | both | Any | Choose whether to pick Image/Video/Any type of assets. | | ||
| showAdvanced | Android | false | Show internal and removable storage options on Android (**WARNING**: [not supported officially](https://issuetracker.google.com/issues/72053350)). | | ||
@@ -140,0 +139,0 @@ The **hostView** parameter can be set to the view that hosts the image picker. Applicable in iOS only, intended to be used when open picker from a modal page. |
54574
15
586
150