Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get instance of ImageView on addImage #122

Open
iMJ007 opened this issue Dec 23, 2018 · 5 comments
Open

Get instance of ImageView on addImage #122

iMJ007 opened this issue Dec 23, 2018 · 5 comments
Labels
question Further information is requested

Comments

@iMJ007
Copy link

iMJ007 commented Dec 23, 2018

Is there a way to get the instance of image view when we use addImage(bitmap); function for easy bitmap edit/update to same view instead of removing and re-adding view?

@burhanrashid52
Copy link
Owner

In this version, there is no way to do that. I am thinking for this kind of customization in next release. Not confirm. Just thinking

@burhanrashid52 burhanrashid52 added the question Further information is requested label Dec 25, 2018
@iMJ007
Copy link
Author

iMJ007 commented Dec 26, 2018

In this version, there is no way to do that. I am thinking for this kind of customization in next release. Not confirm. Just thinking

It would be really helpful if the addImage(bitmap) returns the instance of ImageView so that we could perform some further editing on same view such as editing colors on a bitmap etc and just replace the bitmap on same view instead of clearing and adding image view again. Even getting instance of text views could be helpful.

@lucianocheng
Copy link
Collaborator

As @burhanrashid52 mentioned in #142 , I think returning the raw View objects is probably exposing too much.

If a user of the library is given access to the View directly, this is essentially "promising" that return type as part of the PhotoEditor API. If we made changes to the View stack for the stickers / text / etc, that would break that promise.

A good solution would be a "Handle" object to the View that we control that allows for specific functions. This is how file descriptors / file handles are handled on POSIX, or how network connections are handled with socket management. That "Handle" would be an object we define, and allow for things like "replace image", "move to coordinates X, Y", etc.

Using a handle would also allow for easier testing and let us manage business logic for specific use cases.

@lucianocheng
Copy link
Collaborator

@burhanrashid52 do you have any thoughts on what I wrote above? This is related to a lot of other tickets such as #43, #183, #212, and others. Essentially any functionality that involves custom code related to a sticker, emoji or text view.

@burhanrashid52
Copy link
Owner

Is this Handler object smiliar to config object i.e TextStyleBuilder ? If not then can you share any example or link. Just need to understand how this handle object works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants