[regression] Extra flickable margin added when using PullToRefresh

Bug #1578619 reported by Alberto Mardegan
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
High
Zoltan Balogh
ubuntu-ui-toolkit (Ubuntu)
Fix Released
High
Tim Peeters

Bug Description

The attached test works fine under OTA-10, but fails in rc-proposed. This is most likely caused by https://code.launchpad.net/~tpeeters/ubuntu-ui-toolkit/invisible-header-topmargin/+merge/290659 which also causes bug 1572525 and I asked to be reverted.

To reproduce, run the attached test case with qmlscene:

1) Wait for the window to be populated (network connectivity is needed)
2) Swipe down, to trigger the pull to refresh action
3) View automatically jumps to the second page
4) navigate back to the first page
5) watch the flickable topMargin: the pulltorefresh item is now visible

If time you repeat steps 2-4, the topMargin increases.

Related branches

Revision history for this message
Alberto Mardegan (mardy) wrote :
Revision history for this message
Alberto Mardegan (mardy) wrote :
Cris Dywan (kalikiana)
Changed in ubuntu-ui-toolkit (Ubuntu):
importance: Undecided → Critical
assignee: nobody → Tim Peeters (tpeeters)
Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → In Progress
Revision history for this message
Tim Peeters (tpeeters) wrote :

The bug was not introduced by the MR linked in the bug description. I reproduced the bug with this code, and pulling down the listview and releasing it with a vertical velocity:

import QtQuick 2.2
import QtQuick.XmlListModel 2.0
import Ubuntu.Components 1.3
import Ubuntu.Components.ListItems 1.3
MainView {
    width: units.gu(40)
    height: units.gu(71)
    Page {
        id: page0
        title: "Reuters"
        ListView {
            id: view
            anchors.fill: parent
            model: 15
            delegate: Standard {
                width: ListView.view.width
                height: units.gu(5)
                text: index//title
            }
            onVerticalVelocityChanged: print("vv = "+verticalVelocity)
            PullToRefresh {
                id: pullToRefresh
                onRefreshingChanged: print("refreshing = "+refreshing)
                onRefresh: {
                    refreshing = true;
                    refreshing = false;
                    // refreshTimer.start();
                }
            }
        }
    }

// Timer {
// id: refreshTimer
// onTriggered: pullToRefresh.refreshing = false
// }
}

and with UITK r1930 (before the mentioned MR) and r1918.

I think the bug was always there, the topMargin gets messed up by the PullToRefresh. However, pre-r1931, the topMargin was (incorrectly) reset to 0 when a new Page was pushed on the PageStack (which happens in onRefresh for the example linked to th ebug). Now that this no longer happens, the bug becomes visible when the Page is popped from the stack.

Revision history for this message
Tim Peeters (tpeeters) wrote :

I reproduced the bug with this code, which has no header:

import QtQuick 2.2
import QtQuick.XmlListModel 2.0
import Ubuntu.Components 1.3
import Ubuntu.Components.ListItems 1.3
Item {
    width: units.gu(40)
    height: units.gu(71)
        id: page0
        ListView {
            id: view
            anchors.fill: parent
            model: 15
            delegate: Standard {
                width: ListView.view.width
                height: units.gu(5)
                text: index
            }
            onVerticalVelocityChanged: print("vv = "+verticalVelocity)
            PullToRefresh {
                id: pullToRefresh
                onRefreshingChanged: print("refreshing = "+refreshing)
                onRefresh: {
                    refreshing = true;
                    refreshing = false;
                }
            }
        }
    }

Revision history for this message
Tim Peeters (tpeeters) wrote :

To summarize, there were 2 bugs:

1. PullToRefresh messes up the topMargin
2. On pop(), the topMargin of page0 was set to header.height (instead of keeping the current topMargin) (Fixed)

Bug 2 was hiding bug 1 in the example from the report, and it was exposed when bug 2 got fixed. We still need to fix bug 1, but a workaround for now is to reset the incorrect topMargin when popping a page.

Note that the example in my previous comment shows bug 1 independently from bug 2.

Revision history for this message
Tim Peeters (tpeeters) wrote :

If the refreshing takes some time, as in http://paste.ubuntu.com/16318581/ then I cannot reproduce the bug on my laptop. In the linked example, the interval is 200 ms. If I reduce that to <100ms, then I can reproduce the bug.

Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit (Ubuntu):
importance: Critical → High
Changed in canonical-devices-system-image:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Zoltan Balogh (bzoltan)
milestone: none → 12
Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit (Ubuntu):
status: In Progress → Fix Committed
Changed in canonical-devices-system-image:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-ui-toolkit - 1.3.1984+16.10.20160527.2

---------------
ubuntu-ui-toolkit (1.3.1984+16.10.20160527.2) yakkety; urgency=medium

  [ Christian Dywan ]
  * Slimmer frame for TextFields: 0.5dp. Fixes LP: #1578190.

  [ Albert Astals Cid ]
  * Add override
    The override specifier (since C++11) specifies that a virtual function
    overrides another virtual function. In a member function declaration or
    definition, override ensures that the function is virtual and is overriding
    a virtual function from the base class.

  [ Tim Peeters ]
  * Fix reference error in PullToRefreshStyle. Fixes LP: #1582843
  * Mark Tab, Tabs, TabBar, PageHeadConfiguration, PageHeadSections,
    PageHeadState, ToolbarButton, ToolbarItems as deprecated in the
    documentation. Fixes LP: #1566735, LP: #1566741.

  [ CI Train Bot ]
  * Resync trunk.

 -- Zoltan Balogh <email address hidden> Fri, 27 May 2016 07:08:44 +0000

Changed in ubuntu-ui-toolkit (Ubuntu):
status: Fix Committed → Fix Released
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
Revision history for this message
Alberto Mardegan (mardy) wrote :

I just tried the test application I attached to the bug, and I can still reproduce this.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.