main.qml Example File
headlesserviceui/assets/main.qml
import bb.cascades 1.2
Page {
Container {
layout: DockLayout {
}
id: root
Container {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Top
Label {
horizontalAlignment: HorizontalAlignment.Center
text: "Headless UI"
textStyle.fontSize: FontSize.Large
textStyle.fontWeight: FontWeight.Bold
}
ColoredRectangle {
topMargin: 100
id: service
title: _app.isServiceRunning() ? "Headless Process Running" : "N/A"
color: _app.isServiceRunning() ? Color.Green : Color.Red
}
}
Container {
horizontalAlignment: HorizontalAlignment.Left
verticalAlignment: VerticalAlignment.Center
Container {
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
Label {
text: "FlashCount: "
}
Label {
id: flashCount
text: _app.flashCount()
textStyle.fontWeight: FontWeight.Bold
}
}
Container {
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
Label {
text: "RemainingCount: "
}
Label {
id: remainingFlashCount
textStyle.fontWeight: FontWeight.Bold
text: _app.remainingFlashCount
}
}
}
Container {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Bottom
Button {
text: "Restart"
onClicked: {
_app.resetLED();
}
}
}
}
}