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
Contributor
Posts: 10
Registered: ‎05-20-2013
My Device: Z 10
My Carrier: Blackberry

Progress bar in cascades

I need to show a progress bar in my app.I read the documentation about the progess bar it tells about the From and to value.I didt get the correct concept of it.If my question is to show a progress of 800MB out of 1 GB what wil be the values that I should set to the progress bar.Someone plz help me out

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Progress bar in cascades

You could set 0 as fromValue, 1073741824 (1 gb) as toValue and 838860800 (800 MB) as current value.

But 'float' data type can't represent values higher than 2^24 (16777216) exactly. If you see weird behavior, try scaling the values into this range.

Andrey Fidrya, @zmeyc on twitter
Developer
Posts: 148
Registered: ‎04-08-2013
My Device: Blackberry 10
My Carrier: Blackberry

Re: Progress bar in cascades

[ Edited ]

 I didnt understand the logic 1073741824 (1gb) and 838860800 (800 MB).Can u plz explain it

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Progress bar in cascades

You'll need to configure the slider's range and the current value.
For the file being downloaded the range is from zero to file size (in bytes).
Current position is number of bytes downloaded.

These values are just the sample values.

Andrey Fidrya, @zmeyc on twitter