How can I add a new view mode?
#1
Question 
People have told me this but I cant quite get it.

I want to make a brand new view and add it to the list of options. I made the view, how do I add it?
Reply
#2
You should just have to give the view a unique id and add that to <views> at myvideonav.xml...
<control type="wraplist" id="720">
<views>50,500,501,508,504,503,505,511,720</views>

If you want to go a little further, I prefer the Alaska/Aeon way of keeping things inside of different viewtype_foo.xml instead of all in one big view.xml. Plus when Confluence is updated it wont be overwritten and you wont have to compare and merge.

Anyways here is an example taking PosterWrap and making into a new view called bob, with include name of YoMomma. You can see it here...http://pastebin.com/m6c9e4b26

Then added the view id of 720 to the <views> tag at the top of myvideonav.xml.

Then added this bolded part at line 152 in myvideonav.xml
Quote:<include>WideIconView</include> <!-- view id = 505 -->
<include>MusicVideoInfoListView</include> <!-- view id = 511 -->
<include>YoMomma</include>

And then this <include file="viewtype_test.xml" /> at the top of includes.xml
Reply
#3
Look into the file you want to add it to in this example MyVideo.xml (video files mode)
add your code or include depending on how you did it too this block
PHP Code:
        <control type="group">
            <include>
Window_OpenClose_Animation</include>        
            <include>
CommonRootView</include> <!-- view id 50 -->
            <include>
FullWidthList</include> <!-- view id 51 -->
            <include>
ThumbnailView</include> <!-- view id 500 -->
            <include>
PosterWrapView</include> <!-- view id 501 -->
            <include>
PosterWrapView2_Fanart</include> <!-- view id 508 -->
            <include>
WideIconView</include> <!-- view id 505 -->
        </
control

and make sure you also add the id number of the view to this line at the top
PHP Code:
    <views>50,51,500,501,508,505</views

You of course need to make sure that the id number doesn't conflict with any of the current ones
Reply
#4
Jezz_X Wrote:and make sure you also add the id number of the view to this line at the top
PHP Code:
    <views>50,51,500,501,508,505</views

i've been wondering for some time why this is needed?
some skins don't use a <views> definition at the top of their My*.xml files,
while others don't seem to run properly without it.

could you explain what that line means?
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
Thanks for the help guys!
Reply
#6
ronie Wrote:i've been wondering for some time why this is needed?
some skins don't use a <views> definition at the top of their My*.xml files,
while others don't seem to run properly without it.

could you explain what that line means?

the <views> tag lets you use id's beyond 50 to 59 it also lets you set the order in which they cycle with the change view button in the skin by changing the order of the numbers in the tag

