Important: Please read the Qt Code of Conduct -

Animate injection to column so that injected item pushes the rest down (a'la iOS phone number types in Contacts app)

  • Hi all

    I am trying to clone iOS7 Contacts app (mostly for studying how well QML is fit for quick prototyping iOS apps) -

    Right now I am trying to replicate the animation when you add (or remove) a new phone line as you can see on this YouTube video from about 1:28

    In the current design, list of phones is a Column and "add phone" button is a separate element under the Column.
    So when element is being added to Column, I want it to appear from behind of one on top and push the column down step by step and.. I can't figure how to do it.

    Default add transition functions as:

    1. Column is expanded instantly, no delay, place for a new item is allocated instantly
    2. Element flies from the very top to it's place (how exactly it flies you can control by animating x.y properties)

    I want instead to:

    1. Fly from the element on top of where new one is to be added
      1.1. Fly from behind of the one on top
    2. Column height is to be expanded bit by bit together with the element being added

    Can't quite figure how to do it. Please, help

    I believe I am able to implement it fully manually: forget Column completely and just manually control a bunch of elements being added/removed, but that's quite labor intensive and probably error-prone. There should a way to go with positioners, shouldn't it?

  • BTW, If you want to have a look at the code, you can find it

    Current addition animation experiments are in branch phone-editor and you don't have to have anything iOS to play with it. It should work on Desktop just fine (just with a couple of wrong window scrollbars).

    In fact it is one of the project goals, to validate the possibility for super-fast iOS prototyping using QML on desktop.

  • Moderators


    Is it possible for you to use a ListView instead of Column ? Since it has "displaced": property which moves the item's below when new item is inserted in between.
    Check "viewtransition": for more info.

  • Column is not the requirement certainly. I used it just because I didn't need extra scrolling area services from ListView. Will try ListView, thanks!

  • Moderators

    bq. I used it just because I didn’t need extra scrolling area services from ListView

    Well you can disable scroll using "interactive": property.

Log in to reply