Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
subhalaxmi
Level 7

Add a search bar on gridscreen

Hello guys,

I am new to roku app development. I need an urgent help.
I am working on an app. I just want to put a search bar on top of a grid screen. When user presses the up button of remote it will navigate to search bar . And when user click on that search bar it will navigate to searchscreen.

Guys help me. How can I achieve it Smiley Sad . I had put many questions on this. But no response.

If there's any sample code , it will be a great help.
0 Kudos
4 Replies
destruk
Level 10

Re: Add a search bar on gridscreen

What you could do here is manually insert an option/content metadata into your category, and then in the wait routine for input check a piece of that metadata for the selected item to redirect execution to the search screen.
You need a title for the item, a description for the item, and a thumbnail for the item.
Then for msg.isListItemSelected() check if it's that title, or thumbnail, or description to decide whether to play a video, show a search screen, or something else.
0 Kudos
subhalaxmi
Level 7

Re: Add a search bar on gridscreen

Hi destruk,

First of all thanks. Is there any sample code ? If yes please can you provide me .
0 Kudos
destruk
Level 10

Re: Add a search bar on gridscreen

Sample code?
To force in an option you would use a createitem() routine you already use for parsing or simply use the lines you need.


item=CreateObject("roAssociativeArray")
item.Title="Search"
item.SDPosterURL="http://serverurl.com/searchsd.jpg"
item.HDPosterURL="http://serverurl.com/searchhd.jpg"
categories.Push(item) 'add this manually specified item into current content list

screen.SetContentList(0,categories) 'set the content of category 0 for the top line



Then later in your msg.isListItemSelected() check you would look to see if the title is Search or not with --

If msg.isListItemSelected()
If msg.GetIndex()=0 'if row 0
If categories[msg.GetData()].Title="Search" then
displaysearch()
else
playvideo(categories[msg.GetData()])
end if
else
'standard code begins here
0 Kudos
subhalaxmi
Level 7

Re: Add a search bar on gridscreen

No Destruk,

Not like this. You want to say that I should implement an option in my gridscreen. No I don't want to do this. I want to give a look like youtube. Like youtube has a search bar on top.
0 Kudos