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

Option to make only one sticker / text / emoji / added view selectable at a time. #219

Closed
lucianocheng opened this issue Jan 7, 2020 · 3 comments · Fixed by #223
Closed

Comments

@lucianocheng
Copy link
Collaborator

lucianocheng commented Jan 7, 2020

The current editor behavior can have multiple stickers / views / text selected at a time (see screenshot). This is a consequence of having the MultiTouchListener instances not know about each other (one MultiTouchListener is attached to each sticker / view / text).

I have a fix for this, but I'm not sure if this is intended behavior. My guess is it's not, since a user won't be clicking and moving multiple stickers at the same time. Additionally, this is not the behavior in PhotoEditorSDK that this project is inspired by.

This also has other consequences, as a lot of my use cases require knowing the "currently selected" sticker / view / text. Specifically, for #214, I want to make the "currently selected" sticker / view / text not transparent click through, as it's really annoying to the user to click inside the HelperBox and have the sticker / view / text deselected.

TL;DR:

  • @burhanrashid52 please let me know if having multiple stickers / text / views selected at the same time is intended behavior.
  • If it isn't, I have a fix. If it is, let's discuss options for disabling it.

Screenshot illustrating current behavior:

Screen_Shot_2020-01-07_at_10_54_32_AM

@burhanrashid52
Copy link
Owner

Yes, you are right. This is not the intended behaviour. There should be one selected at a time.
I have got a few questions if you implement this.

  1. How the listener will work when anything is selected/Unselected?
  2. As you mention the click-through logic will not work on the selected view. So this is an assumption for this behaviour and corrects me If am wrong. If we've multiple views overlap and if click on top view then it will get selected and helper box will be visible. But if click on an empty area of the selected view then click through won't work?

@lucianocheng
Copy link
Collaborator Author

How the listener will work when anything is selected/Unselected?

For this, I'm assuming you mean the MultiTouchListener. I haven't ironed out all the details yet, but here's the general idea:

  • Every new selection clears all previous selections using clearHelperBox. We do this by a MultiTouchListener.OnGestureControl to the MultiTouchListener (this may actually already happen).
  • Clicking on no views (the background) clears all selections.
  • We track which view is selected by tagging it with a named View tag, or with a Optional we pass to the MultiTouchListener from PhotoEditor.

^^^ For this, I'll just show you in the PR. I almost have it done.

As you mention the click-through logic will not work on the selected view. So this is an assumption for this behaviour and corrects me If am wrong. If we've multiple views overlap and if click on top view then it will get selected and helper box will be visible. But if click on an empty area of the selected view then click through won't work?

This is correct. If you click on an empty area, in a selected view, click through will not work and the current selected view will remain selected. I believe this to be ideal behavior, both from user testing and how PhotoEditorSDK works.

@burhanrashid52
Copy link
Owner

Sounds great!!. Let me know when you are done. I'll review the PR

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

Successfully merging a pull request may close this issue.

2 participants