VisibilityRefreshHandler

A helper item for handling data reload actions as soon as the item becomes visible. More...

Import Statement: import VPlayApps 1.0
Inherits:

Item

Properties

Signals

Detailed Description

This item is a convenience item that can be added as the header or footer of an AppListView.

As soon as the item gets visible within the AppListView the refresh signal is emitted. It's then possible to take appropriate actions in your app logic.

As an example you can load the next 20 tweets in your Twitter app as soon as a user scrolls to the bottom of the feed, as shown in the following sample:

 import VPlayApps 1.0

 AppListView {
   footer: VisibilityRefreshHandler {
     onRefresh: twitterCient.loadNextTweets()
   }
 }

The default height is 48dp and the default width is the parent width. If the VisibilityRefreshHandler is invisible, its size is 0.

Note: You need to write the application logic yourself, when the VisibilityRefreshHandler shall be visible or not. After all elements are displayed in a list, you can set visible to false. In some apps, you will have an infinite amount of rows so you can leave the default visibility setting to true in such cases.

Customize the Delegate

An AppActivityIndicator is displayed by default during the refresh.

To set a custom Item instead of the default delegate, see this example:

 import QtQuick 2.0
 import VPlayApps 1.0

 AppListView {
   footer: VisibilityRefreshHandler {

     // disable the default view
     defaultAppActivityIndicatorVisible: false

     Rectangle {
       anchors.fill: parent
       color: "grey"
       Text {
         text: "Refreshing ..."
         anchors.centerIn: parent
       }
     }

     onRefresh: twitterClient.loadNextTweets()

   }
 }

Property Documentation

defaultAppActivityIndicatorVisible : alias

Holds whether the default AppActivityIndicator shall be visible. By default it is true.

Set this property to false to Customize the Delegate.

This QML property was introduced in V-Play 2.6.1.


listView : ListView

The AppListView this item belongs to. This property is set automatically to the parent as soon as the item gets set as the header or footer of an AppListView.


Signal Documentation

refresh()

Emitted as soon as the item becomes visible in the contained AppListView. You can take appropriate actions to handle the data reload or load more items for your list.


Videos

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support