Android Question Adjust views to device screen resolution

vecino

Well-Known Member
Licensed User
Longtime User
Hi, every time I design a screen I run into the big problem that it fits well on some, looks small on others, doesn't fit on others, etc.
Users start calling complaining about the size, and you have to adjust everything to each device. It's a pain.
What method is best to adjust everything as automatically as possible?
Thank you.

screenshot.png
 

MrKim

Well-Known Member
Licensed User
Longtime User
In fact, anchors and scripts must be used.

There is this method:
View attachment 122744


I meant that you have to choose which layout to load based on the size of the display - not its resolution. Create a layout for smartphones and one for tablets. However, as far as the pixel density is concerned, for the same size of the displays, dip is used. As for the relationship between base and height, continuing to thank the producers ???, we have to make do, generally leaving at least a ten dip free on the edges.
Doh! (slaps forehead) ActivitySize. How do I keep missing these obvious tidbits? You know before I wrote the post I opened designer to make sure I was correct and still didn't find it, but I was looking for GetDeviceLayoutValues.ApproximateScreenSize. Thank you.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Doh! (slaps forehead) ActivitySize. How do I keep missing these obvious tidbits? You know before I wrote the post I opened designer to make sure I was correct and still didn't find it, but I was looking for GetDeviceLayoutValues.ApproximateScreenSize. Thank you.
"Always" press CTRL+SPACEBAR to get a list of all available commands/keywords ;)
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
"Always" press CTRL+SPACEBAR to get a list of all available commands/keywords ;)
I opened designer, went to scripts, pressed CTRL+SPACEBAR. It does nothing on my Asus Win10 computer.

ActivitySize - I simply would not associate this with screen size in inches in my head. I have a special knack for not being able to find the commands I need.?
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
"It DOES work in the IDE, just not the designer. "

That animated gif, as you can see, is the Designer.
If it doesn't work for you, in a new project and placing the cursor on an empty line (designer-script) open a thread asking the question.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
ActivitySize - I simply would not associate this with screen size in inches in my head. I have a special knack for not being able to find the commands I need.?
I too have a lot of trouble finding the right commands, both in the design and in the code, but I guess it's because I don't think in English.
 
Upvote 0
Top