Kodi Community Forum
Still struggling with views (code inside) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: Still struggling with views (code inside) (/showthread.php?tid=70703)



Still struggling with views (code inside) - Advocate - 2010-03-24

I can't get a new view for TV Shows working in my skin, and I can't figure out why.

Here is my include

Code:
<include name="tvserieslist">

<control type="group">
    <posx>0</posx>
    <posy>0</posy>
    <width>1920</width>
    <height>1080</height>
    <visible>Control.IsVisible(52)</visible>
    
    <control type="image">
        <description>White Background</description>
        <posx>0</posx>
        <posy>0</posy>
        <width>1920</width>
        <height>1080</height>
        <texture>whiteback.jpg</texture>
        <aspectratio>-</aspectratio>
    </control>
    
    <control type="image">
        <posx>17</posx>
        <posy>72</posy>
        <width>1884</width>
        <height>3</height>
        <aspectratio>stretch</aspectratio>
        <texture>widesep.png</texture>        
    </control>
  
    <control type="label">
        <posx>30</posx>
        <posy>30</posy>
        <font>Large</font>
        <textcolor>Black</textcolor>
        <label>TV Shows</label>        
    </control>
    
    <description>TV Shows Wraplist</description>
    <control type="wraplist" id="52">
        <visible>Container.Content(tvshows)</visible>
        <orientation>vertical</orientation>
        <posx>10</posx>
        <posy>200</posy>
        <width>680</width>
        <height>550</height>
        <onleft>52</onleft>
        <onright>52</onright>
        <onup>52</onup>
        <ondown>52</ondown>
        <viewtype label="tvshowlist">wraplist</viewtype>
        <scrolltime>200</scrolltime>
        <itemlayout width="600" height="30">
        <control type="label">
            <posx>0</posx>
            <posy>40</posy>
            <width>600</width>
            <height>30</height>
            <font>Small</font>
            <textcolor>Black</textcolor>
            <info>ListItem.TVShowTitle</info>
        </control>
        </itemlayout>
        <focusedlayout width="600" height="40">
        <control type="label">
            <posx>0</posx>
            <posy>0</posy>
            <width>600</width>
            <height>40</height>
            <font>Large</font>
            <textcolor>Black</textcolor>
            <info>ListItem.TVShowTitle</info>
        </control>
        </focusedlayout>
        <focusposition>0</focusposition>
    </control>    
</control>
</include>

and here is my MyVideoNav.xml

Code:
<window id="6">
<defaultcontrol>50</defaultcontrol>
<allowoverlay>no</allowoverlay>
<views>50,51,52</views>

