How to force thumbnail view ?

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
realtebo Offline
Senior Member
Posts: 164
Joined: Apr 2013
Reputation: 0
Post: #1
In my plugin I draw a list of video.

I think it will be great so see the list like "thumbnail view", and not the default narrow list.

is there a way to tell to xmbc to show the directory like grid and not like list ?

What I want to do Is exactloy what the youtube plugin does after search. Every video in a thumbnail with titles below each picture
(This post was last modified: 2013-09-24 13:43 by realtebo.)
find quote
Roman_V_M Offline
Team-Kodi Member
Posts: 1,130
Joined: Jun 2011
Reputation: 55
Location: Kyiv, Ukraine
Post: #2
It's relatively easy, but you need to know the necessary View Mode IDs for every skin you're going to support. The code below does the trick:

PHP Code:
skin_used xbmc.getSkinDir()
if 
skin_used == 'skin.confluence':
    
xbmc.executebuiltin('Container.SetViewMode(500)'# "Thumbnail" view
elif skin_used == 'skin.aeon.nox':
    
xbmc.executebuiltin('Container.SetViewMode(512)'# "Info-wall" view. 

For other skins their default views will be used.

Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
(This post was last modified: 2013-09-24 16:08 by Roman_V_M.)
find quote
realtebo Offline
Senior Member
Posts: 164
Joined: Apr 2013
Reputation: 0
Post: #3
1. Thanks
2. is it supposed/mandatory a plugin developer must support more than one skin ? Confluence is the default, is right?
3. If someone ask me to support other skin, after I download skin code, what must I search, to get this id ?
find quote
Roman_V_M Offline
Team-Kodi Member
Posts: 1,130
Joined: Jun 2011
Reputation: 55
Location: Kyiv, Ukraine
Post: #4
2. No, additional skin support is completely up to you.
3. You need to look into MyVideoNav.xml, MyMusicNav.xml and MyPics.xml files from the necessary skin for video, music and pictures respectively. But note that not all views are available for plugins.

Just to be clear: View Mode IDs are different in every skin (except for a default view ID=50), so you need to do a skin check even if you're going to support only one skin.

Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
(This post was last modified: 2013-09-24 16:24 by Roman_V_M.)
find quote
realtebo Offline
Senior Member
Posts: 164
Joined: Apr 2013
Reputation: 0
Post: #5
2.1 -- Confluence is the default skin ?
find quote
Roman_V_M Offline
Team-Kodi Member
Posts: 1,130
Joined: Jun 2011
Reputation: 55
Location: Kyiv, Ukraine
Post: #6
(2013-09-24 16:39)realtebo Wrote:  2.1 -- Confluence is the default skin ?

Yes, Confluence is the default skin. Sorry, I've thought it's a known fact.Smile

Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
find quote
sphere Offline
Team-Kodi Member
Posts: 1,299
Joined: Jul 2009
Reputation: 60
Location: Germany
Post: #7
Some time ago I walked through all available skins to find their "thumbnail likest" view id for xbmcswift inclusion.
PHP Code:
VIEW_MODES = {
    
'thumbnail': {
        
'skin.confluence'500,
        
'skin.aeon.nox'551,
        
'skin.confluence-vertical'500,
        
'skin.jx720'52,
        
'skin.pm3-hd'53,
        
'skin.rapier'50,
        
'skin.simplicity'500,
        
'skin.slik'53,
        
'skin.touched'500,
        
'skin.transparency'53,
        
'skin.xeebo'55,
    },

See here

Note: Since then there are much more skins available, if you take the time to get the IDs for the missing ones, I would be happy to get them too Wink

My GitHub. My Add-ons:
[Image: IOoywq0.jpg]
find quote
realtebo Offline
Senior Member
Posts: 164
Joined: Apr 2013
Reputation: 0
Post: #8
Of course, If I'll get one more, I'll send to you, I promise !
find quote
Roman_V_M Offline
Team-Kodi Member
Posts: 1,130
Joined: Jun 2011
Reputation: 55
Location: Kyiv, Ukraine
Post: #9
(2013-09-24 21:29)sphere Wrote:  Some time ago I walked through all available skins to find their "thumbnail likest" view id for xbmcswift inclusion.

Code:
'skin.aeon.nox': 551,

The info for Aeon-Nox is outdated. There is no 551 code now. The code for "Wall" view is 500 too, but it is not available for plugins - providing 500 does nothing (maybe setting content type explicitly will help, I don't know), so you can use Info-Wall instead (see my code above).

Raspberry PI 2 + LibreELEC 8 (Kodi 17)
Samsung Galaxy Tab A 10.1 + Kodi 17 for Android
(This post was last modified: 2013-09-25 11:31 by Roman_V_M.)
find quote
david14 Offline
Junior Member
Posts: 20
Joined: Aug 2014
Reputation: 0
Post: #10
could you guys tell me where should i place the code? should i place it after addDir( ....)?
find quote