Join Our 3 MILLION+ Members Today! Register Here | Login
Go Back   BlackBerry Forums at CrackBerry.com > BlackBerry Professionals > Theme Developers

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
    Thread Author   #1  
Old 07-28-2010, 07:41 AM
CrackBerry User
Device(s): 9700 (Bold)
Carrier: AT&T/Cingular
Pin: PM me
 
Location: Philadelphia, PA
Join Date: Apr 2010
Posts: 54
Likes Received: 0
Thanked 4 Times in 4 Posts
Default If statements?

Hey,

I've searched all over this site and the internet in general, and either there isn't an answer, or I looked over it accidentally.

Is it possible to have any "if statements" when editing SVG code? I want to set up an animation to trigger via an access key, but only if a certain condition is met (or, set it so that the animation won't trigger if the condition isn't met).

Is this possible? If it isn't, is there something similar I could do? I know that there is a <switch> command in SVG code, but I read somewhere that it isn't supported with Blackberry SVG files.

Any help would be greatly appreciated.

Thanks!
Reply With Quote Tip this Post
  #2  
Old 07-28-2010, 08:44 AM
CrackBerry Abuser
Device(s): 9550 (Storm2)
Carrier: Verizon
Pin: PM me
 
Location: Michigan
Join Date: Feb 2009
Posts: 202
Likes Received: 8
Thanked 15 Times in 14 Posts
Default

Basically, your asking if SVG code supports boolean expressions....? I have been wondering about this as well.

Anybody know?
__________________
Check out my themes | Reflect7 Carbon |!Aspire | Prestige | Refresh | Default EX/Plus | HERE


Give my website a peek too!

Rockin' the Bold 9650 and Storm 2 - there's a 8530 lying around here somewhere as well.
Reply With Quote Tip this Post
    Thread Author   #3  
Old 07-28-2010, 09:13 AM
CrackBerry User
Device(s): 9700 (Bold)
Carrier: AT&T/Cingular
Pin: PM me
 
Location: Philadelphia, PA
Join Date: Apr 2010
Posts: 54
Likes Received: 0
Thanked 4 Times in 4 Posts
Default

exactly. It would make life a whole lot easier.

Really any type of conditional statements would do.

Can anyone give any insight on this?

Last edited by Super_Saxy; 07-28-2010 at 09:17 AM.
Reply With Quote Tip this Post
  #4  
Old 07-28-2010, 09:22 AM
CrackBerry Genius
Device(s): 9550 (Storm2)
Carrier: Telus
 
Join Date: Dec 2008
Posts: 1,792
Likes Received: 1
Thanked 46 Times in 16 Posts
Default

This is technically possible using SVG, but the theme builder and device do not support it.
__________________
Creative Director of BlingBerry Themes
iStyle - by BlingBerry Themes --- RealCal --- Super Air Hockey!
Reply With Quote Tip this Post
  #5  
Old 07-28-2010, 09:23 AM
CrackBerry Genius
Device(s): 9550 (Storm2)
Carrier: Telus
 
Join Date: Dec 2008
Posts: 1,792
Likes Received: 1
Thanked 46 Times in 16 Posts
Default

I should also add that I would kill for this functionality. That, and the ability to force the cursor to "focusin" on an object when another is clicked.
__________________
Creative Director of BlingBerry Themes
iStyle - by BlingBerry Themes --- RealCal --- Super Air Hockey!
Reply With Quote Tip this Post
    Thread Author   #6  
Old 07-28-2010, 09:38 AM
CrackBerry User
Device(s): 9700 (Bold)
Carrier: AT&T/Cingular
Pin: PM me
 
Location: Philadelphia, PA
Join Date: Apr 2010
Posts: 54
Likes Received: 0
Thanked 4 Times in 4 Posts
Default

thats frustrating.

I'm trying to have a dock that "slides" in and out via a accessKey activated animation. The problem is that when I press the spacebar to slide the dock in, it will replay the animation every time, EVEN if the dock is already out. I would love to use a conditional statement to make it so that the dock will not slide out if it already is.

Anyone have a suggestion for this issue?
Reply With Quote Tip this Post
    Thread Author   #7  
Old 07-28-2010, 09:51 AM
CrackBerry User
Device(s): 9700 (Bold)
Carrier: AT&T/Cingular
Pin: PM me
 
Location: Philadelphia, PA
Join Date: Apr 2010
Posts: 54
Likes Received: 0
Thanked 4 Times in 4 Posts
Default

does anyone know if I can use the <set> command with position? For example,
Code:
<set xlink:href="xxxxxxx" attributeName="x" to="0" begin="0" />
Reply With Quote Tip this Post
  #8  
