UpdateProfile.qml Example File
bbmprofile/assets/UpdateProfile.qml
import bb.cascades 1.0
import bb.cascades.pickers 1.0
Page {
onCreationCompleted: {
personalMessage.text = _profile.personalMessage
statusMessage.text = _profile.statusMessage
isBusy.checked = _profile.busy
}
Container {
layout: DockLayout {}
ImageView {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
imageSource: "asset:///images/background_blurred.png"
}
Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
topPadding: 20
leftPadding: 20
rightPadding: 20
Label {
horizontalAlignment: HorizontalAlignment.Center
text: qsTr("Update Profile")
textStyle {
base: SystemDefaults.TextStyles.BigText
color: Color.White
fontWeight: FontWeight.Bold
}
}
Divider {
}
TextField {
id: personalMessage
hintText: qsTr("Type personal message here")
}
Button {
horizontalAlignment: HorizontalAlignment.Right
text: qsTr("Save")
onClicked: {
_profile.editor.savePersonalMessage(personalMessage.text)
navigationPane.pop()
}
}
TextField {
id: statusMessage
topMargin: 40
hintText: qsTr("Type status message here")
}
Container {
horizontalAlignment: HorizontalAlignment.Fill
layout: DockLayout {
}
Container {
horizontalAlignment: HorizontalAlignment.Left
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
Label {
text: qsTr("Mark as busy")
textStyle {
color: Color.White
}
}
CheckBox {
id: isBusy
}
}
Button {
horizontalAlignment: HorizontalAlignment.Right
text: qsTr("Save")
onClicked: {
_profile.editor.saveStatus(isBusy.checked, statusMessage.text)
navigationPane.pop()
}
}
}
Button {
topMargin: 20
horizontalAlignment: HorizontalAlignment.Center
text: qsTr("Set Avatar")
onClicked: {
filePicker.open()
}
}
}
}
attachedObjects: [
FilePicker {
id: filePicker
title: qsTr("Select Image")
directories: ["/accounts/1000/shared/"]
onFileSelected: {
_profile.editor.saveDisplayPicture(selectedFiles[0])
navigationPane.pop()
}
}
]
}