Android Question AutoScale problem

edgar_ortiz

Active Member
Licensed User
Hi,

I have made some applications that are used on phones, usually with few fields on each screen and they work fine.

Now I have to make an application that will be used on tablets, because many fields are used.

And I have a problem with the AutoScale ...

I made the design with a size of 320 x 480 and another 600 x 960 and it DOES NOT work

What am I doing wrong?

Greetings,

Edgar

P.S.:
What is the recommended size to use when designing?
 

Attachments

  • Test_AutoScale.zip
    30.9 KB · Views: 92
  • screen320_480.jpg
    screen320_480.jpg
    170.9 KB · Views: 119
  • screen600_960.jpg
    screen600_960.jpg
    213.9 KB · Views: 125

Erel

B4X founder
Staff member
Licensed User
There are too many mistakes for me to list them all but I will try:

1. You are using the old CustomListView module instead of xCustomListView library.
2. You are not using anchors / designer script correctly.
3. You don't need to have two layout files. The whole idea of variants is that you can use a single layout with several variants.
4. With that said, you can also use a single variant with some designer script.
5. AutoScaleAll is never the solution for anything. It just slightly increases or decreases the views based on the difference between the variant and the real size.
The correct solution is to use anchors and designer script.
If AutoScaleAll doesn't work as you like then delete it.

6. You shouldn't have two activities based on the two layouts.
7. The sooner you switch to B4XPages the sooner things will become simpler.
 
Upvote 0

edgar_ortiz

Active Member
Licensed User
There are too many mistakes for me to list them all but I will try:

1. You are using the old CustomListView module instead of xCustomListView library.
2. You are not using anchors / designer script correctly.
3. You don't need to have two layout files. The whole idea of variants is that you can use a single layout with several variants.
4. With that said, you can also use a single variant with some designer script.
5. AutoScaleAll is never the solution for anything. It just slightly increases or decreases the views based on the difference between the variant and the real size.
The correct solution is to use anchors and designer script.
If AutoScaleAll doesn't work as you like then delete it.

6. You shouldn't have two activities based on the two layouts.
7. The sooner you switch to B4XPages the sooner things will become simpler.

Erel,

Thanks for your time... your comments were helpful.

1- Update to xCustomListView
2- I hope now to be using the anchors / designer in the correct way, use a layout at 320 x 480 and all the fields anchored upwards, except the fields of the last line, anchored to the bottom.
3- As it is a small test project, I had a layout for each activity (just to show the problem)
4- It is understood
5- Thanks, I got the idea and only modified the vertical position and the Height of the fields.
6- This was just to show the problem
7- I don't understand the relationship between B4XPages and the 'AutoScale' of many fields in a layout

Now the problem I have is that I lose the "Border" of the CustomView

I attach the project already modified.

Any help is welcome

Regards,

Edgar
 

Attachments

  • update.jpg
    update.jpg
    236 KB · Views: 91
  • Update_Test_AutoScale.zip
    31.3 KB · Views: 88
Upvote 0

Erel

B4X founder
Staff member
Licensed User
1603177335022.png


Anchors are still incorrect.

The one before last row of buttons should be anchored to the bottom.

You should use designer script to make the two CLVs fill the available space:
B4X:
AutoScaleAll
top = lbMoreInfo.Bottom + 5dip
bottom = lbAdd.Top - 5dip 'fix the anchors first
h = (bottom - top) / 2
clv1.SetTopAndBottom(top, top + h)
clv2.SetTopAndBottom(top + h + 5dip, bottom)

I haven't checked the border issue. I'm sure that you will be able to solve it.
 
Upvote 0
Top