burhanrashid52 / PhotoEditor

A Photo Editor library with simple, easy support for image editing using paints,text,filters,emoji and Sticker like stories.
MIT License
4.13k stars 991 forks source link

Make the ImageView customisable. #364

Closed gilons closed 3 years ago

gilons commented 3 years ago

Is your feature request related to a problem? Please describe. Currently, I'm working on a react-native library that is using this library in android. I'm interested in using react-native's ImageView implementation as the resource but the property resource is not assignable(Kotlin).

Describe the solution you'd like I think just making the property assignable will give the possibility to the library to use a custom image view other than android's ImageView

Describe alternatives you've considered

Additional context I can open a PR for that if you wish since I urgently need it.

burhanrashid52 commented 3 years ago

ImageView implementation as the resource

I did not understand it. Can you share an example ?

gilons commented 3 years ago

Here https://github.com/burhanrashid52/PhotoEditor/blob/fa11ad85341aa852d946e774bf09da0539d77afd/photoeditor/src/main/java/ja/burhanrashid52/photoeditor/PhotoEditorView.java#L127 In the implementation of PhotoEditorView.java, the getResource method returns an ImageView and resource is not assignable.

gilons commented 3 years ago

Is that clear enough or you need more details?

burhanrashid52 commented 3 years ago

You can use ImageView instance to set your image.

Resources res = getResources(); /** from an Activity */
photoEditor.getSource().setImageDrawable(res.getDrawable(R.drawable.myimage));
gilons commented 3 years ago

Thanks Is it possible to change the default ImageView? that's what I want to achieve

burhanrashid52 commented 3 years ago

No currently it's not.

gilons commented 3 years ago

That's the feature I'm currently requesting

burhanrashid52 commented 3 years ago

What other Object you want in return instead of ImageView ?

gilons commented 3 years ago

React Native's ImageView implementation Since it's the base image view for react-native apps and it has many things already handle and loading is done with facebook's fresco. The idea is to give the ability to use any other image view like a cacheable one.

burhanrashid52 commented 3 years ago

Can you pseudo code here ?

gilons commented 3 years ago

https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java

gilons commented 3 years ago

Can you pseudo code here ?

what do you want me to speudocode?

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 20 days with no activity. Remove stale label or comment or this will be closed in 4 days.

github-actions[bot] commented 3 years ago

This issue was closed because it has been stalled for 5 days with no activity.