Fixed grouplist
#1
Is there anyway to make a grouplist behave like a fixedlist, meaning the focused item is fixed in place and the items scroll not the focused position?
Reply
#2
(2020-10-04, 18:36)roidy Wrote: Is there anyway to make a grouplist behave like a fixedlist, meaning the focused item is fixed in place and the items scroll not the focused position?

You probably need to add some animations so when the focus shifts, the whole group list slides up or down. This is how I did my groups of widgets on my movieinfo screen, so the focused container is always at the top
Reply
#3
Thanks, could you point me to the code you use in your skin.

That's what I'm trying to do at the moment, slide then whole grouplist based on which widget group has focus but I'm running in the problem of if one of the widget groups is empty and thus hidden is messes up the whole animation chain.
Reply
#4
(2020-10-05, 17:22)roidy Wrote: Thanks, could you point me to the code you use in your skin.

That's what I'm trying to do at the moment, slide then whole grouplist based on which widget group has focus but I'm running in the problem of if one of the widget groups is empty and thus hidden is messes up the whole animation chain.

Yeah sure, here you go: https://github.com/realcopacetic/skin.co...eoInfo.xml

There may well be a better way to do this, but this works ok for me:

xml:

<animation effect="slide" end="0,-1080" time="380" condition="Integer.IsGreater(Container(65001).CurrentItem,0)" reversible="true" tween="sine" easing="out" >Conditional</animation>
<animation effect="slide" end="0,-710" time="380" condition="Control.IsVisible(50) + String.IsEqual(Control.GetLabel(502),Poster) + [Control.HasFocus(4500) | Control.HasFocus(4510) | Control.HasFocus(4520) | Control.HasFocus(4530) | Control.HasFocus(4540)]" reversible="true" tween="sine" easing="out" >Conditional</animation>
<animation effect="slide" end="0,-710" time="380" condition="Control.IsVisible(4500) + String.IsEqual(Control.GetLabel(45002),Poster) + [Control.HasFocus(4510) | Control.HasFocus(4520) | Control.HasFocus(4530) | Control.HasFocus(4540)]" reversible="true" tween="sine" easing="out" >Conditional</animation>
<animation effect="slide" end="0,-710" time="380" condition="Control.IsVisible(4510) + String.IsEqual(Control.GetLabel(45102),Poster) + [Control.HasFocus(4520) | Control.HasFocus(4530) | Control.HasFocus(4540)]" reversible="true" tween="sine" easing="out" >Conditional</animation>
<animation effect="slide" end="0,-710" time="380" condition="Control.IsVisible(4520) + String.IsEqual(Control.GetLabel(45202),Poster) + [Control.HasFocus(4530) | Control.HasFocus(4540)]" reversible="true" tween="sine" easing="out" >Conditional</animation>
<animation effect="slide" end="0,-710" time="380" condition="Control.IsVisible(4530) + String.IsEqual(Control.GetLabel(45302),Poster) + Control.HasFocus(4540)" reversible="true" tween="sine" easing="out" >Conditional</animation>

Basically, the ids for the controls in my grouplist (65001) are 50, 4500, 4510, 4520, 4530, 4540 etc...

I made things a bit harder for myself by needing the scrolling to work smoothly whether each of those items is a portrait widget or landscape wiget, but in effect, what it's saying is:

1. If the grouplist has more than 0 items, slide -1080 vertically (this is to bring the grouplist to the top of the screen)
2. If [item 1 is visible], and [items 2 or 3 or 4 or 5 or 6... have focus], slide by [-height of item 1] to position whatever the next visible item is at the top
3. If [item 2 is visible], and [items 3 or 4 or 5 or 6.. have focus], slide by [-height of item 2] to position whatever the next visible item is at the top
4. If [item 3 is visible] and [items 4 or 5 or 6... have focus], slide by [-height of item 3] position whatever the next visible item is at the top
5. If [item 4 is visible] and [item 5 or 6... have focus], slide by [-height of item 4] to position whatever the next visible item is at the top
6. If [item 5 is visible] and [item 6] has focus, slide by [-height of item 5] to position item 6 at the top

Originally I had it so if item 1 was focused, it would move the grouplist by -1080 then if item 2 was focused, it would move the grouplist by -1500 then if item 3 was focused, it would move the grouplist by -2000 etc. But this made for a weird behaviour on scrolling because the scroll has a timer and a tween, so it would start to move up as one item lost focus and that condition became false before the it started moving down to the next item.

It also had the problem you mentioned that things could jump to the wrong place if a control was not visible

The way above avoids this happening because, if for example item 5 has focus, then line 1. 2. 3. 4. and 5. will all be true (assuming those items are all visible). If you scroll back up to item 4, only line 5. stops being true, so that animation will reverse but the others hold their position. It's important for it to work that the animation can be reversible. And because the scrolling is relative based on the size of the last visible item rather than absolute, it accounts for hidden items as well
Reply
#5
Awesome, thanks for the explanation, that's a big help.

I was thinking about it last night and I haven't tried it yet but the same effect could possibly be achieved using Container().Position

Perhaps like so, assuming a grouplist id of 4000 and each widget group is 600 pixels height, and the first group needs no scrolling as it's already at the top.

xml:
<control type="grouplist" id="4000">
    <!-- First position needs no slide -->
    <animation effect="slide" end="0,-600" time="200" condition="Integer.IsGreater(Container(4000).Position,1)">Conditional</animation>
    <animation effect="slide" end="0,-600" time="200" condition="Integer.IsGreater(Container(4000).Position,2)">Conditional</animation>
    <animation effect="slide" end="0,-600" time="200" condition="Integer.IsGreater(Container(4000).Position,3)">Conditional</animation>
    <!-- and so no.... -->
</control>

This way I don't need to track group id's and hidden widget groups work because it's based on the grouplist's position not which widget group has focus (I think).

I'll play around with both methods at the weekend and see what I can come up with. Again big thanks for the help.
Reply
#6
(2020-10-06, 18:30)roidy Wrote: Awesome, thanks for the explanation, that's a big help.

I was thinking about it last night and I haven't tried it yet but the same effect could possibly be achieved using Container().Position

Perhaps like so, assuming a grouplist id of 4000 and each widget group is 600 pixels height, and the first group needs no scrolling as it's already at the top.

xml:
<control type="grouplist" id="4000">
    <!-- First position needs no slide -->
    <animation effect="slide" end="0,-600" time="200" condition="Integer.IsGreater(Container(4000).Position,1)">Conditional</animation>
    <animation effect="slide" end="0,-600" time="200" condition="Integer.IsGreater(Container(4000).Position,2)">Conditional</animation>
    <animation effect="slide" end="0,-600" time="200" condition="Integer.IsGreater(Container(4000).Position,3)">Conditional</animation>
    <!-- and so no.... -->
</control>

This way I don't need to track group id's and hidden widget groups work because it's based on the grouplist's position not which widget group has focus (I think).

I'll play around with both methods at the weekend and see what I can come up with. Again big thanks for the help.
Oh that would be a much more efficient way of doing it, haha.
Reply

Logout Mark Read Team Forum Stats Members Help
Fixed grouplist0