Looking For Paged Horizontal Scroller? (Like Calculator App)
- Another cascades question from me. Hopefully an easy one this time:
Which control can I use to achieve a "paged" horizontal scroller, like the one in the calculator app, or on the BB10 homescreen?
Posted via CB10MasterOfBinary likes this.08-12-13 10:16 PMLike 1 -
- Mikeo007:
Have you tried anything thus far? Or just looking for guidance?
I'd suggest looking at BlackBerry's got hub samples; https://github.com/blackberry/Cascad...descookbookqml (just to start you off... there is a ton of samples there)
Beyond that, accomplishing the paginated/tabbed view like in the native calculator, you may want to look at TabbedPane / NavigationPane / Page.
--
young_adampkcable likes this.08-13-13 12:16 AMLike 1 - Thanks for the response Adam. I have looked through the github samples, but haven't found something that replicates what I'm looking for yet. I may not have been totally clear on what I meant from the calculator app though. I'm talking specifically about the section that has the numbers, and when swiped to the side it reveals the FN, M+, MR, etc buttons (circled in the attached screenshot). I will continue to look for examples, but any guidance is appreciated.
08-13-13 08:23 AMLike 0 - I have been wondering how to do this for a while as well.. closest I could get is using a Listview with horizontal scroll and have it snap to each view.. doesn't function nearly as nicely as the calculator app does it though. Haven't tried to have the static buttons on the right either. But i think that could be done. As for doing exactly what the calculator app does, I personally believe that they are using something that we don't have access to. I'd be very curious though.
Here's where I use it in my app:
Attachment 192107
Attachment 192108
Attachment 192109
And
Attachment 192110
Attachment 192111
Attachment 19211208-13-13 09:59 AMLike 0 - source code of the app: http://cdn.fs.sl.blackberry.com/fs/q...-v7+signed.bar
Calculator.qml
Code:/* Copyright (c) 12012 Research In Motion Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import bb.cascades 1.0 import Custom 1.0 Page { id: rootPage property variant backgroundColor: Color.create("#121212") property string displayTechnology: settings.isOLED ? "oled/" : "" Container { id: rootContainer property variant currentView property int viewToBeShownIndex layout: StackLayout { orientation: LayoutOrientation.TopToBottom } horizontalAlignment: HorizontalAlignment.Fill verticalAlignment: VerticalAlignment.Fill onCreationCompleted: { switch (settings.activePane) { case CalculatorFramework.CALCULATOR_CONVERTOR: { showConverter() segmentedControl.selectedIndex = 2 } break case CalculatorFramework.CALCULATOR_TIP: { showTipCalculator() segmentedControl.selectedIndex = 1 } break default: { showCalculator() segmentedControl.selectedIndex = 0 } } segmentedControl.selectedOptionChanged.connect(segmentedControl.handleSelectionChanged) fadeViewInAnim.play() } function handleContextMenuShownChanged(isShown) { if (isShown) segmentedControlShadow.opacity = 0.5 else segmentedControlShadow.opacity = 0.0 } Container { layout: DockLayout { } horizontalAlignment: HorizontalAlignment.Fill preferredHeight: 111 topPadding: 5 SegmentedControl { id: segmentedControl verticalAlignment: VerticalAlignment.Center Option { id: option1 objectName: "nav_item_basic" text: framework.changed + qsTr("Calculator") } Option { id: option3 objectName: "nav_item_tip" text: framework.changed + qsTr("Tip") } Option { id: option2 objectName: "nav_item_unit" text: framework.changed + qsTr("Converter") } function handleSelectionChanged() { console.log("Segmented control selection changed to: " + selectedIndex) rootContainer.requestFocus() rootContainer.viewToBeShownIndex = selectedIndex loadTimer.start() } } Container { id: segmentedControlShadow overlapTouchPolicy: OverlapTouchPolicy.Allow background: Color.Black opacity: 0.0 horizontalAlignment: HorizontalAlignment.Fill verticalAlignment: VerticalAlignment.Fill } } ControlDelegate { id: viewDelegate delegateActive: true horizontalAlignment: HorizontalAlignment.Fill verticalAlignment: VerticalAlignment.Fill layoutProperties: StackLayoutProperties { spaceQuota: 1 } overlapTouchPolicy: OverlapTouchPolicy.Allow } function switchView() { switch (rootContainer.viewToBeShownIndex) { case 0: rootContainer.showCalculator() break case 1: rootContainer.showTipCalculator() break default: rootContainer.showConverter() } } function showCalculator() { settings.activePane = CalculatorFramework.CALCULATOR_SCIENTIFIC viewDelegate.source = "asset:///BaseModeCalc.qml" viewDelegate.control.deferredKeyboardLoad() } function showConverter() { settings.activePane = CalculatorFramework.CALCULATOR_CONVERTOR viewDelegate.source = "asset:///CalcUnitsConverter.qml" } function showTipCalculator() { settings.activePane = CalculatorFramework.CALCULATOR_TIP viewDelegate.source = "asset:///TipCalculator.qml" } attachedObjects: [ // Fade in animation played on application startup // at the end we call finalizeInitialization() to perform delayed calc keyboard loading for calculator // it allows to improve app startup time FadeTransition { id: fadeViewInAnim duration: 500 easingCurve: StockCurve.Linear fromOpacity: 0 toOpacity: 1 onEnded: { if (segmentedControl.selectedIndex == 0) { viewDelegate.control.finalizeInitialization() } } }, ImplicitAnimationController { enabled: false }, QTimer { id: loadTimer singleShot: true interval: 200 onTimeout: { rootContainer.switchView() } }, ImagePaintDefinition { id: buttonBgBlue imageSource: "images/btn_blue.amd" }, ImagePaintDefinition { id: buttonBgRed imageSource: "images/btn_orange.amd" }, ImagePaintDefinition { id: buttonBgBlack imageSource: "images/btn_black.amd" }, ImagePaintDefinition { id: buttonBgWhite imageSource: "images/btn_white.amd" }, ImagePaintDefinition { id: buttonBgBluePressed imageSource: "images/btn_blue_pressed.amd" }, ImagePaintDefinition { id: buttonBgRedPressed imageSource: "images/btn_orange_pressed.amd" }, ImagePaintDefinition { id: buttonBgBlackPressed imageSource: "images/btn_black_pressed.amd" }, ImagePaintDefinition { id: buttonBgWhitePressed imageSource: "images/btn_white_pressed.amd" }, ImagePaintDefinition { id: textFieldOLEDBg imageSource: "images/oled/textfield_bg.amd" }, ImagePaintDefinition { id: textFieldOLEDBgFocused imageSource: "images/oled/textfield_bg_focus.amd" }, ImagePaintDefinition { id: textFieldOLEDBgDisabled imageSource: "images/oled/textfield_bg_na.amd" }, ImagePaintDefinition { id: textFieldBgDisabled imageSource: "images/textfield_bg_na.amd" } ] } keyListeners: [ KeyListener { onKeyPressed: { if (CalculatorFramework.CALCULATOR_SCIENTIFIC == settings.activePane) { if (scientificCalMediator.onKeyPressedHandler(event)) { if (rootContainer.currentView.isMemoListExpanded) rootContainer.currentView.startKeyboardAndScreenAnimationUP() } } } } ] }
mikeo007 likes this.08-13-13 02:04 PMLike 1 -
Thanks08-13-13 03:33 PMLike 0 - Flip4Bytes:
Using sachesi, or darcys tools, you can extract the bars from the OS' and from there, use any archive tool to extract.the bar (they're effectively glorified ZIP fiels)08-13-13 04:06 PMLike 0 -
-
:P
- Developer of 'Web Design Cheat Sheet' for BB10 (Posted via CB10)08-13-13 04:34 PMLike 0 - Bingo.
It looks like this control was built from scratch.
KeyboardPane.qml contains the actual layout and animations.
First, Second and ThirdKeyboardPane.qml contain the actual keys
CalcKeyboard.qml looks like parent container and contains all the swipe handlers.
And NavigationPaneIndicator.qml draws the little dots.
Would be REALLY nice if BB built this control into Cascades.Last edited by mikeo007; 08-13-13 at 09:54 PM.
08-13-13 09:44 PMLike 0 - Bingo.
It looks like this control was built from scratch.
KeyboardPane.qml contains the actual layout and animations.
First, Second and ThirdKeyboardPane.qml contain the actual keys
CalcKeyboard.qml looks like parent container and contains all the swipe handlers.
And NavigationPaneIndicator.qml draws the little dots.
Would be REALLY nice if BB built this control into Cascades.
Sent from my HTC Sensation using CB Forums mobile app08-14-13 02:52 AMLike 0 - Bingo.
It looks like this control was built from scratch.
KeyboardPane.qml contains the actual layout and animations.
First, Second and ThirdKeyboardPane.qml contain the actual keys
CalcKeyboard.qml looks like parent container and contains all the swipe handlers.
And NavigationPaneIndicator.qml draws the little dots.
Would be REALLY nice if BB built this control into Cascades.
- Developer of 'Web Design Cheat Sheet' for BB10 (Posted via CB10)08-14-13 09:25 PMLike 0
- Forum
- BlackBerry Developers
- Developers Lounge
Looking For Paged Horizontal Scroller? (Like Calculator App)
Similar Threads
-
So what's the launch window for Z30?
By szlevi in forum BlackBerry Z30Replies: 49Last Post: 09-16-13, 03:09 AM -
Recent News Good For Stock Price, Bad For Sales?
By BBBHonest in forum BlackBerry Z10Replies: 14Last Post: 08-13-13, 04:58 PM -
BlackBerry up for SALE already?
By kidmac13 in forum BlackBerry Z10Replies: 2Last Post: 08-12-13, 11:26 PM -
BlackBerry should market the bb10 to kids!!! It worked for iphone
By mudy in forum BlackBerry Z10Replies: 3Last Post: 08-12-13, 10:37 PM
LINK TO POST COPIED TO CLIPBOARD