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

Allow access to objects from outside (remove some private's) #371

Closed
anderbytes opened this issue Jul 4, 2021 · 4 comments
Closed

Allow access to objects from outside (remove some private's) #371

anderbytes opened this issue Jul 4, 2021 · 4 comments
Labels
question Further information is requested

Comments

@anderbytes
Copy link
Contributor

Would it be possible to let be public the array of Views created inside the editor?

Sometimes we need to customize an added text or another object in a way that your current methods doesn't support, and creating SEVERAL methods inside your app just to do some simple changes isn't very productive.

@burhanrashid52
Copy link
Owner

Can you share a usecase or example ?

@burhanrashid52 burhanrashid52 added the question Further information is requested label Jul 5, 2021
@anderbytes
Copy link
Contributor Author

anderbytes commented Jul 9, 2021

Can you share a usecase or example ?

Providing an array of the TextViews, ImageViews, etc from inside the editor would make it possible for us developers to widely customize their behaviour, content, etc without having to create withText this witText that...

if the editor would provide a simple List and List and other as such, and made their objects public, we devs would be responsible for any visual customization, instead of making you responsible for creating those "doors".

If what I think was possible, wouldn't be any need of withTextShadow, withTextColor, withTextFont, etc etc etc... we would just control it as a regular object.

As is it today, it just seems that the editor , for some reason, "needs" to intermediate those simple customization that these views and widgets already.

Instead of TextStyleBuilder class, we would edit color of a text as simple as:

val texts = PhotoEditorViewObject.Texts
for (t in texts) {
    t.textColor = R.color.some_color
}

that above would be enough to change all the text colors to one specific color. Or the dev could use "ifs" to change a specific one, or even put "t" object in another variable and work across the code, doesn't matter.

@burhanrashid52
Copy link
Owner

We have this discussion before. Doing this will exposing too much.

Internally PhotoEditor set touche listeners on views to scale and rotate and some state saves inside view object. If we expose views to the client they can change or remove all the listener and state on the view which will break PhotoEditor and causes expected bugs.
#280 (comment)

It's not advisable, but If you want to customize on that level you can excess those views PhotEditotView.getChildren() method which will return all the views.

@anderbytes
Copy link
Contributor Author

Got it... I just managed to used getChildren to do some customizing already, it's not as flexible and structured as hoped, but it works. Thanks!

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

2 participants