Skip to content

Commit

Permalink
camerarollextended v8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
marchbold committed Dec 11, 2024
1 parent 00b9b5a commit 0d7a3dd
Show file tree
Hide file tree
Showing 65 changed files with 343 additions and 85 deletions.
12 changes: 12 additions & 0 deletions docs/camerarollextended/_includes/add-apm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,15 @@ We suggest you use the locations directly in your builds rather than copying the
apm project config set com.distriqt.CameraRollExtended
```


#### Variants

There are several variants of this extension available. You can install a specific variant by specifying the variant when installing the extension. For example, to install the `camera` variant:

```
apm install com.distriqt.CameraRollExtended-permissionless
```

The available variants are:
- `permissionless` - Permissionless camera roll access allowing to read and write to the camera roll with only very minimal permissions (Please note the custom picker is not supported in this variant).

57 changes: 48 additions & 9 deletions docs/camerarollextended/_includes/add-manual-appdescriptor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ The following should be added to your `extensions` node in your application desc

```xml
<extensions>
<extensionID>com.distriqt.CameraRollExtended</extensionID>
<extensionID>com.distriqt.Core</extensionID>
<extensionID>androidx.core</extensionID>
<extensionID>androidx.appcompat</extensionID>
<extensionID>androidx.exifinterface</extensionID>
<extensionID>com.distriqt.CameraRollExtended</extensionID>
<extensionID>com.distriqt.Core</extensionID>
<extensionID>androidx.core</extensionID>
<extensionID>androidx.appcompat</extensionID>
<extensionID>androidx.exifinterface</extensionID>
<extensionID>com.jetbrains.kotlin</extensionID>
<extensionID>com.bumptech.glide</extensionID>
<extensionID>com.distriqt.square.okhttp3</extensionID>
<extensionID>com.distriqt.square.picasso</extensionID>
<extensionID>com.jetbrains.kotlin</extensionID>
<extensionID>com.distriqt.square.picasso</extensionID>
</extensions>
```

Expand All @@ -21,7 +22,7 @@ The following should be added to your `extensions` node in your application desc

### Manifest Additions

The Camera Roll Extended ANE requires a few additions to the manifest to be able to start certain activities
The Camera Roll Extended extension requires a few additions to the manifest to be able to start certain activities
and get access to the users media. You should add the listing below to your manifest.


Expand All @@ -42,17 +43,55 @@ and get access to the users media. You should add the listing below to your mani
<activity android:name="com.distriqt.extension.camerarollextended.activities.MultiImagePickerActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:configChanges="orientation|screenSize" android:exported="false" />
<activity android:name="com.distriqt.extension.camerarollextended.activities.SelectorActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:configChanges="orientation|screenSize" android:exported="false" />

<service android:name="com.google.android.gms.metadata.ModuleDependencies"
android:enabled="false"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.metadata.MODULE_DEPENDENCIES" />
</intent-filter>
<meta-data android:name="photopicker_activity:0:required" android:value="" />
</service>

</application>
</manifest>
```


### Permissionless Picker

If you are using the permissionless picker you will only need to add the following to your manifest:

```xml
<manifest android:installLocation="auto">
<uses-sdk android:minSdkVersion="19" />

<uses-permission android:name="android.permission.INTERNET"/>

<application>
<activity android:name="com.distriqt.core.auth.AuthorisationActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:exported="false" />


<service android:name="com.google.android.gms.metadata.ModuleDependencies"
android:enabled="false"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.metadata.MODULE_DEPENDENCIES" />
</intent-filter>
<meta-data android:name="photopicker_activity:0:required" android:value="" />
</service>

</application>
</manifest>
```



### Writing to the Camera Roll

If you need to write to the camera roll on Android versions < 29 then you will also need to add the `WRITE_EXTERNAL_STORAGE` permission to your manifest:

```xml
<!-- OPTIONAL: Only add this one if you want to add to the camera roll -->
<!-- OPTIONAL: Only add this one if you want to ADD files to the camera roll -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
```

Expand Down
2 changes: 1 addition & 1 deletion docs/camerarollextended/_includes/add-manual.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ This extension requires the following extensions:
- [`androidx.core`](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/androidx.core.ane)
- [`androidx.appcompat`](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/androidx.appcompat.ane)
- [`androidx.exifinterface`](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/androidx.exifinterface.ane)
- [`com.bumptech.glide`](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/com.bumptech.glide.ane)
- [`com.jetbrains.kotlin`](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/com.jetbrains.kotlin.ane)

