Android Question Endless questions about the Designer

LucaMs

Expert
Licensed User
Longtime User
I would avoid using percentages once and for all.

I tested this simple layout on the Cloud.
In the script I have only AutoScaleAll.

Disproportions are very evident. The Button is too big (or to small on Galaxy)
upload_2016-2-11_12-38-22.png
 

LucaMs

Expert
Licensed User
Longtime User
A good way to take advantage of the extra space available on a tablet than a smartphone could be put, next to "a common layout", a menu which, in the version for smartphones, should be displayed by pressing a button or by scrolling the screen:
upload_2016-2-13_13-33-16.png


This is an example of what Erel probably means and I can agree.

But...
If I wanted (and often we want) create layouts for CLV items or for Dialogs, they should look nice on both devices.

I'm not sure, but in these cases we need to use percentages or set ScaleRate > 0.3 (default), at least 0.75, I think.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
A good way to take advantage of the extra space available on a tablet than a smartphone could be put, next to "a common layout", a menu which, in the version for smartphones, should be displayed by pressing a button or by scrolling the screen:
View attachment 41502

This is an example of what Erel probably means and I can agree.

But...
If I wanted (and often we want) create layouts for CLV items or for Dialogs, they should look nice on both devices.

I'm not sure, but in these cases we need to use percentages or set ScaleRate > 0.3 (default), at least 0.75, I think.


Some of my posts are despised; perfect, then this is my last post.
 
Upvote 0

ivan.tellez

Active Member
Licensed User
Longtime User
You're right, don't answer. There are 10h thread like this from me and 100h questions about this from 10h members.
But I can say the Designer DOES NOT WORK AS EXPECTED.

Maybe you are really confused about the Designer. It works as expected, not as you wanted.

This is an example of what Erel probably means and I can agree.

Yes, thats the idea behind the Designer's default behavior.

But...
If I wanted (and often we want) create layouts for CLV items or for Dialogs, they should look nice on both devices.

Of course, we all SOMETIMES need this, just use the scripts.

B4X:
PnlStatus.SetLeftAndRight(5%X, 19%x)
PnlStatus.SetTopAndBottom(2%y, 2%y+14%x)
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Some of my posts are despised; perfect, then this is my last post.

I'll post other questions: at least someone else will answer.



Maybe you are really confused about the Designer. It works as expected, not as you wanted.

Well, Ivan, what do you think you should get from the test below?


AutoScaleRate - Sets the scale rate. This is a number between 0 to 1. The default value is 0.3.
Value of 1 means that the scale factor is exactly proportional to the device physical size.
upload_2016-2-15_3-38-8.png


Variant: 480 x 320 scale = 1
ImageView1: 320 x 320 ( = variant height)
Script: AutoScaleRate(1) and AutoScaleAll
Full Screen = True - Show Title = False (Layout and Activity)

Bitmap (400 x 400):
upload_2016-2-15_3-42-50.png


Activity code (project attached):
B4X:
Log("Activity     (W x H): " & Activity.Width & " x " & Activity.Height)
Log("Image1View   (W x H): " & ImageView1.Width & " x " & ImageView1.Height)

Dim bmp As Bitmap = LoadBitmap(File.DirAssets, "Circle.png")
ImageView1.Bitmap = CreateScaledBitmap(bmp, ImageView1.Width, ImageView1.Height)


Well, Ivan, what do you think you should get from the test "now above"? What dimensions ImageView will have?
LOG:
Activity (W x H): 1280 x 752
Image1View (W x H): 839 x 839

upload_2016-2-15_3-46-0.png


No, the problem is not the navigation bar. Smartphone 800x480-1.5
upload_2016-2-15_3-58-24.png


I know I could use SetTopAndBottom or other, but I'm so stupid to expect an auto scale as I thought.
 

Attachments

  • DesignerTest.zip
    15.4 KB · Views: 229
Last edited:
Upvote 0

ivan.tellez

Active Member
Licensed User
Longtime User
but I'm so stupid to expect an auto scale as I thought.

Actually the algorithm of the autoscale is explained in the Beginners Guide. So, why are you expecting something different?

autoscale is not enought to get good results on every device.

