0

I have a 4*2 widget which contains a textView which is Fill_Parent. I have the textSize set to 30dp and works flawless on my HTC Sensation.

On galaxy mini the text wont fit and the user cannot read the text because it's just to much text.

So is there any tip or something I can do to adjust textSize to make my text fit?

Thanks!

AndroidXTr3meN
  • 399
  • 2
  • 9
  • 19

1 Answers1

0

If it is too long any easy fix would be defining the ellipse size to marquee. Otherwise I would suggest getting the height and width of the TextView at run time, if it is below a certain threshold then set the textSize to a smaller value.

Sam
  • 86,580
  • 20
  • 181
  • 179
  • is that possible with a widget? – AndroidXTr3meN Apr 28 '12 at 20:13
  • Ha, short term memory loss; run time doesn't really apply. Perhaps you could let the user build the widget themselves and define an appropriate textSize. But that may over-complicate what you want to do. – Sam Apr 28 '12 at 20:19
  • Here's a link to [scrolling in a widget](http://stackoverflow.com/questions/7868748/is-it-possible-for-textview-marquee-in-a-widget-that-extends-appwidgetprovider) if you to go this route. – Sam Apr 28 '12 at 20:24
  • Well, user might not understand what prefrences is :) – AndroidXTr3meN Apr 28 '12 at 21:19