Old 07-28-2010, 12:55 PM
CrackBerry Genius
Device(s): iPhone 4s
Carrier: Verizon
 
Join Date: Nov 2009
Posts: 2,310
Likes Received: 88
Thanked 169 Times in 112 Posts
Default

to fix the dock issue... when you click to hid the dock.. also turn off the display...

<animateTransform blah blah "#Dock" blah.. dur="0.5s" begin="accesKey(SPACE)"
<set blah "#Dock" display="none" begin="accessKey(SPACE) +0.5s">

you delay the display=none by the amount of the duration for the hide... get it?
so after it slides down, it then disappears. Be sure to dispay it again when you click the slide up key.

no, you cant set a move... you need to do a transform="translate"


GREAT REFERENCE: http://docs.blackberry.com/en/develo...martphones.pdf
__________________
Reply With Quote Tip this Post
  #9  
Old 07-28-2010, 01:00 PM
CrackBerry Genius
Device(s): 9550 (Storm2)
Carrier: Telus
 
Join Date: Dec 2008
Posts: 1,792
Likes Received: 1
Thanked 46 Times in 16 Posts
Default

Hmm...that's the biggest issue with using hardware buttons to trigger animations. If you opted for software buttons, you could "hide" the ON switch and replace it with the OFF switch instead.

While not optimal, you could create a duplicate set of icons and dock and set it up so that this duplicate set of dock and icons just "hides" and "shows" in the fully up position. This way you won't have to animate the duplicate set since it's already in position. (#iconsdock2)

1) When the space bar is pressed, animate #iconsdock1 to slide up. At the same time (after a duration delay of some sort), have #iconsdock1 hide and "show" #iconsdock2. The user wouldn't even be able to tell. Since #iconsdock1 is now hidden, even if they press the space bar it will run the animation but it will not be visible to the user.
2) When the user presses an alternate hardware key to hide the dock, position #iconsdock1 to be in the same "up" position, "show" #iconsdock1, hide #iconsdock2, and animate the slide down with #iconsdock1.

Of course, setting up scroll paths with something like that requires some thought, but it's possible. My recommendation would be to only allow scroll paths to reach the icons in #iconsdock2, since it's the only visible icons the user will ever see.

After that, #iconsdock1 is visible but below the screen as it always should be, #iconsdock2 is hidden as it should be, and you should have no problem looping.
__________________
Creative Director of BlingBerry Themes
iStyle - by BlingBerry Themes --- RealCal --- Super Air Hockey!
Reply With Quote Tip this Post
  #10  
Old 07-28-2010, 01:04 PM
CrackBerry Genius
Device(s): 9550 (Storm2)
Carrier: Telus
 
Join Date: Dec 2008
Posts: 1,792
Likes Received: 1
Thanked 46 Times in 16 Posts
Default

Quote:
Originally Posted by StaticFX View Post
to fix the dock issue... when you click to hid the dock.. also turn off the display...

<animateTransform blah blah "#Dock" blah.. dur="0.5s" begin="accesKey(SPACE)"
<set blah "#Dock" display="none" begin="accessKey(SPACE) +0.5s">

you delay the display=none by the amount of the duration for the hide... get it?
so after it slides down, it then disappears. Be sure to dispay it again when you click the slide up key.

no, you cant set a move... you need to do a transform="translate"


GREAT REFERENCE: http://docs.blackberry.com/en/develo...martphones.pdf
What about when the user wants the dock visible? I think he's saying that when they press the SPACE key to bring up the dock, once it's up if they press the SPACE key again it repeats the animation.
__________________
Creative Director of BlingBerry Themes
iStyle - by BlingBerry Themes --- RealCal --- Super Air Hockey!
Reply With Quote Tip this Post
    Thread Author   #11  
Old 07-28-2010, 02:47 PM
CrackBerry User
Device(s): 9700 (Bold)
Carrier: AT&T/Cingular
Pin: PM me
 
Location: Philadelphia, PA
Join Date: Apr 2010
Posts: 54
Likes Received: 0
Thanked 4 Times in 4 Posts
Default

Here is what I came up with:

