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

Support for custom spans #1

Open
antonkrasov opened this issue Dec 7, 2014 · 3 comments
Open

Support for custom spans #1

antonkrasov opened this issue Dec 7, 2014 · 3 comments

Comments

@antonkrasov
Copy link

Hi,

First of all, thanks for your library, it looks really nice.
But it will be much better to give an ability to add custom spans.

Thanks.

@hboregio
Copy link
Owner

hboregio commented Dec 7, 2014

Hey Anton, thanks for the feedback. I actually thought about adding this, but my main goal while developing this library was to completely abstract it from the idea of Spannables, and letting people attach their custom spans would kind of defeat this purpose. Since this is just a wrapper around Spannables, I guess the only way to give user 100% of the functionality of spans without having to expose them to Spannables themselves, would be to add the fews spans that the library's missing (drawables for example) and hopefully that would be enough and there wouldn't be the need to add customs spans. Unless you have a better approach of course, them I'm all ears :)

@antonkrasov
Copy link
Author

I understand your idea to hide spans, they are awful, but it's always a good idea not to limit users of the library, as you don't know what they need :) Possibly it's possible to wrap some spans with own interface and give users an ability to implement onDraw method. For sure one more important this will be adding an ability to hand click on specific pieces.

For example I want to use this textview to display "Website: \nPhone: ", it's much better to have one TextView then 4, but I need to have an ability to handle clicks separately on website and phone.

Adding an ability to add custom spans is the most easy way to make it possibly. Adding own interfaces is another way, but it's more complex :)

@hboregio
Copy link
Owner

hboregio commented Dec 8, 2014

Yeah, definitely agree with being able to define click events for the different spans.

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

No branches or pull requests

2 participants