-1

First situation

Let's say I have a screen with several buttons placed in vertical order.

  • I distributed available space between them using weights.

  • So, on a large screen buttons get bigger. That's what I want.

But how I make the text look bigger to?

Okay, I took a class from here Auto-fit TextView for Android.

But is that normal that android does not have a standard approach for this and we have to use a custom class?

That's weird. How do developers deal with it?

Second situation

Let's say it's okay to use this custom class.

  • I have a ListView
  • I want the items to increase their height as the height of screen increases.

How do I do that? I found a difficult way to do that, but it all seems like lots of troubles.

How do developers usually do such things?

Or maybe developers don't resize list items at all?

Maybe it's okay if they are set in dp and look quite small on big tabs?

Community
  • 1
  • 1
T.Vert
  • 279
  • 2
  • 13
  • It depends entirely on how you are building your layout. If you are using XML, you define a different XML file for each size. – durbnpoisn Dec 23 '15 at 20:31
  • But what do you mean by "each size"? there're lots of screens in the world – T.Vert Dec 23 '15 at 20:47
  • If you're using Eclipse, you'll see that there are a number of layout folders. They are essentially for sm, md, lg, xglg, etc... All screens fit into one of those categories. What people normally do is design a layout for each. And, yes, there are hundreds of individual sizes. And yes, it's a pain to create for all of them. But many developers do exactly that. And don't forget about landscape and portrait. Need layouts for those too. – durbnpoisn Dec 23 '15 at 20:51
  • thanks a lot man :) P.S. there's just one layout folder in my Eclipse project. But for drawables, yes, there're a lot of them. That's why I was a little bit confused, like maybe layout components and their text sizes are intended to scale their height dynamically for each screen. – T.Vert Dec 23 '15 at 20:57
  • Yes. Drawables. That's what I meant... It's not just for text. It's for placement of ALL the elements. Every layout looks WAY different on a phone compared to a 10" tablet. And screen density (DPI), not just inches, is part of how it's calculated. I'm afraid you have some research to do. – durbnpoisn Dec 23 '15 at 21:00

1 Answers1

1

I'm adding this as answer because I did a lot of typing.

If you're using Eclipse, you'll see that there are a number of folders in Drawables. They are essentially for sm, md, lg, xglg, etc... All screens fit into one of those categories. What people normally do is design a layout for each. And, yes, there are hundreds of individual sizes. And yes, it's a pain to create for all of them. But many developers do exactly that. And don't forget about landscape and portrait. Need layouts for those too.

durbnpoisn
  • 4,666
  • 2
  • 16
  • 30