main.qml Example File
orientation/assets/main.qml
import bb.cascades 1.0
import Utils 1.0
Page {
Container {
layout: DockLayout {}
background: Color.Black
onCreationCompleted: _sensor.orientationChanged.connect(animation.play)
Label {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
text: _sensor.orientation == OrientationSensor.TopUp ? qsTr ("Top Up") :
_sensor.orientation == OrientationSensor.TopDown ? qsTr ("Top Down") :
_sensor.orientation == OrientationSensor.LeftUp ? qsTr ("Left Up") :
_sensor.orientation == OrientationSensor.RightUp ? qsTr ("Right Up") :
_sensor.orientation == OrientationSensor.FaceUp ? qsTr ("Face Up") :
_sensor.orientation == OrientationSensor.FaceDown ? qsTr ("Face Down") : ""
textStyle {
base: SystemDefaults.TextStyles.BigText
color: Color.White
fontWeight: FontWeight.Bold
}
scaleX: 0
scaleY: 0
animations: ScaleTransition {
id: animation
fromX: 0
fromY: 0
toX: 1.5
toY: 1.5
}
}
}
}