I write my own text display component, which similar to TextView, but
I wanna handle the spacing between words, and show cursor if user
clicked on spacing, or show selection mark if user clicked on word.

I suppose this implementation is an easy job, I should write my own
component extended from TextView, and overrides a few functions, such
as onDraw(), onTouch(), etc.

However, I found it's more difficult than my anticipation, after I
study the source code of TextView. Because the TextPaint is a private
member in TextView, and be used everywhere. That means if I wanna
override onDraw(), I have to create my own TextPaint member, and
override each functions which use the private TextPaint member.

I don't understand why the TextPain member in TextView is private? I
don't know why TextView do not allows subclass to use its members
(TextPaint just one of them)? I just know this design is unfavorable
to extend from standard component to develop my own component.

Eventually, I write my own component extended from View, and write
each function manually. I think components in SDK should not with
private member, it is not convenient for Android designer, I suggests
to review it.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to