New feature: anchors checker

Discussion in 'Chit Chat' started by Erel, Aug 20, 2019.

  1. Erel

    Erel Administrator Staff Member Licensed User

    Can you spot the bugs?


    And now?


    Why is this a bug???


    Last edited: Aug 20, 2019
  2. LucaMs

    LucaMs Expert Licensed User

    I had some problems because I compared the anchors in the two images, I hadn't noticed the color (also because unfortunately I have color-blindness problems but above all because I was focused on the anchor points).

    Really very useful. Perhaps, rather (or in addition) than changing color to "suspicious" views, a button to apply the suggestions provided by the checking would be useful.

    [It should be noted how immediate is the visual check using b4j (resizing the form by dragging the mouse), even if it is also possible with b4a, by changing the target in the Abstract Designer]
    Sagenut and Johan Hormaza like this.
  3. Erel

    Erel Administrator Staff Member Licensed User

    It doesn't suggest a fix, it only shows you where the anchors are wrong. It is not really possible to make a good suggestion as there are many cases where it it doesn't know what the developer actually wants. It only knows that the anchors are wrong.
  4. LucaMs

    LucaMs Expert Licensed User

    If it knows where they are wrong, it also knows how they should be set, or not?

    Maybe I should look at the example better ;)
  5. MarkusR

    MarkusR Well-Known Member Licensed User

    i find it useful to see all anchors, the default left,top are not visible.
    everything that can move at resize i like to see an arrow instead of a dot in designer.
    agraham likes this.
  6. Filippo

    Filippo Expert Licensed User

    It would be better if you were to see it in the designer when zooming in or out of the layout.
    But that's a small step forward. ;)
    José J. Aguilar likes this.
  7. emexes

    emexes Well-Known Member Licensed User

    Zooming is not same as Resizing.

    But a resize-preview feature where eg you could grab the bottom-right corner of the shaded variant layout area and drag it about to see the abstract views resizing... yeah, that could be good.

    The key thing is that the corner would need to spring back to its original pre-drag place when you let go of the mouse button, ie exit resize preview mode; if it were to stay put, like the zoom does when you change it... that would cause a lot of confusion.
    JohnC likes this.
  8. Erel

    Erel Administrator Staff Member Licensed User

    Not really.
  9. Filippo

    Filippo Expert Licensed User

    I know, but that's the Google translation. :)
  10. emexes

    emexes Well-Known Member Licensed User

    Fair enough, then. Especially given your tag line: my English is getting better now. Your English is heaps better than my German ;-) often does a better job than of retaining the meaning and nuance of the original. I'd be interested to see if it did better translating "Größe des Layouts ändern" or whatever the original was, and didn't change it to close-but-no-cigar "zooming".
    Last edited: Aug 21, 2019
    Peter Simpson and Filippo like this.
  11. JohnC

    JohnC Well-Known Member Licensed User

    I guess I'm missing something....I understand that the "Check Anchor" button will highlight bad anchors in red.

    But what tool is Erel using to resize the activity in real-time and show what the controls will look like?
  12. Erel

    Erel Administrator Staff Member Licensed User


    This is the actual layout at runtime.
  13. JohnC

    JohnC Well-Known Member Licensed User

    Ah, so the java app is a desktop app and you are simply resizing the window.

    It would be a cool if there was a way like this to test the designer scripts and activity code positioning in B4A in real-time.
    AnandGupta and emexes like this.
  14. AnandGupta

    AnandGupta Active Member Licensed User

    Yes, we need it in B4A, if possible, somehow.


  15. techknight

    techknight Well-Known Member Licensed User

    I am sure it will come.
  16. Erel

    Erel Administrator Staff Member Licensed User

    The abstract designer allows you to see how the views positions and sizes will change based on various screen sizes:

  17. emexes

    emexes Well-Known Member Licensed User

    That does indeed do a lot of what was wished for, if Designer is in script mode.* I still like the idea of (also) being able to change the prospective width and height by dragging the bottom right corner about, as an alternative to choosing from the pulldown menu. Seeing the views resize dynamically will give a better understanding of how the scaling works, and highlight which views are not scaling as expected/intended/planned(/hoped).

    I assume that script mode is running both the general and variant scripts, in the same manner that LoadLayout would run them. (no time to check right now)

    * yet again I eat your dust :-/ I was wondering why using that menu to preview scaling hadn't occurred to me before - I think it is because when I started, I didn't know to turn script mode on, thus the menu didn't provide a preview that matched the running app, and so I went down my own custom autoscale path.
    Last edited: Aug 27, 2019
  18. Erel

    Erel Administrator Staff Member Licensed User

    Actually no. You don't need to enter script mode to see how the anchors affect the layout.
  19. emexes

    emexes Well-Known Member Licensed User

    Agreed re: anchors, but needed re: preview scaling.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice