1

The new Roku scenegraph developer extensions seem pretty useful. I have two SGDEX views that are useful to me. However I need to combine them and I do not see any documentation on how to do it.

The Custom+Scene example is what I am working off of. Simply I would add to add the searchView feature to this script.

I have tried adding SearchView as a component. However the searchview example is it's own working page, I would like to add it as a node. I have tried adding it as an overhang, and also tried adding it as a button on the homepage. I have been unsuccessful with both.

Please see scenegraph developer extensions.

I simply need to add the SearchView feature to the Custom+Scene example in SGDEX. Please provide example of how to do this if you are familiar. Thanks.

MarlonC
  • 67
  • 6

1 Answers1

1

Updated

Looks like what we wanted to achieve is open the searchView from the mainscene of the custom+screen example.

I updated the feed.json file of the project and add a new object after the "series" object.

 ...
 ...
 "search": [
        {
            "id": "search",
            "title": "Search",
            "releaseDate": "2015-06-11",
            "shortDescription": "Will open search view.",
            "thumbnail": "http://level2creative.com/wp-content/uploads/2017/08/image-search-ss-1920-800x450.gif",
            "genres": [
                "search"
            ],
            "tags": [
                "search"
            ],
            "content": {
                "dateAdded": "2015-06-11T14:14:54.431Z",
                "captions": [],
                "videos": [
                    {
                        "url": "http://roku.content.video.llnw.net/smedia/59021fabe3b645968e382ac726cd6c7b/Gb/siCt-V7LOSU08W_Ve1ByJY5N9emKZeXZvnrH2Yb9c/117_segment_2_twitch__nw_060515.mp4",
                        "quality": "HD",
                        "videoType": "MP4"
                    }
                ],
                "duration": 53
            }
        }
    ]

On your GridHandler.brs, change the ParseJsonToNodeArray function, lets change the if condition of the line 27, so it will look like this:

if fieldInJsonAA = "movies" or fieldInJsonAA = "series" or fieldInJsonAA = "search"

Then, on your mainscene.brs, go to the method "OnGridItemSelected", change it for something like this:

rowContent = grid.content.GetChild(selectedIndex[0])
if rowContent.title = "search"
    searchView = CreateObject("roSGNode", "SearchView")
    searchView.hintText = "Search for something"
    m.top.ComponentController.CallFunc("show", {
        view: searchView
    })
else
    detailsView = ShowDetailsView(rowContent, selectedIndex[1])
    detailsView.ObserveField("wasClosed", "OnDetailsWasClosed")
end if

That should open the searchView and if you press back that should close the searchView and take the user back to the gridView.

Docs

  • Hey bro, Sry again same thing I know the Show function used for roSGScreen But in main.brs I call already now I created one file with wisepanel scene successfully then create another combine file extend with group and component is keyboarddialog. Now I'm stay Wisepanel then any key press to go keyboarddialog. I try to above thing But Gave a Error. How to call show function in init or any else in a file. – Nikunj Chaklasiya Aug 07 '19 at 07:46
  • Thanks for the reply. It appears in your example you have added Custom view as a Component and SearvhView as a main page. I need to do the opposite. The the custom+view and add SearchView as a component. I do not need them both on the same page at the same time. Just a link on the homepage that will take me to the SearchView. – MarlonC Aug 07 '19 at 18:16
  • @MarlonC Just updated the response. If I understood the question properly, you want to open the searchView from the gridView, if that's the case just follow the update section of my answer. – Roger Ramirez Aug 08 '19 at 00:25
  • Hi @NikunjChaklasiya, no problem, maybe you can open another question and give a little more context so I can help you, I would like to see what you've tried so far. – Roger Ramirez Aug 08 '19 at 00:31
  • Thanks Roger. Looks like that's what I need. Let me give it a try and see if I can get this to work. – MarlonC Aug 08 '19 at 03:07
  • Awesome! you're welcome, you probably don't want to compare against the rowcontent.title, but for testing purposes, it should work. @MarlonC – Roger Ramirez Aug 08 '19 at 04:29
  • @RogerRamirez I used 4 way as to mention in question. But I simply to say In the first screen display successfully I write a Logic in the main screen. the First Screen used Two file. PanelSet.brs and PanelSet.XML. here the component name is WisePanel. Now I write a Logic for a key event Function to open a new screen. I used second file name is keyboarddialog.XML. Here I used both code brs and xml only single file here component name is keyboarddialog and extends with Group. I write a Logic for a panelSet.brs file to keyevent but It error Give in ComponentController Line. – Nikunj Chaklasiya Aug 08 '19 at 04:46
  • Here the Logic I apply https://stackoverflow.com/questions/57374718/how-to-access-another-file-label-using-a-brightscript – Nikunj Chaklasiya Aug 08 '19 at 04:54
  • @RogerRamirez it is coming along nicely. Question. Is there a way to order the Category? As of right now, it automatically puts the Search on Top. – MarlonC Aug 09 '19 at 21:44