I use the designer the way it was designed, the designer has the tools to create what you what, in this case, no code is needed, just use the anchors and it will work as expected on every device.


Log:

Activity (W x H): 1196 x 768
Image1View (W x H): 790 x 768

test.jpg
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
@LucaMs
klaus said:

I have never said this about the DesignerScripts, but aboute the AutoScale code mudule !!!
I know what AutoScale in the DesignerScripts can do and cannot do.
It is not honest taking a phrase out of its context letting say it something diiferent, and wrong !
It is the second time you are doing this and I had already answered the same.
I hope I don't need to do it a third time !
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
in this case, no code is needed, just use the anchors
I know I could use SetTopAndBottom or other,

The one below was the question, but it 'does not matter. I know how to fix these things, of course.
Well, Ivan, what do you think you should get from the test below?



@LucaMs
klaus said:


I have never said this about the DesignerScripts, but aboute the AutoScale code mudule !!!
I know what AutoScale in the DesignerScripts can do and cannot do.
It is not honest taking a phrase out of its context letting say it something diiferent, and wrong !
It is the second time you are doing this and I had already answered the same.
I hope I don't need to do it a third time !

Sorry, Klaus, as you can imagine I did a quick search, I have not read everything.
I will never mention your name again, since you're so touchy, don't worry.


----------------------------------------------------------------------


My question would not criticize the Designer, as you can see in post #1.

I probably have some problem with these objects and, apparently, someone starts to respond in the same tone of other people; indeed, almost, because there are people who almost answers (not to me, but not rarely): "You are so stupid to not understand, so I do not answer you anymore."

So, please, if "you" (I don't need to specificate, I know) don't like my questions, simply do not answer.
 
Last edited:
Upvote 0

ilan

Expert
Licensed User
Longtime User
I ask (MYSELF) why do not show images in the ImageViews directly in the Designer (most likely this is too complicated, complicated as doing the same thing in apps :D).

What you wrote here is wrong and also disrespectful to everyone who try to help you.

The designer scales everything live. No need to install the app. The views are resized and located exactly how you wrote the code in designer script when you press the play button, so it would not make any different if an image was shown or not.

I believe the reason why erel dont show images in the designer is because of better performance (less memory...)

There are simpler ways to get a stretched result and like this no need to take care about different screen sizes but with the designer you can do much more.

Please dont turn this thread to something ugly. We just (want) try to help.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
and also disrespectful to everyone who try to help you.
Why it is disrespectful? Because I ask to myself? Erel has written that he will not answer, so I must ask to myself! Who else can tell why the images are not displayed in the Designer?

Please dont turn this thread to something ugly
Please, read from my first post an tell me when and where I turned this thread...
I have not done this. I've got a slightly rude response from Erel (I know I asked about Designer many times, but never without respect!) and now your answer not exactly nice, backed by a trio of people through their "Like"s.

No problems, I finish here.

I'm too bad, my questions are bad, disrespectful...

I am what I am and I like me very much!
 
Last edited:
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Longtime User
backed by a trio of people through their "Like"s.
(well, I liked the intention, Luca (precisely "There are simpler ways to get a stretched result and like this no need to take care about different screen sizes but with the designer you can do much more."). Nothing about You)
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
I believe the reason why erel dont show images in the designer is because of better performance (less memory...)
upload_2016-2-15_14-1-15.png


Mine is not a super PC (i5, 8Gb RAM), above a heavy VS 2010!

I suppose there are technical difficulties (due to current design, probably), not performance reasons (I don't think it is a designing choise).
 
Last edited:
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
I do not use VS for a long time (and someone knows my poor memory).

Attached you will find a windows .exe (maybe it is not enough for your PC).
No viruses, nor malware, nor other bad stuff.

3 lines of code, of which only one written by me (the association between the PictureBox (ImageView) and the PropertyGrid).

Surely implement this in the B4X Designer can be not so simple, I am sure of this, but maybe one day...!

Choose an image:
upload_2016-2-15_16-23-47.png



Choose a size mode:
upload_2016-2-15_16-24-12.png
 

Attachments

  • DesignerSample.zip
    9.3 KB · Views: 227
Upvote 0
Top