<controls>
<control type="label">
    <include>WindowID</include>
    <label>MyVideoNav.xml</label>
  </control>
  
    <control type="grouplist" id="9000">
        <posx>10</posx>
        <posy>40</posy>
        <width>150</width>
    <height>480</height>
        <itemgap>2</itemgap>
    <onleft>50</onleft>
    <onright>50</onright>
        <onup>9000</onup>
    <ondown>9000</ondown>
        <orientation>vertical</orientation>
        <control type="button" id="2">
            <description>View</description>
      <width>150</width>
      <textcolor>White</textcolor>
      <texturefocus border="1">ButtonFo.png</texturefocus>
      <texturenofocus border="1">ButtonNF.png</texturenofocus>
        </control>
        <control type="button" id="3">
            <description>Sort</description>
            <width>150</width>
      <textcolor>White</textcolor>
      <texturefocus border="1">ButtonFo.png</texturefocus>
      <texturenofocus border="1">ButtonNF.png</texturenofocus>
        </control>
        <control type="togglebutton" id="4">
            <description>Ascending</description>
      <width>150</width>
      <label>$LOCALIZE[584]</label>
      <altlabel>$LOCALIZE[585]</altlabel>
            <textcolor>White</textcolor>
      <texturenofocus border="1">ButtonNF.png</texturenofocus>
      <texturefocus border="1">ButtonFo.png</texturefocus>
      <alttexturenofocus border="1">ButtonNF.png</alttexturenofocus>
      <alttexturefocus border="1">ButtonFo.png</alttexturefocus>
        </control>
    <control type="button" id="99">
      <description>Files</description>
      <label>$LOCALIZE[744]</label>
      <width>150</width>
      <textcolor>White</textcolor>
      <texturefocus border="1">ButtonFo.png</texturefocus>
      <texturenofocus border="1">ButtonNF.png</texturenofocus>
      <onclick>replacewindow(myvideofiles)</onclick>
      <onclick>setfocus(99)</onclick>
      <selected>window.isvisible(myvideolibrary)</selected>
    </control>
    <control type="button" id="8">
      <description>Search</description>
      <label>$LOCALIZE[137]</label>
      <width>150</width>
      <textcolor>White</textcolor>
      <texturefocus border="1">ButtonFo.png</texturefocus>
      <texturenofocus border="1">ButtonNF.png</texturenofocus>
    </control>
    <control type="button" id="9">
      <description>IMDB</description>
      <label>$LOCALIZE[368]</label>
      <width>150</width>
      <textcolor>White</textcolor>
      <texturefocus border="1">ButtonFo.png</texturefocus>
      <texturenofocus border="1">ButtonNF.png</texturenofocus>
    </control>
    </control>
    
<include>list</include>
<include>movielist</include>
<include>tvserieslist</include>
    
</controls>
  
</window>

I am entering the TV Shows page directly from the home screen with

Code:
<item id="2">
                <description>TV Shows</description>
                <label>TV Shows</label>
                <onclick>xbmc.activatewindow(videolibrary,tvshowtitles)</onclick>
            </item>

Can anyone help?


- ekim232 - 2010-03-24

Does the view have it's own xml? If so you need to add it to includes.xml. Might be one problem.


- Advocate - 2010-03-24

No I've put the view into Commonviews.xml

The first view I made for my Movies is working fine I just can't figure out what's wrong.


- mcborzu - 2010-03-24

Put <focusposition>0</focusposition> above <scrolltime>

Not sure if <description>TV Shows Wraplist</description> where it's at screws things up but put that under <control type="wraplist" id="52">

Those were two things I quickly noticed


- ekim232 - 2010-03-24

Try changing the visibilty on the wraplist to movies and see if it appears. Make sure you have a tv show library as well.


- Advocate - 2010-03-24

Moved those two things and still not working....


- Advocate - 2010-03-24

ekim232 Wrote:Try changing the visibilty on the wraplist to movies and see if it appears. Make sure you have a tv show library as well.

Nope doesn't work if I change it to movies, I still get my original movies view...I do have a TV Show library lol


- mcborzu - 2010-03-24

Try changing:

<viewtype label="tvshowlist">wraplist</viewtype>

to
<viewtype label="tvshowlist">list</viewtype>


- Advocate - 2010-03-24

That did the trick mcborzu!

Can I just ask what the word inbetween </viewtype label="tvshowlist"></viewtype> does anyway? Can it be anything?


- Hitcher - 2010-03-24

Shouldn't MyVideoNav's window id should be 25?


- Advocate - 2010-03-24

Yeah I think it has changed to 25 but 6 still works Smile


- jmarshall - 2010-03-25

Please don't use hardcoded window id's - use the window name instead.

I don't want skins to break if we go and change stuff around!


- `Black - 2010-03-25

<window id="25"></window>

I don't think you can enter a name there? He used 6 instead of 25.

Or is <window id="videolibrary"></window> also possible?


- jmarshall - 2010-03-25

XBMC completely ignores any id="" in normal windows. What I mean is that you shouldn't reference them by id (i.e. ActivateWindow(25) is a bad idea).


- Advocate - 2010-03-25

No I always open windows by calling their name ie xbmc.activatewindow(videolibrary,tvshowtitles)

Is that right?