Run an animation onclick?
#1
Hi,

In a panel container, how would I achieve an animation when the onclick fires?

What I want to do:
When an item is clicked, I want a copy of the item to zoom out while fading away to indicate it was clicked.

Sorry I must have lost my thinking-and-google-ability today, because I can get f-all of these simple things to work Smile
Reply
#2
+60 views, and noone has a clue? really?
Reply
#3
(2015-10-22, 13:46)Torben Wrote: +60 views, and noone has a clue? really?

IMO, there's a lack of details in your request for us to understand what you're trying to achieve.

Is the panel container filled with VFS path ? User content ?
Is the item copy Inside the container ?
When the item copy is clicked, does it become invisible or is it just cosmetic animation ?
[Skin] KOver - V1.1.0 Stable (Repo version)
[WIP] ReKOver - Skinning tool project

If I've been helpful or you like my work, hit "THANK USER" button ;) ...
Reply
#4
Hi Jayz2K,

I do not see any reason for these questions. So thanks for asking!

The panel has a <content> tag, points to the library.
I was thinking to simply animate a single label inside a container, just like with on focus.
By item clicked, I referred to the item(s) inside a regular focus-layout.
Reply
#5
(2015-10-22, 16:17)Torben Wrote: Hi Jayz2K,

I do not see any reason for these questions. So thanks for asking!

The panel has a <content> tag, points to the library.
I was thinking to simply animate a single label inside a container, just like with on focus.
By item clicked, I referred to the item(s) inside a regular focus-layout.

Those are important since onclick is available in <item> when using user content. So it works straight forward as an available function.
However, AFAIK there is no onclick action when using library content but ... it's doable with a "working but not recommended" workaround which consist to place a dummy button inside the <focusedlayout>.
This way you get benefits of button tags when the item gets focus.

A second issue I see here is that I don't see any direct boolean condition linked to the onclick action to trigger the animation. So it could be also another tricky thing to achieve this. I faced that problem one time and somehow "solved" it by setting a one shot focus to another dummy control.

PHP Code:
<control type="panel" id="50">
    ...
    <
itemlayout>
    ...
    </
itemlayout>
    <
focusedlayout>
        <
control type="button">
            <
onclick>Control.SetFocus(300)</onclick>
        </
control>
        <
conrtol type="image">
            ...
            <
animation effect="fade" start="100" end="75" time="100" condition="Control.HasFocus(300)">Conditional</animation>
        </
control>
    </
focusedlayout>
    <
content target="MY_TARGET">MY_PATH</content>
</
control>

<
control type="button" id="300">
    <
onclick>noop</onclick>
    <
label>-</label>
    <
onfocus>50</onfocus> <!-- Immediatly returned focus to my panel container -->
</
control

I'm not as skilled as some other here and maybe not the "cleanest" way to achieve it but this should work.
[Skin] KOver - V1.1.0 Stable (Repo version)
[WIP] ReKOver - Skinning tool project

If I've been helpful or you like my work, hit "THANK USER" button ;) ...
Reply
#6
Clever! Thanks, I'll go play with it Smile +Rep.
Reply
#7
The above is how i thought off the top of my head to do it.
Another way is to run the content

Code:
<control type="wraplist" id="9017">
                    <focusposition>0</focusposition>
                    <orientation>horizontal</orientation>



                    <preloaditems>9</preloaditems>
                    <scrolltime tween="quadratic">100</scrolltime>

                    <itemlayout width="1" height="1"/>
                    <focusedlayout width="1" height="1"/>
</control>

then build the view separately with a grouplist of buttons, using $INFO[Container(9017).Listitem(X).Icon|Label|etc] then you have all button controls for each item.
Reply
#8
Would you mind breaking that down a little?

@Jayz2K: "onclick is available in <item> when using user content", meaning that only if the list content is generated by a script will it work? (Seems everything has to be done be a user-script to be even remotely cool/working?)
@badaas: What do you mean "run the content" and "build the view seperately"?

..but what I really read from you guys are that we are missing the (pretty essential for any menu-layouts) <animate type="onclick"> and possibly the actual onclick inside items in a panel functionality?
Reply
#9
(2015-10-24, 00:20)Torben Wrote: Would you mind breaking that down a little?

@Jayz2K: "onclick is available in <item> when using user content", meaning that only if the list content is generated by a script will it work? (Seems everything has to be done be a user-script to be even remotely cool/working?)
@badaas: What do you mean "run the content" and "build the view seperately"?

..but what I really read from you guys are that we are missing the (pretty essential for any menu-layouts) <animate type="onclick"> and possibly the actual onclick inside items in a panel functionality?

I mean this by items :
http://kodi.wiki/view/Static_List_Content
...
and yes, there's no built-in onclick trigger for animations.
[Skin] KOver - V1.1.0 Stable (Repo version)
[WIP] ReKOver - Skinning tool project

If I've been helpful or you like my work, hit "THANK USER" button ;) ...
Reply
#10
Thanks for taking the time out to guide me. Hopefully it will help others as well.
Do you think an animation trigger "onclick" or maybe more "ontrigger" would be suggestible for Jarvis?
Reply
#11
I would say it depends of the context. It could be usefull in case it doesn't launch a new Window, otherwise you won't see any animations until you set a WindowClose delay but in that case you can trigger you animation at WindowClose straight forward so it doesn't make sens. I personnaly don't really need it but in case of static content it's always good to have more possibilities. You still can launch a request and see what others think.
[Skin] KOver - V1.1.0 Stable (Repo version)
[WIP] ReKOver - Skinning tool project

If I've been helpful or you like my work, hit "THANK USER" button ;) ...
Reply
#12
Thanks.

I was thinking indeed to use it as feedback for when the user clicks on f.ex. a song to be played and all that happens is that the song begins to play. No other indications happening. There can be a slight delay especially if a nas has to wake up, and a visual feedback indicating immediatly that the useraction is registered would be a nice gesture in a gui. I realise this is a minor detail but imho would be a nice addition.
Reply
#13
Added request in the Jarvis thread: http://forum.kodi.tv/showthread.php?tid=...pid2144293
Reply
#14
Just a follow up:

I got sidetracked, but tried do it with a second label visibile on a string match. Works, but the result was not okay.
The animation was indeed fired on the clicked listitem, but only visible while the item had focus (as it is part of the focusitem). the very second the mouse left the focused item, the animation would dissappear. No amount of wild stringmatches and thingamagickys will get this working in a nice way!

Animation onclick in a panel = Dead horse.
Reply

Logout Mark Read Team Forum Stats Members Help
Run an animation onclick?0