You can access these extensions here: [https://github.com/distriqt/ANE-AndroidSupport](https://github.com/distriqt/ANE-AndroidSupport).
Expand Down Expand Up @@ -70,4 +71,3 @@ This extension requires the following Square extensions:
You can access these extensions here: [https://github.com/distriqt/ANE-SquareLibs](https://github.com/distriqt/ANE-SquareLibs).



29 changes: 28 additions & 1 deletion docs/camerarollextended/browse-for-an-asset.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,31 @@ options.useNativePicker = true;
CameraRollExtended.service.browseForAsset( options );
```

We highly recommend using the native picker however feel free to try the custom implementation and see if it suits your needs.
We highly recommend using the native picker however feel free to try the custom implementation and see if it suits your needs.




## Permissionless Picker

The permissionless picker allows you a way to limit the permissions your application requires when the only operation it needs is to select and load images. This picker has slightly different call process but still results in the same events being dispatched as the normal `browseForAsset()` operation above.

```actionscript
var options:PermissionlessPickerOptions = new PermissionlessPickerOptions()
.setMaximumCount( 2 )
.setType( Asset.IMAGE );
CameraRollExtended.service.permissionlessPicker.browse( options );
```

Once the user selects the image you will be able to load it using the `assets` functionality for a period of time after the selection. I.e. don't hold onto a reference to the selected items and expect to be able to load them at a subsequent launch of your application. The browse operation in this process will give you the ability to access it for a reasonable amount of time after the selection.


:::note Variant
If the permissionless picker or adding images are the only actions you need from this extension we suggest you use the `permissionless` variant of the extension. This variant removes the additional permissions from the manifest and allows you less scrutiny when going through the app review process.

```
apm install com.distriqt.CameraRollExtended-permissionless
```

:::
14 changes: 14 additions & 0 deletions docs/camerarollextended/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
### 2024.12.11 [v8.0.0]

```
## Major Update
In this update we have moved all the extensions to use the newer gradle dependencies process. We also have added a new "permissionless" version of the extension which requires greatly reduced permissions but can only perform simple selection and load operations.
https://docs.airnativeextensions.com/docs/camerarollextended/migrating-to-v8.0
feat(android): move to gradle dependencies
feat(android): add permissionless picker to allow picking images without read authorisation (resolves https://github.com/distriqt/ANE-CameraRollExtended/issues/154)
feat(android): add ability to use `addBitmapData` without any read permissions added to the app (resolves https://github.com/distriqt/ANE-CameraRollExtended/issues/152)
```

### 2024.05.20 [v7.1.0]

```
Expand Down
4 changes: 3 additions & 1 deletion docs/camerarollextended/migrating-to-v7.0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ Add the following permissions:
And if you are using the `WRITE_EXTERNAL_STORAGE` permission update it to be as below:

```xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28" />
```

</TabItem>
Expand Down
79 changes: 79 additions & 0 deletions docs/camerarollextended/migrating-to-v8.0.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: Migrating to v8.0
---

import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'


This release brings a number of updates to the extension particularly around android integration.

We have moved to using gradle dependencies within our extensions which will improve dependency resolution, reduce update times and improve compatibility with other extensions.
This also reduces the amount of work required to manually integrate the extensions, reducing the additions to the manifest (though we still highly recommend using apm for this purpose).

There should be no changes required to your code for this update.

However we do suggest checking out the manifest additions for the latest version of the extension as you should be able to greatly simplify your application descriptor now.


## Android Integration

### Gradle Dependencies

We have moved to using gradle dependencies within our extensions which will improve dependency resolution, reduce update times and improve compatibility with other extensions.

This also reduces the amount of work required to manually integrate the extensions, reducing the additions to the manifest in your application descriptor.


### Updating code

There should be no changes required to your code for this update.


### Updating the manifest

You can simplify the manifest now as well as the gradle implementation will add a significant amount of the required manifest entries for you.
If you use the `apm` tool to generate your application descriptor

We highly recommend using the [apm](https://airnativeextensions.com/docs/using-apm) tool to manage the integration of the extensions in your application and to generate your application descriptor:

```bash
apm generate app-descriptor
```

You will see the manifest entries are significantly reduced and simply running the commands above will update the manifest for you.

However, you can still integrate the manifest additions manually if you prefer. With this update we recommend starting fresh as there have been a lot of entries to be removed.

If you manually update the manifest then, we recommend starting fresh as there have been a lot of entries to be removed.
The minimum manifest additions now looks like the following:

```xml
<manifest android:installLocation="auto">
<uses-sdk android:minSdkVersion="19" />

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="com.google.android.apps.photos.permission.GOOGLE_PHOTOS"/>

<application>

<activity android:name="com.distriqt.core.auth.AuthorisationActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:exported="false" />

<activity android:name="com.distriqt.extension.camerarollextended.activities.MultiImagePickerActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:configChanges="orientation|screenSize" android:exported="false" />
<activity android:name="com.distriqt.extension.camerarollextended.activities.SelectorActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:configChanges="orientation|screenSize" android:exported="false" />

<service android:name="com.google.android.gms.metadata.ModuleDependencies"
android:enabled="false"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.metadata.MODULE_DEPENDENCIES" />
</intent-filter>
<meta-data android:name="photopicker_activity:0:required" android:value="" />
</service>

</application>
</manifest>
```
2 changes: 2 additions & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,8 @@ module.exports = {
},
{
Help: [
"camerarollextended/migrating-to-v8.0",
"camerarollextended/migrating-to-v7.0",
"camerarollextended/migrating-to-v6.4",
"camerarollextended/migrating-to-androidx",
],
Expand Down
8 changes: 7 additions & 1 deletion static/asdocs/camerarollextended/all-classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ <h3><a href="class-summary.html" target="classFrame" style="color:black">All Cla
<tr>
<td><a href="com/distriqt/extension/camerarollextended/Orientation.html" title="com.distriqt.extension.camerarollextended.Orientation">Orientation</a></td>
</tr>
<tr>
<td><a href="com/distriqt/extension/camerarollextended/picker/PermissionlessPicker.html" title="com.distriqt.extension.camerarollextended.picker.PermissionlessPicker"><i>PermissionlessPicker</i></a></td>
</tr>
<tr>
<td><a href="com/distriqt/extension/camerarollextended/picker/PermissionlessPickerOptions.html" title="com.distriqt.extension.camerarollextended.picker.PermissionlessPickerOptions">PermissionlessPickerOptions</a></td>
</tr>
</table>
</body>
</html>
<!--Copyright distriqt 2016<br/>Mon May 20 2024, 10:12 AM +10:00 -->
<!--Copyright distriqt 2016<br/>Wed Dec 11 2024, 10:08 PM +10:00 -->
Loading

0 comments on commit 0d7a3dd

Please sign in to comment.