CustomTimelineView.qml Example File
mavenartifacts/assets/CustomTimelineView.qml
import bb.cascades 1.0
Page {
Container {
layout: DockLayout {}
ListView {
dataModel: _artifactline.model
function date(timestamp) {
return _artifactline.dateFromTimestamp(timestamp)
}
listItemComponents: [
ListItemComponent {
type: "item"
Container {
id: itemRoot
preferredWidth: 768
preferredHeight: 200
layout: DockLayout {}
ImageView {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
imageSource: itemRoot.ListItem.selected ? "asset:///images/item_background_selected.png" :
"asset:///images/item_background.png"
}
Container {
horizontalAlignment: HorizontalAlignment.Left
leftPadding: 20
rightPadding: 20
Label {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
text: ListItemData.id + "[" + ListItemData.latestVersion + "]"
textStyle {
base: SystemDefaults.TextStyles.BodyText
color: Color.Gray
}
}
Label {
preferredHeight: 200
text: itemRoot.ListItem.view.date(ListItemData.timestamp)
textStyle {
base: SystemDefaults.TextStyles.SmallText
color: Color.Gray
}
multiline: true
}
}
}
}
]
onTriggered: {
clearSelection()
select(indexPath)
}
}
}
}