Android Question Designer - Autoscale and screen density

Discussion in 'Android Questions' started by LucaMs, Jul 4, 2015.

  1. LucaMs

    LucaMs Expert Licensed User

    Takes into account Autoscale the density of the device screen?

    upload_2015-7-4_14-12-29.png

    a resized screenshot on the left, designer on the right.

    The proportions are not respected: depends it on the density difference?
     
  2. MaFu

    MaFu Well-Known Member Licensed User

    If you use the designer right it should independent from density.
    Did you use anchors, designer scripts, dip, %x/%y? It's hard to say without knowing your layout.
     
  3. LucaMs

    LucaMs Expert Licensed User

    After that test, I changed the layout, so it is not useful if I post it now.

    I used nothing, just a general script to center the panel in the layout.

    Anchors have default values.
     
  4. LucaMs

    LucaMs Expert Licensed User

    upload_2015-7-4_15-16-19.png

    Attached the layout

    ehm... I forgot to change the text of the label after duplication of the view, but the screenshot is relative to that layout
     

    Attached Files:

    Last edited: Jul 4, 2015
  5. MaFu

    MaFu Well-Known Member Licensed User

    The size and position values in the view properties on designer would be interpreted as dip. Therefore the size of your views have always (almost) the same (physical) size, doesn't matter which size or density your device have. A button with a size value of 50dip for example is shown with a size of 9 millimeters (more or less). Why should your dialog been bigger on a tablet as on a 4.5 inch phone?
     
  6. LucaMs

    LucaMs Expert Licensed User

    It is exactly what I would not; it must not be bigger, it must be proportionate.

    Here the difference is even more striking:

    upload_2015-7-4_16-10-59.png

    In the Designer, the panel is almost as big as the layout, in the screenshot the panel is... as you can see!
     

    Attached Files:

  7. LucaMs

    LucaMs Expert Licensed User

    This is the problem. If Autoscale took into account the density of the screen that displays the layout, the views would be proportionate.
     
  8. MaFu

    MaFu Well-Known Member Licensed User

    Sorry, i can't see any problem. If this is not what you want, how should the panel look in your case?
    If your panel should have a specific size, use dip and forget the layout size in the designer (sorry for the bug in my last post, 50dip isn't 9 millimeter, it's 7,9 millimeter).
    If your panel should suit to the display, use %x/%y and/or anchors.
    Or you can mix, you have all possibilities.
     
  9. LucaMs

    LucaMs Expert Licensed User

    I would like some sort of WYSIWYG; therefore, in this case, I would that the distances of the sides of the panel from the sides of the layout were proportionate. Can you get this with Autoscale and Anchors (and with more than one panel)? No. You can with percentages; this is the reason of this my "Wish".
     
  10. MaFu

    MaFu Well-Known Member Licensed User

    The designer view is not wysiwyg. But this is no problem. Connect your phone or tablet and you have a wysiwyg view while designing. Or use Genymotion.
     
Loading...