Android Question Version 3.20 AutoscaleAll

Toley

Active Member
Licensed User
Longtime User
I know there are some changes in the AutoscaleAll with the new version. But it don't seems to work at all here. Our older tablet was a 800x600 one and now we have to change for a 1024x768 one. On the older versions all we have to do in the designer script is :
B4X:
AutoScaleRate(0.21)
AutoScaleAll
And then we were full screen on the new tablet. But now AutoscaleAll seems to do nothing.
 

Toley

Active Member
Licensed User
Longtime User
800x560 (because the taskbar was removed on the original tablet) and 1024x768 (for the new tablet)
The older tablet run android 2.2 while the new run 4.0.
 
Upvote 0

Toley

Active Member
Licensed User
Longtime User
Ok if I understand well I have to remove the 1024x768 variant right ?
This is what I did but it did not rescale like I think it should do by only add AutoScalAll. I have to add AutoScaleRate(1.0) to get a correct scale on the 1024x768 tablet. In my case I am lucky I know the new size of the new tablet and can make adjustment.
I would think AutoScaleRate(1.0) was the default value.
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
In 3.2, I have a device with 1440 x 816 with a DPI of 1.5. The AutoScaleAll does not work at all. So, I deleted this variant and created a new one with 1400 x 800 and AutoScaleAll still will not work. I have also added the code:

B4X:
Dim jo As Java Object
jo.InitializeStatic("java.lang.System").RunMethod("setProperty", Array As Object("autoscaleall_old_behaviour", "true"))

I have over 75 screens and some with 100+ objects and do not want to have to change them all to work in 3.2. In version 3.0, they all run and work as expected on any device I have used them on. Is there other samples or threads in the forum that I have missed?
 
Upvote 0

margret

Well-Known Member
Licensed User
Longtime User
Is this only when the program runs and not in the designer? I did add the code and in the designer when I run the script, there is no change in the screen. In 3.0, running the script with the same layout shows the screen scale change. So, the added code must be to support runtime and not the designer, is this correct?
 
Upvote 0

belangelot

New Member
Licensed User
Longtime User
I have the same problem than Margret in version 3.2. The designer does not display changes with AutoScallAll. Individuals scripts do not affect the display. Effectively with older versions we saw in the designer when the scripts run (with all kinds of variant). It was easier to control.
Basic variants (320x480 smartphone), with AutoScallAll, could be expanded to 1280x960 for a tablet. In this way applications can run on all kinds of screens.
Now I can't get this result.
I used the designer correctly ... I think (because all were OK before)
Is AutoScallAll allows this functinnality to adapt the layouts in version 3.2?
Maybe I missed a step.

Thank you to clarify this issue.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I think that you should only use the old behavior with current projects that relied on this behavior. The old behavior was wrong and confusing.
The purpose of AutoScaleAll is to take the layout you designed and scale it based on the actual device size. If you designed a 7'' layout and you run it on a 7'' device then the layout should not be affected by AutoScaleAll.
 
Upvote 0
Top