Swiping through full resolution pictures
The last page we have to implement in gallery-mobile
is the full resolution picture page. In Chapter 4, Conquering the Desktop UI, we navigated through the pictures using previous/next buttons. In this chapter, we target the mobile platform. Therefore, the navigation should be done using a touch-based gesture: a fling.
Here is the implementation of this new PicturePage.qml
file:
import QtQuick 2.0 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.0 import "." PageTheme { property string pictureName property int pictureIndex toolbarTitle: pictureName ListView { id: pictureListView model: pictureModel anchors.fill: parent spacing: 5 orientation: Qt.Horizontal snapMode: ListView.SnapOneItem currentIndex: pictureIndex Component.onCompleted: { positionViewAtIndex(currentIndex, ListView.SnapPosition) ...