You don't need the <views> tag if your only using id's 50 to 59 for views but as you can see in confluence aside from id 50 (needed for virtual nav to lists not id'd 50) I use 500 - 600
Reply
#7
thanx, o thou skinning master!

i'll check if there's a suitable place in the wiki for this info.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#8
I need to add a view to a skin so that files can be viewed better than 'list'
how or where do I add the code for file view and not library view?
Reply
#9
(2020-04-19, 18:11)2nzy2 Wrote: I need to add a view to a skin so that files can be viewed better than 'list'
how or where do I add the code for file view and not library view?

if it is a newer skin look at 
MyMusicNav.xml MyVideoNav.xml 
<views>50,52,53,54,55,500,504,505,506,507,508,509</views>

MyMusicNav.xml MyVideoNav.xml Includes.xml
    <include>View_50_List</include>
            <include>View_52_IconWall</include>
            <include>View_53_Shift</include>
            <include>View_54_InfoWall</include>
            <include>View_55_WideList</include>
            <include>View_500_Wall</include>
            <include>View_504_ThumbsWall</include>
            <include>View_505_ThumbsInfoWall</include>
            <include>View_506_Mosaic</include>
            <include>View_507_Mosaic_Vertical</include>
            <include>View_508_DoubleLists</include>
            <include>View_509_TripleLists</include>
Reply
#10
(2020-04-20, 03:53)the_other_guy Wrote:
(2020-04-19, 18:11)2nzy2 Wrote: I need to add a view to a skin so that files can be viewed better than 'list'
how or where do I add the code for file view and not library view?

if it is a newer skin look at 
MyMusicNav.xml MyVideoNav.xml 
<views>50,52,53,54,55,500,504,505,506,507,508,509</views>

MyMusicNav.xml MyVideoNav.xml Includes.xml
    <include>View_50_List</include>
            <include>View_52_IconWall</include>
            <include>View_53_Shift</include>
            <include>View_54_InfoWall</include>
            <include>View_55_WideList</include>
            <include>View_500_Wall</include>
            <include>View_504_ThumbsWall</include>
            <include>View_505_ThumbsInfoWall</include>
            <include>View_506_Mosaic</include>
            <include>View_507_Mosaic_Vertical</include>
            <include>View_508_DoubleLists</include>
            <include>View_509_TripleLists</include>

yea but file view not library view?
Reply
#11
yea but file view not library view?
Includes_Home.xml
View_54_InfoWall.xml

Includes_Home.xml
xml:
<include name="InfoWallfanartLayout">
        <param name="focused">false</param>
        <definition>
            <control type="image">
                <left>0</left>
                <top>10</top>
                <width>360</width>
                <height>240</height>
                <texture  fallback="$VAR[landscapeVar]" background="true">$VAR[landscapeVar]</texture>
                <bordertexture border="21">overlays/shadow.png</bordertexture>
                <aspectratio aligny="center">keep</aspectratio>
                <bordersize>20</bordersize>
                <animation effect="fade" start="100" end="0" time="0" >Conditional</animation>
            </control>
            <control type="image">
                <left>35</left>
                <top>38</top>
                <width>32</width>
                <height>32</height>
                <texture>$VAR[WallWatchedIconVar]</texture>
            </control>
            <control type="group">
                <left>225</left>
                <top>40</top>
                <include condition="Skin.HasSetting(circle_rating) | Skin.HasSetting(circle_userrating)">RatingCircle</include>
            </control>
            <control type="group">
                <visible>String.IsEqual(ListItem.DBtype,tvshow)</visible>
                <top>250</top>
                <control type="label">
                    <left>-90</left>
                    <top>-42</top>
                    <width>280</width>
                    <label>$INFO[ListItem.Property(WatchedEpisodes)]$INFO[ListItem.Property(TotalEpisodes), / ,]</label>
                    <font>font20_title</font>
                    <shadowcolor>text_shadow</shadowcolor>
                    <align>right</align>
                </control>
                <control type="image">
                    <left>270</left>
                    <top>-42</top>
                    <width>24</width>
                    <height>24</height>
                    <texture>lists/played-total.png</texture>
                    <animation effect="fade" start="100" end="0" time="0" >Conditional</animation>
                </control>
            </control>
            <control type="image">
                <left>35</left>
                <top>-42</top>
                <width>32</width>
                <height>32</height>
                <texture>$VAR[WallWatchedIconVar]</texture>
            </control>
        </definition>
    </include>
Image
Includes_Home.xml https://forum.kodi.tv/showthread.php?tid=344394
Reply
#12
(2020-04-19, 18:11)2nzy2 Wrote: I need to add a view to a skin so that files can be viewed better than 'list'
how or where do I add the code for file view and not library view?

You seem to to starting from a false position which maybe is why you're not understanding what to do.

First of all for Video then https://github.com/xbmc/skin.confluence/...deoNav.xml defines the views available for browsing videos for BOTH file and movie/tv library views. Views can be file only, library only, or used for both file & library.

In Confluence the default view is List view which has an id of 50 this is defined in in MyVideoNav by https://github.com/xbmc/skin.confluence/...ml#L12-L13 so the code of the view is in Include CommonRootView and this include is contained in ViewsFileMode https://github.com/xbmc/skin.confluence/...ml#L3-L230

However despite the name ViewsFileMode the List view is applicable to both File and Library views.
Reply
#13
There some basic instrcution at https://kodi.wiki/view/HOW-TO:Add_a_new_...o_the_skin
Reply

Logout Mark Read Team Forum Stats Members Help
How can I add a new view mode?0