Kodi Community Forum

Full Version: viewtype property explained
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Could someone explain what is the exact effect of the "viewtype" tag inside a container. The skinning manual says:
Quote:The type of view. Choices are list, icon, wide, wrap, biglist, bigicon, bigwide, bigwrap, info and biginfo.

But I cannot find a description of each type and the effect it is supposed to have on the control. When I change this tag inside an existing skin (for example replacing "list" with "icon"), it doesn't seem to have any impact on the displayed view.

Thank you in advance,
Pierre
I'm not even sure they do anything actually.
They actually do something, but not sure what Smile Perhaps used somehow for setting viewtype priority? This is from core code:
Code:
if (type == "list")
      viewType = VIEW_TYPE_LIST;
    else if (type == "icon")
      viewType = VIEW_TYPE_ICON;
    else if (type == "biglist")
      viewType = VIEW_TYPE_BIG_LIST;
    else if (type == "bigicon")
      viewType = VIEW_TYPE_BIG_ICON;
    else if (type == "wide")
      viewType = VIEW_TYPE_WIDE;
    else if (type == "bigwide")
      viewType = VIEW_TYPE_BIG_WIDE;
    else if (type == "wrap")
      viewType = VIEW_TYPE_WRAP;
    else if (type == "bigwrap")
      viewType = VIEW_TYPE_BIG_WRAP;
    else if (type == "info")
      viewType = VIEW_TYPE_INFO;
    else if (type == "biginfo")
      viewType = VIEW_TYPE_BIG_INFO;
and
Code:
// first find a view that matches this view, if possible...
  int newView = GetView(type, id);
  if (newView < 0) // no suitable view that matches both id and type, so try just type
    newView = GetView(type, 0);
  if (newView < 0 && type == VIEW_TYPE_BIG_ICON) // try icon view if they want big icon
    newView = GetView(VIEW_TYPE_ICON, 0);
  if (newView < 0 && type == VIEW_TYPE_BIG_INFO)
    newView = GetView(VIEW_TYPE_INFO, 0);
  if (newView < 0) // try a list view
    newView = GetView(VIEW_TYPE_LIST, 0);
  if (newView < 0) // try anything!
    newView = GetView(VIEW_TYPE_NONE, 0);
as far as i understood the logic is used when you switch from one skin to another.
let's say you were using an 'icon' viewtype in the movie library in skin A.
then when you switch to skin B, kodi tries to find a similar viewtype for the movie library there.

that's what i make of it at least. the only info i ever read about it is here:
321265 (post)
That makes sense. I just figured they did nothing and were a left over. Shame I set them all to "List" then.... Tongue
Thanks for the replies, it makes sense to try to select a view with a similar layout when switching from one skin to another.

But this relies a lot on skinners to use this property accurately, I guess it would help to document this more explicitly.
(2015-04-02, 23:27)pbureau Wrote: [ -> ]Thanks for the replies, it makes sense to try to select a view with a similar layout when switching from one skin to another.

But this relies a lot on skinners to use this property accurately, I guess it would help to document this more explicitly.

Feel free to help documenting. That's why we use a wiki.
(2015-04-03, 05:14)phil65 Wrote: [ -> ]
(2015-04-02, 23:27)pbureau Wrote: [ -> ]Thanks for the replies, it makes sense to try to select a view with a similar layout when switching from one skin to another.

But this relies a lot on skinners to use this property accurately, I guess it would help to document this more explicitly.

Feel free to help documenting. That's why we use a wiki.

Will do, I just requested an account to edit the wiki.

Pierre