Robert, one thing I have done to mitigate this problem is have special code in my onCreate that checks for "table-like" resolutions (e.g., width or height > 854) and then do perform a scaling function on the text sizes of those TextViews that need it. It works, but makes assumptions I would not like to make about display resolution and physical screen size. This obviously is not ideal, and is a hack. That's why I was wondering if the folks at Google could suggest a better way to do this.
On May 26, 7:22 pm, Robert Green <[email protected]> wrote: > I also want to do this exact same thing. I don't want mytextto be > the same physical size - I want it to be bigger when there are more > pixels regardless of density (yes it means super bigtexton a 10" > screen). Since Android made compatibility mode a postage stampish > kind of mode on tablets instead of just magnifying (like I really, > really think it should have) it broke all my legacy games (they look > like crap on the tablets) and now I have lots more updating work to > do, but since I was stupid about it and usedtextviews for games like > Wixel (which used to sound like a good idea for what kind of game it > was but now I'm regretting using anything other than a single custom > view that I have control over) I have a ridiculous amount ofscaling > around of things that probably will need additional work later as > different screens come out... > > On May 25, 11:49 am, Mike <[email protected]> wrote: > > > > > > > > > OK. Having a day or so to think about this, I think I asked the wrong > > question. > > > So, let me try again: > > > Is there way to do fontscalingsimilar to the way you can assign > > percentages to a layout? > > > I realized that with my existing portrait mdpi layout, I was > > inadvertently relying on the height of some of mytextto affect the > > placement of Views that came below thetext. This looks great on a > > myTouch, but crappy on a Galaxy Tab 10.1 since there are so many > > remaining vertical pixels (even with the fontscalingusing dp units.) > > > Regards, > > > - Mike > > > On May 23, 4:46 pm, Dianne Hackborn <[email protected]> wrote: > > > > The font size should be the same on those two devices (myTouch and Galaxy > > > Tab 10.1) because they have the same density. What is bringing you to > > > think > > > they should be different? > > > > On Mon, May 23, 2011 at 3:34 PM, Mike > > > <[email protected]>wrote: > > > > > Hi Dianne, > > > > > Thanks for the quick reply. > > > > > I understand density to be a function of native resolution versus > > > > physical display size. So, the new Galaxy Tab 10.1 which has a native > > > > resolution of 800 x 1280 pixels and a physical display size of 10.1" > > > > diagonal ends up being a mdpi device. When I populate a > > > > DisplayMetrics for the Galaxy Tab 10.1, it gives me a density of 1.0 > > > > and a density dpi of DENSITY_MEDIUM which confirms this. > > > > > I misspoke with regard to the Evo. I apologize. It is indeed an hdpi > > > > device. > > > > > In any case, I believe I still need to address this issue since a > > > > device such as the myTouch (320x480 native resolution) is an mdpi > > > > device as well. Even though the myTouch and Galaxy Tab 10.1 have > > > > drastically different native resolutions as you point out. I've been > > > > having difficulty using device independent units for mytextsize to > > > > make the font look appropriate on both devices since they map to the > > > > same layout file. > > > > > - Mike > > > > > On May 23, 4:16 pm, Dianne Hackborn <[email protected]> wrote: > > > > > Evo and Galaxy Tab are both hdpi (though the Tab technically should > > > > probably > > > > > be mdpi... hdpi is okay though, it is just a design decision for the > > > > device > > > > > to make the overall UI larger). > > > > > > Also density != "higher res". It is REALLY REALLY important to > > > > understand > > > > > this. The Xoom is mdpi but much higher resolution than the hdpi > > > > > phones. > > > > It > > > > > just has a bigger screen, but as a result is lower density. > > > > > > If all you care about is the screen resolution (that is you don't care > > > > > really about having your UI size remain about the same across > > > > > devices), > > > > then > > > > > don't use density which will pick resources based on *screen density* > > > > > not > > > > > resolution. You could instead use -nodpi and just do your own > > > > > resource > > > > > selection based on how many pixels you have to use. > > > > > > On Mon, May 23, 2011 at 2:35 PM, Mike <[email protected] > > > > >wrote: > > > > > > > I've started work to get my games to scale nicely for the higher-res > > > > > > displays like the Xoom and Galaxy Tab devices. > > > > > > > I've made use of the ldpi/mdpi/hdpi/xhdpi folder naming convention > > > > > > for > > > > > > my resources which works nicely for layouts and graphics, but not so > > > > > > much fortextsizescaling. The problem is that an Evo and a Galaxy > > > > > > Tab 10.1 are both mdpi devices and will map to the same layout file. > > > > > > Yet, I need to scale thetextsize differently for these two devices. > > > > > > (I'm usingtextsize units of dp.) > > > > > > > Any ideas on something obvious I might be missing or any suggestions > > > > > > would be much appreciated. > > > > > > > - Mike > > > > > > > -- > > > > > > 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 > > > > > > -- > > > > > Dianne Hackborn > > > > > Android framework engineer > > > > > [email protected] > > > > > > Note: please don't send private questions to me, as I don't have time > > > > > to > > > > > provide private support, and so won't reply to such e-mails. All such > > > > > questions should be posted on public forums, where I and others can > > > > > see > > > > and > > > > > answer them. > > > > > -- > > > > 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 > > > > -- > > > Dianne Hackborn > > > Android framework engineer > > > [email protected] > > > > Note: please don't send private questions to me, as I don't have time to > > > provide private support, and so won't reply to such e-mails. All such > > > questions should be posted on public forums, where I and others can see > > > and > > > answer them. -- 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

