Component Showcase Demo App
import QtQuick 2.0
import Felgo 3.0
import "../common"
FlickablePage {
id: examplePage
property bool activated: true
rightBarItem: NavigationBarRow {
ActivityIndicatorBarItem {
id: busyBarItem
animating: examplePage.activated
showItem: showItemAlways
}
IconButtonBarItem {
icon: examplePage.activated ? IconType.toggleon : IconType.toggleoff
onClicked: examplePage.activated = !examplePage.activated
title: "Toggle"
}
}
flickable.contentHeight: scrollCol.height + dp(8)
Column {
id: scrollCol
width: parent.width
SectionHeader { icon: IconType.thumbsup; text: "Rich User Interface, Less Code" }
SectionDescription { text: "This example only requires about 120 lines code." }
Repeater {
model: [
{ text: "Default UI Elements",
detailText: "No custom components are used here.",
icon: IconType.tablet },
{ text: "Swipe a list row for more options",
detailText: "This SwipeOptionsContainer has a left option and a right option.",
icon: IconType.list },
{ text: "What else is shown?",
detailText: "SimpleRow, SwipeButton, ActivityIndicator, AppSwitch, AppButton, AppText",
icon: IconType.question }
]
delegate: SwipeOptionsContainer {
id: container
height: row.height
enabled: !(isSnapped && isRight)
SimpleRow {
id: row
style.showDisclosure: false
}
leftOption: SwipeButton {
text: "Option"
icon: IconType.gear
height: row.height
onClicked: {
row.item.text = "Option clicked"
row.itemChanged()
container.hideOptions()
}
}
rightOption: AppActivityIndicator {
width: row.height
anchors.centerIn: parent
}
onRightOptionShown: hideTimer.start()
property Timer hideTimer: Timer {
running: false
interval: 1000
onTriggered: container.hideOptions()
}
}
}
SectionSpacer { }
SectionHeader { text: "Signals and Property Binding" }
SectionDescription { text: "Press the switch below or in the navigation bar. Both items are linked together and also affect both of the activity indicators.\n
This is achieved by binding the checked and activated states of the controls in a single code line." }
SectionContent { contentItem: Row {
anchors.horizontalCenter: parent.horizontalCenter
AppSwitch {
id: sw
anchors.verticalCenter: parent.verticalCenter
checked: examplePage.activated
updateChecked: false
onToggled: examplePage.activated = !examplePage.activated
}
AppActivityIndicator {
anchors.verticalCenter: parent.verticalCenter
animating: examplePage.activated
}
}