NativeScript / nativescript-imagepicker

Imagepicker plugin supporting both single and multiple selection.
Apache License 2.0
104 stars 74 forks source link

refactor(android): add mimeTypes property to ImagePicker class #304

Closed xuhcc closed 5 years ago

xuhcc commented 5 years ago

Following the discussion in #301

PR Checklist

What is the current behavior?

On Android, even when media type is set to ImagePickerMediaType.Any, it is not possible to select any file except image or video, everything else is greyed out.

What is the new behavior?

Behavior remains the same, but the new code structure would allow customization of picker behavior in subclasses, for example:

class FilePicker extends ImagePicker {

    get mimeTypes() {
        let mimeTypes = Array.create(java.lang.String, 1);
        mimeTypes[0] = '*/*';
        return mimeTypes;
    }
}
tgpetrov commented 5 years ago

@xuhcc Can you rebase this one as well?

xuhcc commented 5 years ago

Yes, rebased.

xuhcc commented 5 years ago

Thanks!