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

Wrap Content width doesn't work for TokenCompleteTextView #356

Closed
spung opened this issue Jun 7, 2018 · 5 comments
Closed

Wrap Content width doesn't work for TokenCompleteTextView #356

spung opened this issue Jun 7, 2018 · 5 comments

Comments

@spung
Copy link

spung commented Jun 7, 2018

Hi, I am trying to use wrap_content for the width of my class which extends TokenCompleteTextView but this does not render correctly. I'd like for the width to wrap around the tokens present, so that any clicks to the right of the tokens will go to the underlying/parent layout. Is this possible?

@mgod
Copy link
Contributor

mgod commented Jun 7, 2018

Probably not. The token size is a little variable depending on the size fo the TokenCompleteTextView. There's no intrinsic size for the tokens (I'm assuming you're seeing tiny tokens with the view correctly wrapping them?), so there's not really a way to have the parent warp around them.

@spung
Copy link
Author

spung commented Jun 7, 2018

Thanks for the quick reply. Any thoughts on workarounds to get the clicks propagating to the parent view when there's no token there?

@mgod
Copy link
Contributor

mgod commented Jun 7, 2018

I would probably set visibility to GONE until you needed it, but you could probably also use a touch or click listener on the edit text to forward events to your underlying view.

@spung
Copy link
Author

spung commented Jun 7, 2018

Visibility won't work because I want this to happen when tokens are present. E.g. one token is displayed, any clicks to the right of it should go to the parent view. I'll investigate the second approach. If you think of anything else please let me know, thanks!

@mgod
Copy link
Contributor

mgod commented Jun 7, 2018

Ah, I misunderstood what you meant by "no token there". You meant that when the user clicks on the whitespace to the right of all the tokens, you want that click to go through, not just different behavior when there are 0 total tokens. This isn't possible as far as I know. #99 has some more discussion that might be helpful.

@mgod mgod closed this as completed Jun 7, 2018
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

No branches or pull requests

2 participants