Android Question Screen Scaling for 4:3 Ratio (Samsung S2)

lip

Active Member
Licensed User
Longtime User
My App runs in Landscape mode only and was originally designed for earlier Samsung 10 inch tablets only (8:5 Ratio 1280 x 800 pixels). I've used dip for all view sizes so it runs happily on the new 10 inch Tab A which is the same 8:5 ratio but 1920 x 1200 pixels.

However, it will not work on the Samsung S2 which is 4:3 aspect ratio (2048x1536). The app fills the screen vertically but disappears off the right of the screen.

The app has 10 activity screens with hundreds of views, some are defined in designer and others are defined and adjusted problematically so it would be a huge task to either start using anchors or percentage of screen width. I don't need it to work on every device, just Samsung tablets.

Is there a way that I can persuade the 'dip' calculation to be calculated based on the screen width, rather than the screen height? The app would then fill the screen horizontally, leaving a gap at the bottom. Possibly a 'scale' setting?
 

MarkusR

Well-Known Member
Licensed User
Longtime User
you can define a new variant with 4:3 and edit this layout, make sure all anchors are set correct. (at runtime the designer shows the used screen size left buttom)
or you can use a script in designer to align your controls for all variants, or just one variant.

The app fills the screen vertically but disappears off the right of the screen.
why ? do you have a unused variant there ?
i believe there was a config file for some devices .. see AbstractLayouts.txt in setup folder of b4a ide
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Is there a way that I can persuade the 'dip' calculation to be calculated based on the screen width, rather than the screen height? The app would then fill the screen horizontally, leaving a gap at the bottom. Possibly a 'scale' setting?
Check Klaus's Auto Scale module. I think that it supports "stretching" layouts.
 
Upvote 0
Top