Boolean condition for changing view?
#1
I'm trying to move (effect="slide") some included items (take the clock for example) to different locations depending on which view is or becomes active.
For changing the window to the library this is douable with the following conditions (where 50 & 51 are ids of the views) and using WindowOpen/Close Type:
Code:
Window.Previous(Home) + Window.IsActive(VideoLibrary) + Control.IsVisible(50) -> move to x,y
Window.Previous(Home) + Window.IsActive(VideoLibrary) + Control.IsVisible(51) -> move to i,j

But what if i'm already in the VideoLibrary and change the view? Is there a way to check which view is active and which is the following view so that I can move the clock to the correct place? Something like View.Previous(50) + View.Next(51) does not seem to exist.
The point is to create a Conditional Type that gets triggered when changing the view and won't also be triggered during the opening or closing of the window.
I tried working without the WindowOpen/close events, only use Conditional events: Control.IsVisible(50) and Control.IsVisible(51). While these give a perfect slide animation when switching between views they don't seem to give a nice slide animation when opening or closing the VideoLibrary.
Reply
#2
IMO trying to do this with the current stuff is asking for a headache.

Instead, what you really want to be able to do is say:

Regardless of where the bloody control is at the moment, I want it HERE instead - now please move it there using a nice animation.

ATM this isn't really possible (well, it is, but it's trickier than it needs to be), as you must define the animations themselves so the thing ends up in the right spot, rather than defining the spot and asking the UI library to take care of things for you.

eg imagine if you could do this:

<variable type="number" name="clock_position" tween="linear">
<value condition="blah">230</value>
<value condition="foo">50</value>
</var>

Or something like that - details aren't important.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
Welcome back jmarshall!

Defining the location would indeed make it a lot easier.
At the moment it should work quite well when defining three animation per view. For Example:
PHP Code:
<animation effect="slide" end="0,-380" time="500" condition="Window.Previous(Home) + Window.IsActive(VideoLibrary) + Control.IsVisible(51)">WindowOpen</animation>
<
animation effect="slide" end="0,-380" time="500" condition="?">Conditional</animation>
<
animation effect="slide" start="0,0" end="0,380" delay="500" time="500" condition="Window.Next(Home) + Control.IsVisible(51)">WindowClose</animation
The conditional one is the problem at the moment. I can't seem to find a boolean combination that only makes that animation work when changing the view to 51. Something that would have the same result as for example View.Next(51).
I guess that's not possible at the moment?
Reply
#4
There is no idea of "changing to a new view" - only "you now have a new view"
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
In the myvideonav add this to the control with id=2 if you're using this button to change the views:
Code:
<onclick condition="Control.IsVisible(50)">SetProperty(Animation,1)</onclick>
<onclick condition="Control.IsVisible(51)">ClearProperty(Animation)</onclick>

Add !IsEmpty(Window.Property(Animation)) to the animation condition.

At last add <onunload condition="!IsEmpty(Window(VideoLibrary).Property(Animation))">ClearProperty(Animation,VideoLibrary)</onunload> to myvideonav.

Don't know if this is working but it's worth a try. Smile
Image
Reply
#6
Could you use a conditional onclick for the view change button to set up a property for the animation to use?

ie

PHP Code:
<control type="button" id="20">
    <
onclick>Container.NextViewMode</onclick>
    <
onclick condition="Control.IsVisible(50)">SetProperty(CurrentViewtype,50)</onclick>
    <
onclick condition="Control.IsVisible(51)">SetProperty(CurrentViewtype,51)</onclick>
    <
onclick condition="Control.IsVisible(52)">SetProperty(CurrentViewtype,52)</onclick>
</
control

EDIT: I see we're thinking along the same lines black. Wink
Reply
#7
Smart idea to do it with an extra Property on the button. Going to test with that.
Thanks a bunch!
Reply

Logout Mark Read Team Forum Stats Members Help
Boolean condition for changing view?0