Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 270
Registered: ‎07-20-2012
My Device: Blackberry Z10 (White), BlackBerry Dev Alpha C
Accepted Solution

NavigationPane Query

[ Edited ]

Hello, 

 

I am using a NavigationPane within my applicaiton. My main screen consists of headers and labels and the labels have onTouch {} events which will push a specific page onto the stack.

 

As each page will be a WebView, I was wondering if it is possible to create a dynamic WebView? (so the actionBar is the same each time) and I don't have to create a new WebView on every page and I am slightly confused by the WebStorage; I was trying to provide a button that caches all of the WebViews and then a button to clear cache. 

 

Furthermore, I have been looking to create an increase/decrease font size button; I created this in JavaScript and named the file TextResize.js 

 

function resizeText(multiplier) {
	if (document.body.style.fontSize == "") {
		document.body.style.fontSize == "1.0em";
	}
	document.body.style.fontSize = parseFloat(document.body.style.fontSize) + (multiplier * 0.2) + "em";
}

 I then imported it into one of my QML pages

 

import "TextResize.js" as TextResize

actions: [
ActionItem {
            title: "Increase Font Size"
            ActionBar.placement: ActionBarPlacement.InOverflow

            onTriggered: {
                TextResize.resizeText(1)
            }
        },
        ActionItem {
            title: "Decrease Font Size"
            ActionBar.placement: ActionBarPlacement.InOverflow

            onTriggered: {
                TextResize.resizeText(-1)
            }
        }
]

 Yet the buttons don't seem to do anything when increasing/decreasing the font in a WebView, so I was wondering if there's another way to increase and decrease font in a WebView by using ActionItems? 

 

Also, I am using a MapView - with the visibility set to false - and then when the user clicks 'show map' (in the more menu) the map becomes visible; is it possible to somehow create this dynamically - so that the map is always the same except it will have a different long and lat on each page or would I have to create the MapView on each of my QML pages?

 

Finally, I'm looking to create a settings page - with options for a bright/dark theme selector (coupled with a dialog: to inform the user they will need to restart the app) but I don't know where to start on that one. 

 

Thanks in advance :smileyhappy: 

Developer
Posts: 6,145
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: NavigationPane Query

@Tobster you are better off asking one question per thread, I'll answer the WebView question and give you a chance to edit out the other one in to a new thread.

 

Yes there is no reason why you can't set a Componant as global and reparent it each time you load a page.

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,145
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30

Re: NavigationPane Query

LOL, actually there are four questions here aren't there can you create 4 seperate threads, thanks.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.