diff --git a/.gitignore b/.gitignore
index fa001aa..f86df33 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
out/
out/roku-deploy.zip
+.history/
+.vscode/
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008141935.xml b/.history/components/rowListScene_20211008141935.xml
new file mode 100644
index 0000000..011510e
--- /dev/null
+++ b/.history/components/rowListScene_20211008141935.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008142233.xml b/.history/components/rowListScene_20211008142233.xml
new file mode 100644
index 0000000..786e1f5
--- /dev/null
+++ b/.history/components/rowListScene_20211008142233.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008142249.xml b/.history/components/rowListScene_20211008142249.xml
new file mode 100644
index 0000000..8ae54ea
--- /dev/null
+++ b/.history/components/rowListScene_20211008142249.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008142332.xml b/.history/components/rowListScene_20211008142332.xml
new file mode 100644
index 0000000..5e79952
--- /dev/null
+++ b/.history/components/rowListScene_20211008142332.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008142828.xml b/.history/components/rowListScene_20211008142828.xml
new file mode 100644
index 0000000..79f9e44
--- /dev/null
+++ b/.history/components/rowListScene_20211008142828.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008142829.xml b/.history/components/rowListScene_20211008142829.xml
new file mode 100644
index 0000000..9df7cf4
--- /dev/null
+++ b/.history/components/rowListScene_20211008142829.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/rowListContent.brs b/components/rowListContent.brs
index a37fbf2..18ff5c6 100644
--- a/components/rowListContent.brs
+++ b/components/rowListContent.brs
@@ -2,10 +2,17 @@ sub init()
m.global.http.request = { payload: {
userId: 1,
title: "WOW, IT WORKED ^_^",
- }, url: "https://jsonplaceholder.typicode.com/albums", requestType: "GET"}
+ }, url: "https://alghool.net/RokuDev/data.json", requestType: "GET" }
m.global.http.observeFieldScoped("response", "useResponse")
end sub
sub useResponse()
- ?m.global.http.response
-end sub
+ itemNode = m.top.createChild("ContentNode")
+ itemNode.title = m.global.http.response.body[0].TITLE
+ for each itemData in m.global.http.response.body[0].data
+ itemDetails = itemNode.createChild("ContentNode")
+ itemDetails.title = itemData.title
+ itemDetails.HDPosterUrl = itemData.thumbnail
+ itemDetails.description = itemData.longDescription
+ end for
+end sub
\ No newline at end of file
diff --git a/components/rowListScene.brs b/components/rowListScene.brs
index 22d7821..ea2131b 100644
--- a/components/rowListScene.brs
+++ b/components/rowListScene.brs
@@ -4,9 +4,15 @@ sub init()
m.global.http = createObject("roSGNode", "httpTask")
m.global.http.control = "RUN"
m.global.ratio = 1
- m.rowList = m.top.findNode("mainRowList")
- m.rowList.content = createObject("roSGNode", "RowListContent")
- m.rowList.setFocus(true)
+ m.rows = m.top.getChild(1).getChildren(6, 0)
+ m.parent = m.top.findNode("rowListParty")
+ m.scrollAnimation = m.top.findNode("scroll")
+ for each row in m.rows
+ row.content = createObject("roSGNode", "RowListContent")
+ end for
+ m.rowFocused = 0
+ m.canScroll = true
+ m.rows[0].setFocus(true)
videoMode = createObject("roDeviceInfo")
if videoMode.GetVideoMode() = "720p"
m.global.ratio = 0.66
@@ -21,3 +27,53 @@ sub init()
m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
end if
end sub
+
+sub animateUp()
+ m.scrollAnimation.getChild(0).keyValue = [[0, m.parent.translation[1]], [0, m.parent.translation[1] + 300]]
+ m.scrollAnimation.control = "start"
+end sub
+
+sub animateDown()
+ m.scrollAnimation.getChild(0).keyValue = [[0, m.parent.translation[1]], [0, m.parent.translation[1] - 300]]
+ m.scrollAnimation.control = "start"
+end sub
+
+sub animateScroll(direction as String)
+ if (direction = "down" and m.rowFocused = 3)
+ m.parent.getChild(m.rowFocused + 1).setFocus(true)
+ m.rowFocused++
+ else if (direction = "up" and m.rowFocused = 4)
+ m.parent.getChild(m.rowFocused - 1).setFocus(true)
+ m.rowFocused--
+ else if (direction = "down" and m.rowFocused > 4) or (m.rowFocused = 0 and direction = "up")
+ return
+ else if direction = "down" and m.scrollAnimation.state = "stopped" and m.rowFocused < 3 and m.canScroll = true
+ m.rowFocused++
+ animateDown()
+ m.parent.getChild(m.rowFocused).setFocus(true)
+ else if direction = "up" and m.rowFocused >= 4 or m.rowFocused <= 1 and m.scrollAnimation.state = "stopped"
+ animateUp()
+ m.parent.getChild(m.rowFocused - 1).setFocus(true)
+ m.rowFocused--
+ else if direction = "up" and m.rowFocused = 4
+ m.parent.getChild(m.rowFocused).setFocus(true)
+ else if direction = "up" and m.scrollAnimation.state = "stopped" and m.rowFocused >= 0
+ m.rowFocused--
+ m.parent.getChild(m.rowFocused).setFocus(true)
+ animateUp()
+ end if
+ if m.rowFocused >= 4
+ m.canScroll = false
+ else
+ m.canScroll = true
+ end if
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press
+ if key = "up" or key = "down"
+ animateScroll(key)
+ return true
+ end if
+ end if
+end function
\ No newline at end of file
diff --git a/components/rowListScene.xml b/components/rowListScene.xml
index bc7e6b9..9df7cf4 100644
--- a/components/rowListScene.xml
+++ b/components/rowListScene.xml
@@ -2,6 +2,16 @@
-
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file