Re: [android-developers] Re: Determining in advance how much text will fit into a given TextView?

2010-12-18 Thread Kostya Vasilyev
Would like to point out this method, which measures text, and stops as soon as measured-so-far text width exceeds a supplied limit: http://developer.android.com/reference/android/graphics/Paint.html#breakText(java.lang.CharSequence, int, int, boolean, float, float[]) Use this instead of

Re: [android-developers] Re: Determining in advance how much text will fit into a given TextView?

2010-12-18 Thread emaildevbr.str...@gmail.com
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?

[android-developers] Re: Determining in advance how much text will fit into a given TextView?

2010-12-18 Thread HippoMan
On Dec 18, 4:54 am, Kostya Vasilyev kmans...@gmail.com wrote: [ ... ] Use this instead of measureText, to avoid calculating width for the same text over and over again (from current position to the end of the string). Thank you very much. -- You received this message because you are

[android-developers] Re: Determining in advance how much text will fit into a given TextView?

2010-12-17 Thread HippoMan
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

Re: [android-developers] Re: Determining in advance how much text will fit into a given TextView?

2010-12-17 Thread Tom Gibara
From a Google UI engineer: http://www.pushing-pixels.org/2010/12/16/meet-the-green-goblin-part-4.html On 17 December 2010 23:33, HippoMan hippo.mail...@gmail.com wrote: 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

[android-developers] Re: Determining in advance how much text will fit into a given TextView?

2010-12-17 Thread HippoMan
Thank you! Now I think I more or less understand the basic principles that are outlined in that article, and I'm pretty sure that I'll fill in any remaining gaps in my knowledge as I dig in and apply these principles to my own case. I'll post my results or any questions I might have if I hit any

[android-developers] Re: Determining in advance how much text will fit into a given TextView?

2010-12-14 Thread HippoMan
I've already looked at the TextView source, as well as the source of the Paint object and other objects. I haven't been able to find anywhere where the data I'm looking for is stored, or at least returnable. But there are many android objects to look through, and as I mentioned, I'm trying to

[android-developers] Re: Determining in advance how much text will fit into a given TextView?

2010-12-14 Thread HippoMan
PS: Is there perhaps a better object to use for this purpose than a TextView? -- 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

[android-developers] Re: Determining in advance how much text will fit into a given TextView?

2010-12-14 Thread Brill Pappin
Well you should be able to get the metrics of the font and the size of the textview... if you can get all that, then some quick math should tell you how many lines will fit in the view. - Brill Pappin On Dec 14, 12:36 pm, HippoMan hippo.mail...@gmail.com wrote: I've already looked at the