Xamarin.MediaGallery icon indicating copy to clipboard operation
Xamarin.MediaGallery copied to clipboard

Feature - custom albums

Open beeradmoore opened this issue 1 year ago • 16 comments

Description

Adds the ability to create albums when saving assets.

Related to issue

Fixes #122

API Changes

No breaking changes. SaveAsync now has an additional argument albumName which is null by default. If albumName is null then we continue doing what we do (iOS: No album, Android: Album created of the same name as the app). If albumName is an empty string then no album will be created on both iOS and Android. If albumName is anything else, then an album is created with that name on both iOS and Android.

Recommendations for testing

I didn't update the sample app as I wasn't sure how to express "keeping this blank will make an album on Android, no album on iOS". But the way I tested was by changing things in SaveVM.cs, from:

await MediaGallery.SaveAsync(type, stream, name);

to:

await MediaGallery.SaveAsync(type, stream, name, "My Album");

PR Checklist

  • [x] All projects build
  • [x] Has samples
  • [x] Rebased onto current main

beeradmoore avatar May 25 '23 06:05 beeradmoore