Those members are private, either because there are other ways to
achieve the same goal, or because they might change in the future in a
what that would break applications that rely on it. I guess that your
situation is the second one.

JBQ

On Mon, Mar 2, 2009 at 8:09 PM, Alger, Lin <addr...@gmail.com> wrote:
>
> 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.
> >
>



-- 
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

Questions sent directly to me will likely get ignored or forwarded to
a public forum with no further warning.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to