|
6 | 6 | [](https://travis-ci.org/NativeScript/nativescript-imagepicker)
|
7 | 7 |
|
8 | 8 | Imagepicker plugin supporting both single and multiple selection.
|
9 |
| -<br />Plugin supports **iOS8+** and uses [Photos Framework](https://developer.apple.com/library/prerelease/ios//documentation/Photos/Reference/Photos_Framework/index.html). |
| 9 | +<br />Plugin supports **iOS8+** and uses [QBImagePicker](https://github.com/questbeat/QBImagePicker) cocoa pod. |
10 | 10 | <br />For **Android** it uses Intents to open the stock images or file pickers. For Android 6 (API 23) and above the permissions to read file storage should be explicitly required. See demo for implementation details.
|
11 | 11 |
|
12 | 12 | <!-- TOC depthFrom:2 -->
|
13 | 13 |
|
14 | 14 | - [Installation](#installation)
|
15 | 15 | - [Configuration](#configuration)
|
| 16 | +- [Migrating from 5.x.x to 6.x.x](#migrating-from-5xx-to-6xx) |
16 | 17 | - [Migrating from 4.x.x to 5.x.x](#migrating-from-4xx-to-5xx)
|
17 | 18 | - [Migrating from 3.x.x to 4.x.x](#migrating-from-3xx-to-4xx)
|
18 | 19 | - [Usage](#usage)
|
@@ -41,6 +42,9 @@ tns run
|
41 | 42 | ## Configuration
|
42 | 43 | No additional configuration required!
|
43 | 44 |
|
| 45 | +## Migrating from 5.x.x to 6.x.x |
| 46 | +With version **6.x.x** the dependency to the `nativescript-ui-listview` plugin is removed and for iOS the [QBImagePicker](https://github.com/questbeat/QBImagePicker) cocoa pod is used. Now the plugin supports some new features, fixes some bugs and looks super native for iOS. You can remove any dependencies to `nativescript-pro-ui`, `nativescript-ui-listview`, etc. in case you've added them in your app specifically for this plugin. Also the options **doneText**, **cancelText**, **albumsText**, **newestFirst** and the methods **cancel()** and **done()** are no longer applicable. The image picker now returns the basic [{N} ImageAsset class](https://github.com/NativeScript/NativeScript/tree/master/tns-core-modules/image-asset) (and not custom asset as before). |
| 47 | + |
44 | 48 | ## Migrating from 4.x.x to 5.x.x
|
45 | 49 | With version **5.x.x** major update to the plugin there is a related dependency which needs to be updated inside your project. The plugin uses internally the `nativescript-ui-listview` plugin (part of the NativeScript Pro UI components). Recently the monolithic [NativeScript Pro UI plugin was split in multiple plugins](https://www.nativescript.org/blog/professional-components-from-nativescript-ui-the-big-breakup), each of them representing a single component. Now, instead of the monolithic package, nativescript-imagepicker uses only the component it needs. To use version 5.x.x of the plugin, you need to update any dependencies to `nativescript-pro-ui` in your project with the single component alternatives as described in the [migration guide](http://docs.telerik.com/devtools/nativescript-ui/migration).
|
46 | 50 |
|
@@ -116,33 +120,18 @@ context
|
116 | 120 | | Option | Platform | Default | Description |
|
117 | 121 | | --- | --- | --- | --- |
|
118 | 122 | | mode | both | multiple | The mode if the imagepicker. Possible values are `single` for single selection and `multiple` for multiple selection. |
|
119 |
| -| doneText | iOS | Done | The text of the "Done" button on top right. | |
120 |
| -| cancelText | iOS | Cancel | The text of the "Cancel" button on top left. | |
121 |
| -| albumsText | iOS | Albums | The title of the "Albums" screen from where the selection of album and images can be done. | |
122 |
| -| newestFirst | iOS | false | Set to `true` to sort the images in an album by newest first. | |
| 123 | +| minimumNumberOfSelection | iOS | 0 | The minumum number of selected assets. | |
| 124 | +| maximumNumberOfSelection | iOS | 0 | The maximum number of selected assets. | |
| 125 | +| showsNumberOfSelectedAssets | iOS | True | Display the number of selected assets. | |
| 126 | +| prompt | iOS | undefined | Display prompt text when selecting assets. | |
| 127 | +| numberOfColumnsInPortrait | iOS | 4 | Set the number of columns in Portrait orientation. | |
| 128 | +| numberOfColumnsInLandscape | iOS | 7 | Set the number of columns in Landscape orientation. | |
| 129 | +| mediaType | iOS | Any | Choose whether to pick Image/Video/Any type of assets. | |
| 130 | +
|
| 131 | +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. |
123 | 132 |
|
124 | 133 | * authorize() - request the required permissions.
|
125 | 134 | * present() - show the albums to present the user the ability to select images. Returns an array of the selected images.
|
126 |
| -* cancel() - cancel selection. iOS only. |
127 |
| -* done() - confirm the selection is ready. iOS only. |
128 |
| -
|
129 |
| -
|
130 |
| -### Properties |
131 |
| -| Property | Default | Description | |
132 |
| -| --- | --- | --- | |
133 |
| -| selection | null | An array of selected image assets. | |
134 |
| -| albums | null | Albums from where the images are picked. | |
135 |
| -
|
136 |
| -
|
137 |
| -### Image properties |
138 |
| -
|
139 |
| -Once image is picked some options can be applied to it before it is used: |
140 |
| -
|
141 |
| -| Option | Default | Description | |
142 |
| -| --- | --- | --- | |
143 |
| -| maxWidth | null | Image max width | |
144 |
| -| maxHeight | null | Image max height | |
145 |
| -| aspectRatio | fit | iOS only. Possible values are `fit` and `fill`. [Read more](https://developer.apple.com/documentation/photos/phimagecontentmode) | |
146 | 135 |
|
147 | 136 | ## Contribute
|
148 | 137 | We love PRs! Check out the [contributing guidelines](CONTRIBUTING.md). If you want to contribute, but you are not sure where to start - look for [issues labeled `help wanted`](https://github.com/NativeScript/nativescript-imagepicker/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).
|
|
0 commit comments