strange flicker on first visibility of buttons with auto width.
#1
Hi, I've got a horizontal list made up of buttons for the focused item and labels for the unfocused items so I can have an underline effect on the selected item. The buttons have width set to auto and are in a grouplist with visibility conditions based on a hidden list control that has focus.

The first time I scroll through the list on a restart or after a skin refresh, there's a couple of frames on each button becoming visible where it seems to flicker. It's hard to tell, but it looks like the width starts larger and then reduces to the correct length after a frame or two.

I don't think it's due to the visibility conditions because a) on a second go around, everything works perfectly, it's only the first time each button becomes visible that there's a problem, b) it works fine if I change the control type from "button" to "label" and c) even if I remove everything except the focused button in position zero and delete all visibility conditions so it's the only thing showing on the page, it's still flickering when I refresh the skin.

It does it with or without the texture border included

Are there any known issues with having auto width on buttons, or have I done something wrong?


This is my default button control:

xml:

    <default type="button">
        <height>114</height>
        <align>left</align>
        <aligny>center</aligny>
        <font>ListFocused</font>
        <textoffsetx>0</textoffsetx>
    </default>

And this is the button - it is in my includes file as part of a dummy list parameter that is called in several locations, including Home.xml, DialogButtonMenu.xml and DialogVideoInfo.xml

xml:

    <include name="HomeMenuLabelFocused">
        <param name="hiddenid"/>
        <param name="position"/>
        <definition>
            <control type="button">
                <top>0</top>
                <height>114</height>
                <width>auto</width>
                <font>ListFocused</font>
                <textcolor>$VAR[PrimaryColor]</textcolor>
                <label>$INFO[Container($PARAM[hiddenid]).ListItemPosition($PARAM[position]).Label]</label>
                <texturefocus border="0,0,0,8" colordiffuse="$VAR[FocusColor]">views/border_bottom_8px.png</texturefocus>
                <texturenofocus border="0,0,0,8" colordiffuse="$VAR[FocusColor]">views/border_bottom_8px.png</texturenofocus>
                <visible>String.IsEqual(Container($PARAM[hiddenid]).ListItemPosition($PARAM[position]).Label, Container($PARAM[hiddenid]).ListItem.Label)</visible>
            </control>
        </definition>
    </include>

This is called in a grouplist like so:

xml:

!--Dummy Horizontal List-->
    <include name="DummyHorizontalList">
        <param name="dummyid"/>
        <param name="hiddenid"/>
        <param name="top" default="483"/>
        <definition>
            <control type="grouplist" id="$PARAM[dummyid]">
                <top>$PARAM[top]</top>
                <left>192</left>
                <width>1536</width>
                <height>114</height>
                <orientation>horizontal</orientation>
                <align>center</align>
                <itemgap>12</itemgap>
                <usecontrolcoords>true</usecontrolcoords>
                <scrolltime tween="sine" easing="inout">380</scrolltime>
                <animation effect="slide" start="0" end="-120" condition="!Container($PARAM[hiddenid]).OnScrollNext" reversible="false" time="200" tween="sine" easing="inout">Conditional</animation>
                <animation effect="slide" start="0" end="120" condition="!Container($PARAM[hiddenid]).OnScrollPrevious" reversible="false" time="200" tween="sine" easing="inout">Conditional</animation>

                <!--Previous-->
                <control type="label">
                    <visible>Container($PARAM[hiddenid]).HasPrevious</visible>
                    <label>...</label>
                    <include content="HomeMenuLabelUnfocused"/>
                </control>

                <!--Position 0 Unfocused-->
                <include content="HomeMenuLabelUnfocusedContent">
                    <param name="hiddenid" value="$PARAM[hiddenid]"/>
                    <param name="previousposition" value="-1"/>
                    <param name="position" value="0"/>
                    <param name="nextposition" value="1"/>
                </include>
                <!--Position 0 Focused-->
                <include content="HomeMenuLabelFocused">
                    <param name="hiddenid" value="$PARAM[hiddenid]"/>
                    <param name="position" value="0"/>
                </include>

...
...
...


My current code is here: https://github.com/realcopacetic/skin.copacetic

Would anyone have a few moments to look at this or test if they get the same behaviour on their devices?

Note: If things aren't working in the skin, it might be because i have only currently defined my default values for my skin.strings on startup, so you might need to restart kodi before things work properly.

Thanks in advance
Reply
#2
I can confirm getting the same behaviour.

Not sure what the cause is but it only happens when the grouplist is center aligned. If you left align the grouplist then it doesn't happen. Seems to be some sort of delay between the control becoming visible and the recalculation of the alignment
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#3
(2019-11-15, 11:33)jurialmunkey Wrote: I can confirm getting the same behaviour.

Not sure what the cause is but it only happens when the grouplist is center aligned. If you left align the grouplist then it doesn't happen. Seems to be some sort of delay between the control becoming visible and the recalculation of the alignment

Thanks for confirming! I'll go back to left aligned and it should be fine, thanks
Reply
#4
(2019-11-15, 12:02)QuizKid Wrote:
(2019-11-15, 11:33)jurialmunkey Wrote: I can confirm getting the same behaviour.

Not sure what the cause is but it only happens when the grouplist is center aligned. If you left align the grouplist then it doesn't happen. Seems to be some sort of delay between the control becoming visible and the recalculation of the alignment

Thanks for confirming! I'll go back to left aligned and it should be fine, thanks 

There must be a difference in how labels and buttons are rendered as it doesn't happen with labels. Is there scope for this to be looked at in the actual rendering engine? Not sure if this would be considered a bug or not
Reply

Logout Mark Read Team Forum Stats Members Help
strange flicker on first visibility of buttons with auto width.0