Kodi Community Forum

Full Version: fade out on group control possible bug
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
so i wanted to learn to contribute to xbmc and i've been looking around media stream and changing it where i would like it different just to learn my way around

one of the things i wanted to change was have it so the pictures in image stream faded out as well as in

here is the original

Quote:<control type="group">
<visible>!Container.OnNext + !Container.OnPrevious</visible>
<animation effect="fade" start="0" end="100" time="400" delay="200">Visible</animation>
<animation effect="fade" start="0" end="0" time="0">Hidden</animation>

<control type="image">
<description>Image Thumb</description>
<include>ImageStreamLargeImage</include>
<info>ListItem.Thumb</info>
</control>
<control type="largeimage">
<description>Image</description>
<include>ImageStreamLargeImage</include>
<info>ListItem.FileNameAndPath</info>
</control>
</control>
</control>

and i want to change to this:

Quote:<control type="group">
<visible>!Container.OnNext + !Container.OnPrevious</visible>
<animation effect="fade" start="0" end="100" time="400" delay="400">Visible</animation>
<animation effect="fade" start="100" end="0" time="400">Hidden</animation>

<control type="image">
<description>Image Thumb</description>
<include>ImageStreamLargeImage</include>
<info>ListItem.Thumb</info>
</control>
<control type="largeimage">
<description>Image</description>
<include>ImageStreamLargeImage</include>
<info>ListItem.FileNameAndPath</info>
</control>
</control>
</control>

but as soon as i add any time other than zero to the hidden animation animation on this element seems to not work all together?
As soon as it changes visibility, Container.OnNext or Container.OnPrevious has been set, so ListItem.Thumb has changed to the next or previous item. So you'll see it change images, and then fade out. You probably don't see the fade out as there'll be another image come in before it has time to do it.
but isn't that what the delay attribute is for?

How would I acheive what I am after?
The delay attribute simply delays an animation. Your problem is that the <info> tag is changing from item to item as you move in the list. As soon as you press RIGHT the listitem moves on (instantly). You'd thus have to use the listitem(1).thumb stuff when Container.OnNext is active in order to get the image to hang around (in a different control). See how the coverflow view in PM3 is done for instance. You have a bunch of images for when things are static, and a bunch for when things are moving.

Cheers,
Jonathan
so i used the listitem(1).thumb and it worked but of course it only works one way it cant determine if you have gone back or forward how would i get the previous focus item.

i found this in the wiki which hints that it is possible

Quote:onright: Specifies the <id> of the control that should be moved to when the user moves right off this control. Can point to a control group (which remembers previous focused items).
use -1 for previous.
that would give you the previous item in the list

i need the previous item to have focus so that if you are moving forward or backward in the list it will be what you looked at last
Indeed - use Container.OnNext and Container.OnPrevious conditions to know which one to use.
cant seem to get it to work

the documentation say that onnext and onprevious return turn if it the list is moving next or previous when i need to know if it has moved next or previous
Have a hidden anim on the control visible using container.onnext.
ok ive nailed it

first of all big thank you to jmarshall, greatly appreciated

and for all those who might find it useful here is the solution

context: this is in viewspics.xml from the media stream skin on line 166

Code:
<control type="group">
                <visible>!Container.OnNext + !Container.OnPrevious</visible>
                <animation effect="fade" start="0" end="100" time="400" delay="0">Visible</animation>
                <control type="image">
                    <description>Image Thumb</description>
                    
                    <include>ImageStreamLargeImage</include>
                    <info>ListItem.Thumb</info>
                </control>

                <control type="largeimage">
                    <description>Image</description>
                    
                    <include>ImageStreamLargeImage</include>
                    <info>ListItem.FileNameAndPath</info>
                </control>
            </control>


                        
            <control type="group">
                <visible>Container.OnPrevious</visible>
                <animation effect="fade" start="100" end="0" time="400" delay="0">Hidden</animation>
                

                <control type="image">
                    <description>Image Thumb</description>
                    
                    <include>ImageStreamLargeImage</include>

                    <info>ListItem(1).Thumb</info>
                </control>

                <control type="largeimage">
                    <description>Image</description>
                    
                    <include>ImageStreamLargeImage</include>

                    <info>ListItem(1).FileNameAndPath</info>
                </control>
            </control>
            
            <control type="group">
                <visible>Container.OnNext</visible>
                <animation effect="fade" start="100" end="0" time="400" delay="0">Hidden</animation>
                <control type="image">
                    <description>Image Thumb</description>
                    
                    <include>ImageStreamLargeImage</include>
                    <info>ListItem(-1).Thumb</info>
                </control>

                <control type="largeimage">
                    <description>Image</description>
                    
                    
                    <include>ImageStreamLargeImage</include>

                    <info>ListItem(-1).FileNameAndPath</info>
                </control>
            </control>
You are most welcome - I'm glad you got it sorted Smile

Cheers,
Jonathan