- pttptpptHello PatrickSo I'm developing an app using Momentics for the first time. And I'm stuck. Here's what I need help with:
- Combining both toggle buttons and text on the same line. So essentially, there'll be a toggle button with a description of what it does (similar to the bb10 settings)
- Making toggle buttons (and sliders) perform actions (ex. turn on the flashlight)
- Add a display for what song is playing and have music controls (I know it's possible)
- Make a toggle button change from dark to light theme (like in the cb10 app)
Can anyone give some coded examples? Thanks08-31-14 08:21 AMLike 0 - So I'm developing an app using Momentics for the first time. And I'm stuck. Here's what I need help with:
- Combining both toggle buttons and text on the same line. So essentially, there'll be a toggle button with a description of what it does (similar to the bb10 settings)
- Making toggle buttons (and sliders) perform actions (ex. turn on the flashlight)
- Add a display for what song is playing and have music controls (I know it's possible)
- Make a toggle button change from dark to light theme (like in the cb10 app)
Can anyone give some coded examples? Thanks
Code:... Container { layout: StackLayout { orientation: LayoutOrientation.LeftToRight } horizontalAlignment: HorizontalAlignment.Center Label { text: qsTr("Deltas") + Retranslate.onLanguageChanged verticalAlignment: VerticalAlignment.Center } ToggleButton { id: deltasetting onCheckedChanged: { ... } } Button { id: repobutton text: qsTr("Known Software") + Retranslate.onLanguageChanged onClicked: { ... } } } ...
As for #2, that's what goes inside the onCheckedChanged action of the ToggleButton.
Posted via CB1008-31-14 08:32 AMLike 0 - pttptpptHello Patrick#1: Important part bolded:
Code:... Container { layout: StackLayout { orientation: LayoutOrientation.LeftToRight } horizontalAlignment: HorizontalAlignment.Center Label { text: qsTr("Deltas") + Retranslate.onLanguageChanged verticalAlignment: VerticalAlignment.Center } ToggleButton { id: deltasetting onCheckedChanged: { ... } } Button { id: repobutton text: qsTr("Known Software") + Retranslate.onLanguageChanged onClicked: { ... } } } ...
As for #2, that's what goes inside the onCheckedChanged action of the ToggleButton.
Posted via CB10thurask likes this.08-31-14 08:35 AMLike 1 -
- pttptpptHello PatrickOkay I have no idea what you did for #1. Here's my code:
TabbedPane {
showTabsOnActionBar: true
Tab { //First tab
// Localized text with the dynamic translation and locale updates support
title: qsTr("Tab 1") + Retranslate.onLocaleOrLanguageChanged
Page {
Container {
background: Color.create("#daec932a")
opacity: 1.0
visible: true
TextArea {
text: "Turn this on for Flashlight"
}
ToggleButton {
horizontalAlignment: HorizontalAlignment.Right
}
}
}
} //End of first tab
Tab { //Second tab
title: qsTr("Tab 2") + Retranslate.onLocaleOrLanguageChanged
Page {
Container {
Label {
text: qsTr("Second tab") + Retranslate.onLocaleOrLanguageChanged
}
}
}
} //End of second tab
}08-31-14 08:40 AMLike 0 - Add layout orientation properties. Like so:
Okay I have no idea what you did for #1. Here's my code:
TabbedPane {
showTabsOnActionBar: true
Tab { //First tab
// Localized text with the dynamic translation and locale updates support
title: qsTr("Tab 1") + Retranslate.onLocaleOrLanguageChanged
Page {
Container {
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
background: Color.create("#daec932a")
opacity: 1.0
visible: true
TextArea {
text: "Turn this on for Flashlight"
}
ToggleButton {
horizontalAlignment: HorizontalAlignment.Right
}
}
}
} //End of first tab
Tab { //Second tab
title: qsTr("Tab 2") + Retranslate.onLocaleOrLanguageChanged
Page {
Container {
Label {
text: qsTr("Second tab") + Retranslate.onLocaleOrLanguageChanged
}
}
}
} //End of second tab
}
Posted via CB1008-31-14 08:43 AMLike 0 -
And as for the flashlight, look through this sample: https://github.com/blackberry/Cascad...ter/SensorDemo
Posted via CB1008-31-14 08:55 AMLike 0 - pttptpptHello PatrickDon't think toggle buttons can be colorized: Toggle buttons - BlackBerry Native
And as for the flashlight, look through this sample: https://github.com/blackberry/Cascad...ter/SensorDemo
Posted via CB1008-31-14 09:00 AMLike 0 - Hi Thurask!
Thanks for all your efforts trying to help us out.
I've been following what you recently said to Patrick and it works fine but when you have 2 buttons in the same line, the buttons are not aligned in the center the right way.
I would also like to know how can I add a text line alligned in the center of the tab neither on the top side nor the bottom side only in the middle.
And how can we get the settings tab when sliding down from the top bezel ?08-31-14 12:25 PMLike 0 - Hi Thurask!
Thanks for all your efforts trying to help us out.
I've been following what you recently said to Patrick and it works fine but when you have 2 buttons in the same line, the buttons are not aligned in the center the right way.
I would also like to know how can I add a text line alligned in the center of the tab neither on the top side nor the bottom side only in the middle.
And how can we get the settings tab when sliding down from the top bezel ?
Alignment is handled with HorizontalAlignment and VerticalAlignment: http://developer.blackberry.com/nati...alignment.html
http://developer.blackberry.com/nati...alignment.html
Posted via CB10UnlimitedEra likes this.08-31-14 12:29 PMLike 1 -
- Hi Thurask!
Thanks for all your efforts trying to help us out.
I've been following what you recently said to Patrick and it works fine but when you have 2 buttons in the same line, the buttons are not aligned in the center the right way.
I would also like to know how can I add a text line alligned in the center of the tab neither on the top side nor the bottom side only in the middle.
And how can we get the settings tab when sliding down from the top bezel ?
Posted via CB1009-03-14 05:24 AMLike 0
- Forum
- BlackBerry Developers
- Developers Lounge
Help needed with developing!!!
Similar Threads
-
Issue with my wired Headset on BB Z30
By muindor in forum Ask a QuestionReplies: 3Last Post: 03-14-15, 07:36 AM -
Can I use BIS plan with Z10?
By Rana Saadat Ali Khan in forum Ask a QuestionReplies: 22Last Post: 09-07-14, 08:35 AM -
Issue with contact card from within BBM
By LyoobaBerry in forum Ask a QuestionReplies: 2Last Post: 08-31-14, 11:29 PM -
Blackberry q10 expired password issue-help!!!!!
By CrackBerry Question in forum Ask a QuestionReplies: 1Last Post: 08-30-14, 06:43 PM -
What will be new with Amazon Appstore in 10.3?
By hisham1996 in forum BlackBerry 10 OSReplies: 3Last Post: 08-30-14, 05:54 PM
LINK TO POST COPIED TO CLIPBOARD