Code:
		<animateTransform xlink:href="#Top_Dock" id="_anim_l6" attributeName="transform" type="translate"
						to="0,80" dur="0.5s"  
						fill="remove"
						begin="accessKey( )"
						restart="whenNotActive"	/>	

		<set xlink:href="#Top_Dock" attributeName="display" to="none" begin="accessKey( ) +0.5s"	/>

		<set xlink:href="#Top_Dock_2" attributeName="display" to="inline" begin="accessKey( ) +0.5s"	/>

						
		<animateTransform xlink:href="#Top_Dock_2" id="_anim_d6" attributeName="transform" type="translate"
						to="0,-80" dur="0.5s"  
						fill="remove"
						begin="accessKey(ESCAPE)"
						restart="whenNotActive"	/>

		<set xlink:href="#Top_Dock" attributeName="display" to="inline" begin="accessKey(ESCAPE) +0.5s" />

		<set xlink:href="#Top_Dock_2" attributeName="display" to="none" begin="accessKey(ESCAPE) +0.5s" />
The code starts with "top dock" above the screen, and "top dock 2" in the proper location on screen. Both docks start out hidden. When I hit the spacebar, "top dock" flies in, and immediately after the annimation, "top dock" hides via display and "top dock 2" shows via display. On the escape key, "top dock 2" animates flying off teh screen, then immediately hides and "top dock" sets to display again.

This combination has completely solved the problem with hard key dock hide/show!!!

I had to add a few things to solve some minor annoyances. I had to add the "repeat" command to stop the animation from restarting if you pressed the accessKey while it was running. I also had to change the fill to "remove" to put each of the two docks back in their original place.

There is one minor issue though. "top dock" and "top dock 2" are set to device application order. They obviously display different things. So when the one flies in it shows certain icons, and when it hides and displays the other dock, it shows different icons. Is there a way around this? Is it possible to have both docks display the same icons, even with "device application order"?
Reply With Quote Tip this Post
Thanked by dcburke789 (11-13-2011)
  #12  
Old 07-28-2010, 02:53 PM
CrackBerry Genius
Device(s): 9550 (Storm2)
Carrier: Telus
 
Join Date: Dec 2008
Posts: 1,792
Likes Received: 1
Thanked 46 Times in 16 Posts
Default

Yup. When you add an icon using composer and set it to application order, pay careful attention to the code used to display the button.

Notice: "<useApplicationIcons app-id="slot8""

By changing the "slot8" to something like "slot9", you can specify which "slot" it takes in the application order. Set each icon in both docks to the same "slots", and you're good to go.
__________________
Creative Director of BlingBerry Themes
iStyle - by BlingBerry Themes --- RealCal --- Super Air Hockey!
Reply With Quote Tip this Post
    Thread Author   #13  
Old 07-28-2010, 02:57 PM
CrackBerry User
Device(s): 9700 (Bold)
Carrier: AT&T/Cingular
Pin: PM me
 
Location: Philadelphia, PA
Join Date: Apr 2010
Posts: 54
Likes Received: 0
Thanked 4 Times in 4 Posts
Default

Quote:
Originally Posted by hastings View Post
Yup. When you add an icon using composer and set it to application order, pay careful attention to the code used to display the button.

Notice: "<useApplicationIcons app-id="slot8""

By changing the "slot8" to something like "slot9", you can specify which "slot" it takes in the application order. Set each icon in both docks to the same "slots", and you're good to go.
You're the man!!! Thanks so much.
Reply With Quote Tip this Post
  #14  
Old 04-05-2011, 10:05 PM
CrackBerry User
Device(s): 8320 (Curve)
Carrier: T-Mobile
 
Join Date: Apr 2009
Posts: 29
Likes Received: 0
Thanked 0 Times in 0 Posts
Default

This should be stickied. Thank you guys SO MUCH!
Reply With Quote Tip this Post
  #15  
Old 04-06-2011, 10:30 AM
CrackBerry Master
Device(s): 9850 7.1.0.402 + PlayBook 16Gb
Carrier: Verizon
Pin: PM me for it!
 
Location: Eastern Shore of MD
Join Date: Sep 2008
Posts: 1,091
Likes Received: 119
Thanked 217 Times in 126 Posts
Default

Another 2 cents for sliding docks on non-touchscreen devices:

Let's say, for example, the dock is at the bottom of the screen and slides south when hidden. I create a hotspot south of the dock, off of the visible display, and set the focus order so that trackpad down from any of the dock buttons goes to the hotspot. The hotspot is set so that when it goes into focus, the dock hides and when it comes out of focus (trackpad up) the dock is shown.

You can also do some other nice things with this method, such as retaining which 'page' a scrolling and hiding dock is on by having a hidden hotspot for each page.
__________________
"If anyone would come after me, let him deny himself and take up his cross and follow me" - Matthew 16:24

Follow me on twitter: graymatteron
Reply With Quote Tip this Post
Reply
BlackBerry Forums at CrackBerry.com > > BlackBerry Professionals > Theme Developers   If statements?

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes