Connected by MOTOBLURâ„¢

-----Original message-----
From: HippoMan <hippo.mail...@gmail.com>
To: Android Developers <android-developers@googlegroups.com>
Sent: Fri, Dec 17, 2010 23:34:05 GMT+00:00
Subject: [android-developers] Re: Determining in advance how much text will fit 
into a given TextView?

Yes, but I can only apply this math if I know how the text will be
word-wrapped. This means that I have to word-wrap it myself and then
do the calculations.

The problem with this is that I may not wrap the text the same way
that the TextView (or other subsidiary object) wraps it.

I'm sure I can dig through the source code to find the algorithm that
the appropriate Android object uses to perform the word wrapping.
However, there is no guarantee that this is the same algorithm that
will be used in other Android versions. Therefore, my code might break
when run in the future.

For that matter, future versions of Android might also manage spacing
and fonts differently than today's version.

This is why I was hoping for a way to query Android objects,
themselves, to find out exactly how much text will fit into the
visible area of the View. If this info were returned via method calls,
it would be a lot less likely that future versions of these methods
would fail to provide the correct data for the given Android version.

But I guess I'm just SOL about this. It's too bad that Google didn't
see fit to encapsulate the functionality that I'm looking for. I
couldn't possibly be the only person who would need it.

-- 
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

-- 
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