Issue w/ <selected> tag and Window.IsActive(Videos,Root)
#1
Hey guys,

In the skin I've been editing, I've created a navigation drawer (similar to what you seen on android apps). It consists of a list of links to different windows. I used to have a list control for the list items in the menu. But I wanted the button to have some sort of texture change to show which window the user was currently in. For example, if the user tapped the list item "Movies," then it would activate the (Videos,MovieTitles) window. If the user, opened the navigation drawer again, then the list item Movies icon would have a different color than the rest of the items. To make this happen, I changed to a grouplist of radiobuttons so that I could make use of the radiobutton control's <selected> tag to achieve this.

Currently, I'm having two problems

1) When, the active window is "MovieTitles," the button to activate the window (Videos, Root) does not work. Which seems weird since it works when these buttons / links were in a list container. I kind of solved this by using Container.Update instead of ActivateWindow. If there's no other solution, then I can make that work.

2) I can't get the <selected> tag to work the way I was hoping to with respect to the windows "Videos," "MovieTitles," and "TVShows. I can't find a condition that applies to only one of the windows and not to all of them. In other words, when the "Movies" item is selected from the list, the MovieTitles window is activated (as expected). When the user goes to open the navigation drawer again, instead of just the "Movies" list item having the color attribute defined in its <selected> tag, the "Videos" and "TVShows" have that attribute as well.

Here's a link for the code. The commented out lines show some things I've tried without any success.

Pastebin Link

Sorry if this is a dumb question. I searched the wiki and forums, but I couldn't really think of the correct terminology to search for. Thank you in advance for any help you can throw my way!
Reply
#2
2. "MovieTitles," and "TVShows" are no windows. they're subsections of the videos window.
so Window.IsActive(Videos) will work, but Window.IsActive(Videos,MovieTitles) makes no sense.

you could probably use Container.Content(movies) instead or do a substring comparison on Container.FolderPath
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
#3
Oh! lol okay thanks Ronie, that makes sense. And now I can see that that's pretty much what these wiki articles explain as well: Window IDs and Opening Windows and Dialogs. It just didn't click until I read your explanation haha. Sorry about that.

I'll give your suggestions a try and report back. Thanks again

Update:

I used a combination of your suggestions (both Container.Content and Substring), and it works as expected now. Thank you again for taking the time out.

I have another question about radiobuttons. When its selected, I was hoping there would be someway to have the label's text color change too i.e. something like a <selectedtextcolor> tag. I realize now that there is no direct way of doing this (to my limited knowledge lol). Could anybody suggest a workaround or maybe an alternate control to use that could accomplish this?

To hopefully make it more clear what I'm trying accomplish, here's an image of an example Navigation Drawer showing it. As you can see, the image AND the text are both colored. Right now, I only have the image colored, which just looks weird.

Image in Google Drive

(p.s. if it would be better if I posted this as a new issue, then I can. I just didn't wanna pollute this forum with a bunch of noob questions and annoy people.)
Reply
#4
Sorry to bother again, but I tried Ronie's suggestion and thought I had it figured it out. But I don't think I executed it right. After I was basically done with the skin and checking the log for any errors, I got one with one for the conditions I used.

Error on the Log: "Error parsing boolean expression Window.IsActive(Videos) + !SubString($INFO[Container.FolderPath],Title)"

The original code:

PHP Code:
<control type="radiobutton" id="1">
        <include>
NavDrawerItemCommons</include>
        <
label>$LOCALIZE[3]</label>
        <
onclick condition="StringCompare(Window(Home).Property(VideosDirectLink),True)">ActivateWindow(Videos)</onclick>
        <
onclick condition="!StringCompare(Window(Home).Property(VideosDirectLink),True)">ActivateWindow(Videos,root)</onclick>
        <
onclick>ClearProperty(VideosDirectLink,Home)</onclick>
        <
selected>Window.IsActive(Videos) + !SubString($INFO[Container.FolderPath],Title)</selected>                    
        <
textureradioonfocus colordiffuse="500Color">icon-videos.png</textureradioonfocus>
        <
textureradioonnofocus colordiffuse="500Color">icon-videos.png</textureradioonnofocus>
        <
textureradioofffocus colordiffuse="500Color">icon-videos.png</textureradioofffocus>
        <
textureradiooffnofocus colordiffuse="Black54%">icon-videos.png</textureradiooffnofocus>        
        <
visible>!Skin.HasSetting(HideHomeButtonVideo)</visible>
    </
control
Reply
#5
Remove $INFO[ ] as it's already expecting an info label.

Code:
Window.IsActive(Videos) + !SubString(Container.FolderPath,Title)
Reply
#6
Ooohh. Yeah, that makes sense. Thanks Hitcher for ALL of your help
Reply

Logout Mark Read Team Forum Stats Members Help
Issue w/ <selected> tag and Window.IsActive(Videos,Root)0