0

I am setting my mobile app to work in tablets, one of the many things that need to be tweaked is the fon t size of menus which in an 10" screen are too small. So I'm looking for a global variable that change that font size like you can do with textViews and similar things with

<dimen name="size_font_view_tex">21sp</dimen>

inside dimens-wXXXdp/dimens.xml

Anybody know the name (if it is) of the dimen resource that changes the size of menus?

Bonus: List of all dimen resources

petrumo
  • 1,116
  • 9
  • 18
Westside Tony
  • 708
  • 7
  • 20

3 Answers3

0

You have to use the different layouts for different size of screen.As you stated the 10" screen you have to make the folder layout-large in your res folder and make the layout according to need. Hope this will help you.

  • In android as you can set a layout-wXXXdp folder you also can specify a dimens-wXXXdp folder and specify setting as font size globally instead of change every layout iam looking for the right property, anyways, thanks for your time! – Westside Tony Jan 10 '17 at 10:30
0

form How to set text size of textview dynamically for different screens

You should use the resource folders such as

values-ldpi
values-mdpi
values-hdpi

And write the text size in 'dimensions.xml' file for each range.

And in the java code you can set the text size with

textView.setTextSize(getResources().getDimension(R.dimen.textsize));

Sample dimensions.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <dimen name="textsize">15sp</dimen>
</resources>
Community
  • 1
  • 1
Sadiq Md Asif
  • 882
  • 6
  • 18
0

When you create a new layout with right click, you can manage this creation with a "available qualifers".

Here for size, keep the qualifer size and set the screen size that you want.

For example you can set x-large to create a tablet layout for the same screen that you already created before.

more explain : https://developer.android.com/guide/practices/screens_support.html

Rémy
  • 313
  • 3
  • 17