From 60cb640e8e8213386194167ce712857e57d4a7b7 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Wed, 22 Sep 2021 14:20:47 +0200
Subject: [PATCH 01/17] Made the interface to exchange information from item to
hero
---
components/rowListContent.brs | 19 +++++++++---
components/rowListItem.brs | 10 +++++++
components/rowListScene.brs | 14 +++++++++
components/rowListScene.xml | 55 ++++++++++++++++++++++++++++++++++-
4 files changed, 93 insertions(+), 5 deletions(-)
diff --git a/components/rowListContent.brs b/components/rowListContent.brs
index a37fbf2..2645a4d 100644
--- a/components/rowListContent.brs
+++ b/components/rowListContent.brs
@@ -2,10 +2,21 @@ sub init()
m.global.http.request = { payload: {
userId: 1,
title: "WOW, IT WORKED ^_^",
- }, url: "https://jsonplaceholder.typicode.com/albums", requestType: "GET"}
- m.global.http.observeFieldScoped("response", "useResponse")
+ }, url: "https://alghool.net/RokuDev/data.json", requestType: "GET"}
+ m.global.http.observeFieldScoped("response", "populateRowList")
end sub
-sub useResponse()
- ?m.global.http.response
+sub populateRowList()
+ items = m.global.http.response.body
+ for each item in items
+ itemNode = m.top.createChild("ContentNode")
+ itemNode.title = item.title
+ for each data in item.data
+ itemData = itemNode.createChild("ContentNode")
+ itemData.title = data.title
+ itemData.HDPosterUrl = data.thumbnail
+ itemData.description = data.longDescription
+ end for
+ m.top.appendChild(itemNode)
+ end for
end sub
diff --git a/components/rowListItem.brs b/components/rowListItem.brs
index 227b724..7713bf8 100644
--- a/components/rowListItem.brs
+++ b/components/rowListItem.brs
@@ -3,6 +3,7 @@ sub init()
m.itemTitle = m.top.findNode("itemTitle")
m.itemMask = m.top.findNode("itemMask")
m.itemDescription = m.top.findNode("itemDescription")
+ m.parentComponent = m.top.findNode("rowListScene")
end sub
sub showContent()
@@ -26,6 +27,15 @@ end sub
sub handleFocus()
scale = 1 + (m.top.focusPercent * 0.15)
m.itemPoster.scale = [scale, scale]
+ if m.top.focusPercent = 1
+ m.global.mainScreen.backgroundURI = m.itemPoster.uri
+ m.global.mainScreen.HeroDetails = {
+ MainBoldLabel:m.itemTitle.text
+ DateAndDurationLabel:"21 Sep 21 | 3m"
+ DescriptionLabel:m.itemDescription.text
+ CategoryLabel:"World"
+ }
+ end if
end sub
sub handleRowFocus()
diff --git a/components/rowListScene.brs b/components/rowListScene.brs
index 22d7821..3326d9b 100644
--- a/components/rowListScene.brs
+++ b/components/rowListScene.brs
@@ -1,12 +1,19 @@
sub init()
m.global.addField("http", "node", FALSE)
m.global.addField("ratio", "float", FALSE)
+ m.global.addField("mainScreen", "node", FALSE)
+ m.global.mainScreen = m.top
m.global.http = createObject("roSGNode", "httpTask")
m.global.http.control = "RUN"
m.global.ratio = 1
m.rowList = m.top.findNode("mainRowList")
+ m.MainBoldLabel = m.top.findNode("MainBoldLabel")
+ m.DateAndDurationLabel = m.top.findNode("DateAndDurationLabel")
+ m.DescriptionLabel = m.top.findNode("DescriptionLabel")
+ m.CategoryLabel = m.top.findNode("CategoryLabel")
m.rowList.content = createObject("roSGNode", "RowListContent")
m.rowList.setFocus(true)
+ m.top.observeField("HeroDetails","handleHeroDetails")
videoMode = createObject("roDeviceInfo")
if videoMode.GetVideoMode() = "720p"
m.global.ratio = 0.66
@@ -21,3 +28,10 @@ sub init()
m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
end if
end sub
+
+sub handleHeroDetails()
+ m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
+ m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
+ m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
+ m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
+end sub
\ No newline at end of file
diff --git a/components/rowListScene.xml b/components/rowListScene.xml
index bc7e6b9..f3ff697 100644
--- a/components/rowListScene.xml
+++ b/components/rowListScene.xml
@@ -1,7 +1,60 @@
+
+
+
-
+
+
+
+
+
+
+
+
\ No newline at end of file
From fb2afc807ad4c235acd60ee9bbccd662b0961ae6 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Wed, 22 Sep 2021 17:02:23 +0200
Subject: [PATCH 02/17] removed .vscode folder
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index fa001aa..b74381e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
out/
out/roku-deploy.zip
+.vscode/
\ No newline at end of file
From 8e4e16741dd59f7fccd5fee05889403d5f24a81e Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Wed, 22 Sep 2021 17:02:31 +0200
Subject: [PATCH 03/17] removed .vscode folder
---
.vscode/launch.json | 19 -------------------
1 file changed, 19 deletions(-)
delete mode 100644 .vscode/launch.json
diff --git a/.vscode/launch.json b/.vscode/launch.json
deleted file mode 100644
index dca2ab3..0000000
--- a/.vscode/launch.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- // Use IntelliSense to learn about possible attributes.
- // Hover to view descriptions of existing attributes.
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
- "version": "0.2.0",
- "configurations": [
- {
- "type": "brightscript",
- "request": "launch",
- "name": "BrightScript Debug: Launch",
- "stopOnEntry": false,
- "host": "${promptForHost}",
- "password": "mega",
- "rootDir": "${workspaceFolder}",
- "enableDebuggerAutoRecovery": false,
- "stopDebuggerOnAppExit": false
- }
- ]
-}
\ No newline at end of file
From 968d8a362db7fd07f452fa0c328cc89d65d24b55 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Thu, 23 Sep 2021 09:17:01 +0200
Subject: [PATCH 04/17] Added basic animations in the design provided by Mr.
Hossam
---
components/rowListScene.brs | 3 ++
components/rowListScene.xml | 88 +++++++++++++++++++++++--------------
2 files changed, 59 insertions(+), 32 deletions(-)
diff --git a/components/rowListScene.brs b/components/rowListScene.brs
index 3326d9b..090c436 100644
--- a/components/rowListScene.brs
+++ b/components/rowListScene.brs
@@ -11,6 +11,8 @@ sub init()
m.DateAndDurationLabel = m.top.findNode("DateAndDurationLabel")
m.DescriptionLabel = m.top.findNode("DescriptionLabel")
m.CategoryLabel = m.top.findNode("CategoryLabel")
+ m.textAnimation = m.top.findNode("heroDetailsAnimation")
+ ' m.overlayAnimation = m.top.findNode("mainOverlayAnimation")
m.rowList.content = createObject("roSGNode", "RowListContent")
m.rowList.setFocus(true)
m.top.observeField("HeroDetails","handleHeroDetails")
@@ -34,4 +36,5 @@ sub handleHeroDetails()
m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
+ m.textAnimation.control = "start"
end sub
\ No newline at end of file
diff --git a/components/rowListScene.xml b/components/rowListScene.xml
index f3ff697..6537c27 100644
--- a/components/rowListScene.xml
+++ b/components/rowListScene.xml
@@ -5,40 +5,64 @@
+
+
-
-
-
-
-
+ id="heroDetailsId"
+ translation = "[50,0]"
+ opacity="0.0" >
+
+
+
+
+
+
+
+
+
+
Date: Thu, 23 Sep 2021 11:45:26 +0200
Subject: [PATCH 05/17] replaced the global node with getScene()
---
components/rowListContent.brs | 11 ++---
components/rowListItem.brs | 16 +++----
components/rowListScene.brs | 11 +++--
components/rowListScene.xml | 85 +++++------------------------------
4 files changed, 31 insertions(+), 92 deletions(-)
diff --git a/components/rowListContent.brs b/components/rowListContent.brs
index 2645a4d..4111713 100644
--- a/components/rowListContent.brs
+++ b/components/rowListContent.brs
@@ -7,15 +7,16 @@ sub init()
end sub
sub populateRowList()
- items = m.global.http.response.body
- for each item in items
+ for each item in m.global.http.response.body
itemNode = m.top.createChild("ContentNode")
itemNode.title = item.title
for each data in item.data
itemData = itemNode.createChild("ContentNode")
- itemData.title = data.title
- itemData.HDPosterUrl = data.thumbnail
- itemData.description = data.longDescription
+ itemData.setFields({
+ title: data.title
+ HDPosterURL: data.thumbnail
+ description: data.longDescription
+ })
end for
m.top.appendChild(itemNode)
end for
diff --git a/components/rowListItem.brs b/components/rowListItem.brs
index 7713bf8..3fc140d 100644
--- a/components/rowListItem.brs
+++ b/components/rowListItem.brs
@@ -3,7 +3,7 @@ sub init()
m.itemTitle = m.top.findNode("itemTitle")
m.itemMask = m.top.findNode("itemMask")
m.itemDescription = m.top.findNode("itemDescription")
- m.parentComponent = m.top.findNode("rowListScene")
+ m.parentComponent = m.top.getScene()
end sub
sub showContent()
@@ -28,13 +28,13 @@ sub handleFocus()
scale = 1 + (m.top.focusPercent * 0.15)
m.itemPoster.scale = [scale, scale]
if m.top.focusPercent = 1
- m.global.mainScreen.backgroundURI = m.itemPoster.uri
- m.global.mainScreen.HeroDetails = {
- MainBoldLabel:m.itemTitle.text
- DateAndDurationLabel:"21 Sep 21 | 3m"
- DescriptionLabel:m.itemDescription.text
- CategoryLabel:"World"
- }
+ m.parentComponent.backgroundURI = m.itemPoster.uri
+ m.parentComponent.HeroDetails = {
+ MainBoldLabel: m.itemTitle.text
+ DateAndDurationLabel: "21 Sep 21 | 3m"
+ DescriptionLabel: m.itemDescription.text
+ CategoryLabel: "World"
+ }
end if
end sub
diff --git a/components/rowListScene.brs b/components/rowListScene.brs
index 090c436..2c7e3b5 100644
--- a/components/rowListScene.brs
+++ b/components/rowListScene.brs
@@ -1,8 +1,6 @@
sub init()
m.global.addField("http", "node", FALSE)
m.global.addField("ratio", "float", FALSE)
- m.global.addField("mainScreen", "node", FALSE)
- m.global.mainScreen = m.top
m.global.http = createObject("roSGNode", "httpTask")
m.global.http.control = "RUN"
m.global.ratio = 1
@@ -11,11 +9,12 @@ sub init()
m.DateAndDurationLabel = m.top.findNode("DateAndDurationLabel")
m.DescriptionLabel = m.top.findNode("DescriptionLabel")
m.CategoryLabel = m.top.findNode("CategoryLabel")
- m.textAnimation = m.top.findNode("heroDetailsAnimation")
- ' m.overlayAnimation = m.top.findNode("mainOverlayAnimation")
+ m.fadeInAnimation = m.top.findNode("fadeInAnimation")
+ m.overlayAnimation = m.top.findNode("mainOverlayAnimation")
m.rowList.content = createObject("roSGNode", "RowListContent")
m.rowList.setFocus(true)
- m.top.observeField("HeroDetails","handleHeroDetails")
+ m.rowList.findNode("RowListItem")
+ m.top.observeField("HeroDetails", "handleHeroDetails")
videoMode = createObject("roDeviceInfo")
if videoMode.GetVideoMode() = "720p"
m.global.ratio = 0.66
@@ -36,5 +35,5 @@ sub handleHeroDetails()
m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
- m.textAnimation.control = "start"
+ m.fadeInAnimation.control = "start"
end sub
\ No newline at end of file
diff --git a/components/rowListScene.xml b/components/rowListScene.xml
index 6537c27..0db143e 100644
--- a/components/rowListScene.xml
+++ b/components/rowListScene.xml
@@ -5,80 +5,19 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
+
\ No newline at end of file
From 5ff064b4dd0076358dfed05e91ca001518cb8119 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Fri, 24 Sep 2021 14:07:54 +0200
Subject: [PATCH 06/17] Mr. Mostafa Changed applied
---
components/rowListContent.brs | 10 ++++++----
components/rowListItem.brs | 1 +
components/rowListScene.brs | 29 ++++++++++++++++++++++++-----
components/rowListScene.xml | 6 +++++-
4 files changed, 36 insertions(+), 10 deletions(-)
diff --git a/components/rowListContent.brs b/components/rowListContent.brs
index 4111713..b2109bc 100644
--- a/components/rowListContent.brs
+++ b/components/rowListContent.brs
@@ -1,13 +1,15 @@
sub init()
- m.global.http.request = { payload: {
+ m.http = createObject("roSGNode", "httpTask")
+ m.http.request = { payload: {
userId: 1,
title: "WOW, IT WORKED ^_^",
- }, url: "https://alghool.net/RokuDev/data.json", requestType: "GET"}
- m.global.http.observeFieldScoped("response", "populateRowList")
+ }, url: "https://alghool.net/RokuDev/data.json", requestType: "GET" }
+ m.http.control = "RUN"
+ m.http.observeFieldScoped("response", "populateRowList")
end sub
sub populateRowList()
- for each item in m.global.http.response.body
+ for each item in m.http.response.body
itemNode = m.top.createChild("ContentNode")
itemNode.title = item.title
for each data in item.data
diff --git a/components/rowListItem.brs b/components/rowListItem.brs
index 3fc140d..d69ae6b 100644
--- a/components/rowListItem.brs
+++ b/components/rowListItem.brs
@@ -34,6 +34,7 @@ sub handleFocus()
DateAndDurationLabel: "21 Sep 21 | 3m"
DescriptionLabel: m.itemDescription.text
CategoryLabel: "World"
+ focus: m.itemPoster.uri
}
end if
end sub
diff --git a/components/rowListScene.brs b/components/rowListScene.brs
index 2c7e3b5..ed46ec3 100644
--- a/components/rowListScene.brs
+++ b/components/rowListScene.brs
@@ -1,20 +1,20 @@
sub init()
- m.global.addField("http", "node", FALSE)
m.global.addField("ratio", "float", FALSE)
- m.global.http = createObject("roSGNode", "httpTask")
- m.global.http.control = "RUN"
+ m.flag = true
m.global.ratio = 1
m.rowList = m.top.findNode("mainRowList")
+ m.currFocus = invalid
m.MainBoldLabel = m.top.findNode("MainBoldLabel")
m.DateAndDurationLabel = m.top.findNode("DateAndDurationLabel")
m.DescriptionLabel = m.top.findNode("DescriptionLabel")
m.CategoryLabel = m.top.findNode("CategoryLabel")
m.fadeInAnimation = m.top.findNode("fadeInAnimation")
- m.overlayAnimation = m.top.findNode("mainOverlayAnimation")
+ m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
m.rowList.content = createObject("roSGNode", "RowListContent")
m.rowList.setFocus(true)
m.rowList.findNode("RowListItem")
m.top.observeField("HeroDetails", "handleHeroDetails")
+ m.fadeOutAnimation.observeField("state", "handleAnimationDone")
videoMode = createObject("roDeviceInfo")
if videoMode.GetVideoMode() = "720p"
m.global.ratio = 0.66
@@ -31,9 +31,28 @@ sub init()
end sub
sub handleHeroDetails()
+ if m.flag
+ m.flag = false
+ handleUpdate()
+ else
+ handleItemFocusChange()
+ end if
+end sub
+
+sub handleAnimationDone()
+ if m.fadeOutAnimation.state = "stopped"
+ handleUpdate()
+ m.fadeInAnimation.control = "start"
+ end if
+end sub
+
+sub handleItemFocusChange()
+ m.fadeOutAnimation.control = "start"
+end sub
+
+sub handleUpdate()
m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
- m.fadeInAnimation.control = "start"
end sub
\ No newline at end of file
diff --git a/components/rowListScene.xml b/components/rowListScene.xml
index 0db143e..15be50a 100644
--- a/components/rowListScene.xml
+++ b/components/rowListScene.xml
@@ -13,9 +13,13 @@
-
+
+
+
+
+
From d44b76a83759f4cd9a84a0dfe504a96aa22b387e Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Sun, 26 Sep 2021 15:16:59 +0200
Subject: [PATCH 07/17] made the layout group for details
---
components/itemDetailsScene.xml | 15 +++++++++++++++
components/itemDetailsScreen.brs | 13 +++++++++++++
components/rowListScene.brs | 17 +++++++++++++++++
3 files changed, 45 insertions(+)
create mode 100644 components/itemDetailsScene.xml
create mode 100644 components/itemDetailsScreen.brs
diff --git a/components/itemDetailsScene.xml b/components/itemDetailsScene.xml
new file mode 100644
index 0000000..03c138a
--- /dev/null
+++ b/components/itemDetailsScene.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/itemDetailsScreen.brs b/components/itemDetailsScreen.brs
new file mode 100644
index 0000000..668069e
--- /dev/null
+++ b/components/itemDetailsScreen.brs
@@ -0,0 +1,13 @@
+sub init()
+ m.itemTitle = m.top.findNode("itemTitle")
+ m.watchButton = m.top.findNode("watchButton")
+ m.itemDescription = m.top.findNode("itemDescription")
+ m.itemTags = m.top.findNode("itemTags")
+ m.top.ObserveField("content", "handleItemDetails")
+end sub
+
+sub handleItemDetails()
+ m.itemTitle.text = m.top.content.TITLE
+ m.itemDescription.text = m.top.content.DESCRIPTION
+ m.watchButton.setFocus(true)
+end sub
\ No newline at end of file
diff --git a/components/rowListScene.brs b/components/rowListScene.brs
index ed46ec3..8bec9fc 100644
--- a/components/rowListScene.brs
+++ b/components/rowListScene.brs
@@ -14,6 +14,7 @@ sub init()
m.rowList.setFocus(true)
m.rowList.findNode("RowListItem")
m.top.observeField("HeroDetails", "handleHeroDetails")
+ m.rowList.observeField("rowItemSelected", "handleItemSelected")
m.fadeOutAnimation.observeField("state", "handleAnimationDone")
videoMode = createObject("roDeviceInfo")
if videoMode.GetVideoMode() = "720p"
@@ -55,4 +56,20 @@ sub handleUpdate()
m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
+end sub
+
+sub handleItemSelected()
+ itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
+ itemDetailsContentNode = createObject("roSGNode", "ContentNode")
+ itemDetailsContentNode = itemDetailsNode
+ itemDetailsScreen = createObject("roSGNode", "itemDetailsScreen")
+ itemDetailsScreen.content = itemDetailsContentNode
+ m.top.appendChild(itemDetailsScreen)
+ m.rowList.visible = false
+ m.MainBoldLabel.visible = false
+ m.CategoryLabel.visible = false
+ m.DescriptionLabel.visible = false
+ m.DateAndDurationLabel.visible = false
+ itemDetailsScreen.visible = true
+ itemDetailsScreen.setFocus(true)
end sub
\ No newline at end of file
From 6cbdad204895cfa700b0f6dc40857c777ea54c6c Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Sun, 26 Sep 2021 15:22:34 +0200
Subject: [PATCH 08/17] handled back button
---
components/rowListScene.brs | 31 +++++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)
diff --git a/components/rowListScene.brs b/components/rowListScene.brs
index 8bec9fc..1e4f209 100644
--- a/components/rowListScene.brs
+++ b/components/rowListScene.brs
@@ -62,14 +62,33 @@ sub handleItemSelected()
itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
itemDetailsContentNode = createObject("roSGNode", "ContentNode")
itemDetailsContentNode = itemDetailsNode
- itemDetailsScreen = createObject("roSGNode", "itemDetailsScreen")
- itemDetailsScreen.content = itemDetailsContentNode
- m.top.appendChild(itemDetailsScreen)
+ m.itemDetailsScreen = createObject("roSGNode", "itemDetailsScreen")
+ m.itemDetailsScreen.content = itemDetailsContentNode
+ m.top.appendChild(m.itemDetailsScreen)
m.rowList.visible = false
m.MainBoldLabel.visible = false
m.CategoryLabel.visible = false
m.DescriptionLabel.visible = false
m.DateAndDurationLabel.visible = false
- itemDetailsScreen.visible = true
- itemDetailsScreen.setFocus(true)
-end sub
\ No newline at end of file
+ m.itemDetailsScreen.visible = true
+ m.itemDetailsScreen.setFocus(true)
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ handled = false
+ if press
+ if key = "back" and m.itemDetailsScreen.visible = true
+ m.MainBoldLabel.visible = true
+ m.CategoryLabel.visible = true
+ m.DescriptionLabel.visible = true
+ m.DateAndDurationLabel.visible = true
+ m.rowList.visible = true
+ m.rowList.setFocus(true)
+ m.itemDetailsScreen.visible = false
+ handled = true
+ else
+ handled = false
+ end if
+ end if
+ return handled
+end function
\ No newline at end of file
From a68d57350368775b6715282e8a94201da47befad Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Sun, 26 Sep 2021 16:30:54 +0200
Subject: [PATCH 09/17] added tags
---
components/data.json | 36 ++++++++++++++++++++-----------
components/itemDetailsScene.xml | 2 +-
components/itemDetailsScreen.brs | 12 +++++++++++
components/rowItemDataContent.xml | 10 +++++++++
components/rowListContent.brs | 3 ++-
components/rowListScene.brs | 4 +---
6 files changed, 50 insertions(+), 17 deletions(-)
create mode 100644 components/rowItemDataContent.xml
diff --git a/components/data.json b/components/data.json
index c09d8bd..bd47501 100644
--- a/components/data.json
+++ b/components/data.json
@@ -17,7 +17,8 @@
"thumbnail": "https://dummyimage.com/320x180/000/fff",
"brandedThumbnail": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
"shortDescription": "A live description",
- "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing."
+ "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
+ "tags": ["linear", "news", "celebrity"]
},
{
"id": "1509428502953",
@@ -25,7 +26,8 @@
"thumbnail": "https://dummyimage.com/320x180/000/fff",
"brandedThumbnail": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
"shortDescription": "A live description",
- "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing."
+ "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
+ "tags": ["linear", "news", "celebrity"]
},
{
"id": "1509428502953",
@@ -65,7 +67,8 @@
"thumbnail": "https://dummyimage.com/320x180/000/fff",
"brandedThumbnail": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
"shortDescription": "A live description",
- "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing."
+ "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
+ "tags": ["linear", "news", "celebrity"]
},
{
"id": "1509428502953",
@@ -73,7 +76,8 @@
"thumbnail": "https://dummyimage.com/320x180/000/fff",
"brandedThumbnail": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
"shortDescription": "A live description",
- "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing."
+ "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
+ "tags": ["linear", "news", "celebrity"]
},
{
"id": "1509428502953",
@@ -113,7 +117,8 @@
"thumbnail": "https://dummyimage.com/320x180/000/fff",
"brandedThumbnail": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
"shortDescription": "A live description",
- "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing."
+ "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
+ "tags": ["linear", "news", "celebrity"]
},
{
"id": "1509428502953",
@@ -121,7 +126,8 @@
"thumbnail": "https://dummyimage.com/320x180/000/fff",
"brandedThumbnail": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
"shortDescription": "A live description",
- "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing."
+ "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
+ "tags": ["linear", "news", "celebrity"]
},
{
"id": "1509428502953",
@@ -161,7 +167,8 @@
"thumbnail": "https://dummyimage.com/320x180/000/fff",
"brandedThumbnail": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
"shortDescription": "A live description",
- "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing."
+ "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
+ "tags": ["linear", "news", "celebrity"]
},
{
"id": "1509428502953",
@@ -169,7 +176,8 @@
"thumbnail": "https://dummyimage.com/320x180/000/fff",
"brandedThumbnail": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
"shortDescription": "A live description",
- "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing."
+ "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
+ "tags": ["linear", "news", "celebrity"]
},
{
"id": "1509428502953",
@@ -209,7 +217,8 @@
"thumbnail": "https://dummyimage.com/320x180/000/fff",
"brandedThumbnail": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
"shortDescription": "A live description",
- "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing."
+ "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
+ "tags": ["linear", "news", "celebrity"]
},
{
"id": "1509428502953",
@@ -217,7 +226,8 @@
"thumbnail": "https://dummyimage.com/320x180/000/fff",
"brandedThumbnail": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
"shortDescription": "A live description",
- "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing."
+ "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
+ "tags": ["linear", "news", "celebrity"]
},
{
"id": "1509428502953",
@@ -257,7 +267,8 @@
"thumbnail": "https://dummyimage.com/320x180/000/fff",
"brandedThumbnail": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
"shortDescription": "A live description",
- "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing."
+ "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
+ "tags": ["linear", "news", "celebrity"]
},
{
"id": "1509428502953",
@@ -265,7 +276,8 @@
"thumbnail": "https://dummyimage.com/320x180/000/fff",
"brandedThumbnail": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
"shortDescription": "A live description",
- "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing."
+ "longDescription": "Dolor occaecat esse non non Lorem velit proident duis cupidatat sit elit sit ea adipisicing.",
+ "tags": ["linear", "news", "celebrity"]
},
{
"id": "1509428502953",
diff --git a/components/itemDetailsScene.xml b/components/itemDetailsScene.xml
index 03c138a..6e148d7 100644
--- a/components/itemDetailsScene.xml
+++ b/components/itemDetailsScene.xml
@@ -9,7 +9,7 @@
-
+
\ No newline at end of file
diff --git a/components/itemDetailsScreen.brs b/components/itemDetailsScreen.brs
index 668069e..3dbf08d 100644
--- a/components/itemDetailsScreen.brs
+++ b/components/itemDetailsScreen.brs
@@ -9,5 +9,17 @@ end sub
sub handleItemDetails()
m.itemTitle.text = m.top.content.TITLE
m.itemDescription.text = m.top.content.DESCRIPTION
+ if m.top.content.tags <> invalid
+ tagsCount = m.top.content.tags.Count()
+ for i = 0 to tagsCount - 1
+ if i = tagsCount - 1
+ m.itemTags.text += m.top.content.tags[i]
+ else
+ m.itemTags.text += m.top.content.tags[i] + " - "
+ end if
+ end for
+ else
+ m.itemTags.text = "No tags available"
+ end if
m.watchButton.setFocus(true)
end sub
\ No newline at end of file
diff --git a/components/rowItemDataContent.xml b/components/rowItemDataContent.xml
new file mode 100644
index 0000000..948b882
--- /dev/null
+++ b/components/rowItemDataContent.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/rowListContent.brs b/components/rowListContent.brs
index b2109bc..31ffd4d 100644
--- a/components/rowListContent.brs
+++ b/components/rowListContent.brs
@@ -13,11 +13,12 @@ sub populateRowList()
itemNode = m.top.createChild("ContentNode")
itemNode.title = item.title
for each data in item.data
- itemData = itemNode.createChild("ContentNode")
+ itemData = itemNode.createChild("rowItemDataContent")
itemData.setFields({
title: data.title
HDPosterURL: data.thumbnail
description: data.longDescription
+ tags: data.tags
})
end for
m.top.appendChild(itemNode)
diff --git a/components/rowListScene.brs b/components/rowListScene.brs
index 1e4f209..d9827cd 100644
--- a/components/rowListScene.brs
+++ b/components/rowListScene.brs
@@ -60,10 +60,8 @@ end sub
sub handleItemSelected()
itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
- itemDetailsContentNode = createObject("roSGNode", "ContentNode")
- itemDetailsContentNode = itemDetailsNode
m.itemDetailsScreen = createObject("roSGNode", "itemDetailsScreen")
- m.itemDetailsScreen.content = itemDetailsContentNode
+ m.itemDetailsScreen.content = itemDetailsNode
m.top.appendChild(m.itemDetailsScreen)
m.rowList.visible = false
m.MainBoldLabel.visible = false
From e9495c00b18e57ae5b578bafeb7c620c8c7993ff Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Mon, 27 Sep 2021 04:39:46 +0200
Subject: [PATCH 10/17] still need to make circular button
---
components/icons/plus.png | Bin 0 -> 1042 bytes
components/icons/plusIcon.png | Bin 0 -> 1146 bytes
components/itemDetailsScene.xml | 8 +++++--
components/itemDetailsScreen.brs | 21 ++++++++++++++++--
components/rowItemDataContent.xml | 1 +
components/rowListContent.brs | 1 +
components/rowListScene.brs | 35 +++++-------------------------
components/tasks/createScreen.brs | 21 ++++++++++++++++++
components/tasks/createScreen.xml | 10 +++++++++
9 files changed, 63 insertions(+), 34 deletions(-)
create mode 100644 components/icons/plus.png
create mode 100644 components/icons/plusIcon.png
create mode 100644 components/tasks/createScreen.brs
create mode 100644 components/tasks/createScreen.xml
diff --git a/components/icons/plus.png b/components/icons/plus.png
new file mode 100644
index 0000000000000000000000000000000000000000..3dd6f132bdeae46c4a8845bf6a5980ad777de9a8
GIT binary patch
literal 1042
zcmV+t1nv8YP)6+1x@9h;N?Lr;scs!qT(9{
zU$_K)RlkEt6TgTdViZ9%RuSdJT0mb^5>2r2Rv~B(4>Ob5HNBj@&-An;{F9xP?3r1Y
zJ+s!VS+lu`)rEnAyxMpKJFy*iV-wcJ_P_B9e!#aljZ>H@s6%74@CuIOKXht7|Kfe@
z!%&}f2W#;)Def{*Yf_F@}`aa(+bC!*rB+A?nZ*Mk@@zz@5D^tbt)6M0W(A+|ra$OI}W&$@@V+u@0Zh
z%dC;lB*&f-HoKL=h`cH$>JHu`J9a;OVkwNt0bsn_L2KoG;$Q(KQaJ4uM`Y*kYKgre
z?-M0LY$-zq@lE7)WU02K*p)sPge=8Xia4EINxqSqWlrXqc~Z|XG1Sft;j7ga+}NBUUb)M<{#
zBRw@=#g52Bd3+(GuEqiMCJ(N!M{bC$n4Ssh!rJTx>^0=6T#zit%Q7nav8d*TGWED;N}_
zQ*!J{Ib|<~mK*>&LP5FI?dyPWm67&|Dh?gHVgzB~&f%5yJKDvHee>4s}ro>7NL*vS2EH6E`xh1HF_g9LJsVegFUf
M07*qoM6N<$f!jv`Nyll0pC%Bz+|5W9Qtp6u-&_F%F!Ip6YR68?Y*YYc=o=a3bQH1vYoW_h7UN
zd=eQv3A~(98;@<~UbMXfwBjz~36<{aOlhuf~(*x`R=A&${$wj`_(hV>LJduUC
zxy?E-Z8m3swe1oPMTEzI`!o64itPbl!fc-dMpB8Y(Q-Nh^c8F61<(f^jh0#YJriy0
zDg4Xswg4E6R>i)u%Hz?-?)aW)!Jm3`0F1S&w35bqVrK>?0LZ|zJKFrkOAOd!3MX?M
zu^9uY0N)$k?xM-Pz^^v>rFM-QXO=*W>s6z>&@?Of;tk+<4#UQoGY}V@q+6R!{K6(}
z%VF3!vjt*&+l_MnQWI+Uvicec1z;1yxdRyh7J%!qpDUs{&r9l&bl5rfS1!Z3VHdHZ
zk}C2SIY~DLvccrnUGysz2Tg7a192danLOP!chV7jTptGFKpr(Y(=~U}an|H$7>ENI
zGcL>ZkH5HfK&48$4v-DI9Sa%VAYa`A!3frQg)RLdXhOor3zhCrrFKGijM(or{g
zCJe-ZOqhJ3Ywo0DlgUFj{bI#fC>mGive<#5u@)7LHy^)NjD0EJi+w$p;SS&pN%u%P
z;GDaB%Nf9%_5e@hvf6=*)hVOg(rjWcaNZ`qlF4|^KwdMtUnu$v0laUMPqF-(52uap
zy;c;eGj0c<&0FL0|0zOIm_2q{2P0m
z#(M%_Z}OgK(dbx|cJRH}?Z7|+R}I)fqwEMvsr1+4)ISVVCGC*3N792f{EvJG@GD6_
z$X|Lcs?jL8SN_ihqmrJK^rEC^cB0Nm4^#A|>
M07*qoM6N<$f^{7lAOHXW
literal 0
HcmV?d00001
diff --git a/components/itemDetailsScene.xml b/components/itemDetailsScene.xml
index 6e148d7..4092abd 100644
--- a/components/itemDetailsScene.xml
+++ b/components/itemDetailsScene.xml
@@ -1,5 +1,5 @@
-
+
@@ -9,7 +9,11 @@
-
+
+
+
+
+
\ No newline at end of file
diff --git a/components/itemDetailsScreen.brs b/components/itemDetailsScreen.brs
index 3dbf08d..89ab36d 100644
--- a/components/itemDetailsScreen.brs
+++ b/components/itemDetailsScreen.brs
@@ -3,12 +3,19 @@ sub init()
m.watchButton = m.top.findNode("watchButton")
m.itemDescription = m.top.findNode("itemDescription")
m.itemTags = m.top.findNode("itemTags")
+ m.itemTime = m.top.findNode("itemTime")
+ m.ButtonGroup = m.top.findNode("ButtonGroup")
m.top.ObserveField("content", "handleItemDetails")
end sub
sub handleItemDetails()
+ m.ButtonGroup.focusedTextFont = "font:LargeBoldSystemFont"
+ m.ButtonGroup.textFont = "font:LargeBoldSystemFont"
+ m.ButtonGroup.vertAlignment = "center"
+ m.ButtonGroup.horizAlignment = "center"
m.itemTitle.text = m.top.content.TITLE
m.itemDescription.text = m.top.content.DESCRIPTION
+ m.itemTime.text = "Duration : " + GetTime(m.top.content.time) + " Hour(s)"
if m.top.content.tags <> invalid
tagsCount = m.top.content.tags.Count()
for i = 0 to tagsCount - 1
@@ -21,5 +28,15 @@ sub handleItemDetails()
else
m.itemTags.text = "No tags available"
end if
- m.watchButton.setFocus(true)
-end sub
\ No newline at end of file
+end sub
+
+function GetTime(length as Integer) as String
+ minutes = (length \ 60).ToStr()
+ seconds = length MOD 60
+ if seconds < 10
+ seconds = "0" + seconds.ToStr()
+ else
+ seconds = seconds.ToStr()
+ end if
+ return minutes + ":" + seconds
+end function
\ No newline at end of file
diff --git a/components/rowItemDataContent.xml b/components/rowItemDataContent.xml
index 948b882..52670ac 100644
--- a/components/rowItemDataContent.xml
+++ b/components/rowItemDataContent.xml
@@ -5,6 +5,7 @@
+
\ No newline at end of file
diff --git a/components/rowListContent.brs b/components/rowListContent.brs
index 31ffd4d..613a952 100644
--- a/components/rowListContent.brs
+++ b/components/rowListContent.brs
@@ -19,6 +19,7 @@ sub populateRowList()
HDPosterURL: data.thumbnail
description: data.longDescription
tags: data.tags
+ time: data.time
})
end for
m.top.appendChild(itemNode)
diff --git a/components/rowListScene.brs b/components/rowListScene.brs
index d9827cd..4e909f6 100644
--- a/components/rowListScene.brs
+++ b/components/rowListScene.brs
@@ -11,6 +11,7 @@ sub init()
m.fadeInAnimation = m.top.findNode("fadeInAnimation")
m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
m.rowList.content = createObject("roSGNode", "RowListContent")
+ m.createScreen = createObject("roSGNOde", "createScreen")
m.rowList.setFocus(true)
m.rowList.findNode("RowListItem")
m.top.observeField("HeroDetails", "handleHeroDetails")
@@ -60,33 +61,7 @@ end sub
sub handleItemSelected()
itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
- m.itemDetailsScreen = createObject("roSGNode", "itemDetailsScreen")
- m.itemDetailsScreen.content = itemDetailsNode
- m.top.appendChild(m.itemDetailsScreen)
- m.rowList.visible = false
- m.MainBoldLabel.visible = false
- m.CategoryLabel.visible = false
- m.DescriptionLabel.visible = false
- m.DateAndDurationLabel.visible = false
- m.itemDetailsScreen.visible = true
- m.itemDetailsScreen.setFocus(true)
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- handled = false
- if press
- if key = "back" and m.itemDetailsScreen.visible = true
- m.MainBoldLabel.visible = true
- m.CategoryLabel.visible = true
- m.DescriptionLabel.visible = true
- m.DateAndDurationLabel.visible = true
- m.rowList.visible = true
- m.rowList.setFocus(true)
- m.itemDetailsScreen.visible = false
- handled = true
- else
- handled = false
- end if
- end if
- return handled
-end function
\ No newline at end of file
+ m.createScreen.screenTitle = "itemDetailsScene"
+ m.createScreen.content = itemDetailsNode
+ m.createScreen.control = "RUN"
+end sub
\ No newline at end of file
diff --git a/components/tasks/createScreen.brs b/components/tasks/createScreen.brs
new file mode 100644
index 0000000..c5a4308
--- /dev/null
+++ b/components/tasks/createScreen.brs
@@ -0,0 +1,21 @@
+sub init()
+ m.top.functionname = "createScreen"
+end sub
+
+sub createScreen()
+ screen = CreateObject("roSGScreen")
+ m.port = CreateObject("roMessagePort")
+ screen.setMessagePort(m.port)
+ scene = screen.CreateScene("itemDetailsScreen")
+ scene.content = m.top.content
+ scene.backgroundUri = m.top.content.HDPosterURL
+ screen.show()
+ scene.setFocus(true)
+ while(true)
+ msg = wait(0, m.port)
+ msgType = type(msg)
+ if msgType = "roSGScreenEvent"
+ if msg.isScreenClosed() then return
+ end if
+ end while
+end sub
\ No newline at end of file
diff --git a/components/tasks/createScreen.xml b/components/tasks/createScreen.xml
new file mode 100644
index 0000000..2802e67
--- /dev/null
+++ b/components/tasks/createScreen.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From d8ab48e4a2197da9f44edfbe273f56f83b4aac93 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Wed, 29 Sep 2021 11:58:22 +0200
Subject: [PATCH 11/17] did Mr. Mostafa's Changes
---
components/itemDetailsScene.xml | 4 ++--
components/itemDetailsScreen.brs | 16 ++++++++--------
components/rowListContent.xml | 2 +-
components/rowListItem.xml | 2 +-
components/rowListScene.xml | 4 ++--
5 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/components/itemDetailsScene.xml b/components/itemDetailsScene.xml
index 4092abd..fdd25d8 100644
--- a/components/itemDetailsScene.xml
+++ b/components/itemDetailsScene.xml
@@ -1,6 +1,6 @@
-
-
+
+
diff --git a/components/itemDetailsScreen.brs b/components/itemDetailsScreen.brs
index 89ab36d..fd29d3b 100644
--- a/components/itemDetailsScreen.brs
+++ b/components/itemDetailsScreen.brs
@@ -6,19 +6,19 @@ sub init()
m.itemTime = m.top.findNode("itemTime")
m.ButtonGroup = m.top.findNode("ButtonGroup")
m.top.ObserveField("content", "handleItemDetails")
-end sub
-
-sub handleItemDetails()
m.ButtonGroup.focusedTextFont = "font:LargeBoldSystemFont"
m.ButtonGroup.textFont = "font:LargeBoldSystemFont"
m.ButtonGroup.vertAlignment = "center"
m.ButtonGroup.horizAlignment = "center"
+end sub
+
+sub handleItemDetails()
m.itemTitle.text = m.top.content.TITLE
m.itemDescription.text = m.top.content.DESCRIPTION
- m.itemTime.text = "Duration : " + GetTime(m.top.content.time) + " Hour(s)"
+ m.itemTime.text = "Duration : " + FormatDuration(m.top.content.time) + " Hour(s)"
if m.top.content.tags <> invalid
tagsCount = m.top.content.tags.Count()
- for i = 0 to tagsCount - 1
+ for each i in count
if i = tagsCount - 1
m.itemTags.text += m.top.content.tags[i]
else
@@ -30,9 +30,9 @@ sub handleItemDetails()
end if
end sub
-function GetTime(length as Integer) as String
- minutes = (length \ 60).ToStr()
- seconds = length MOD 60
+function FormatDuration(duration as Integer) as String
+ minutes = (duration \ 60).ToStr()
+ seconds = duration MOD 60
if seconds < 10
seconds = "0" + seconds.ToStr()
else
diff --git a/components/rowListContent.xml b/components/rowListContent.xml
index 28e7d8e..f70ce16 100644
--- a/components/rowListContent.xml
+++ b/components/rowListContent.xml
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/components/rowListItem.xml b/components/rowListItem.xml
index 65e51b9..897af09 100644
--- a/components/rowListItem.xml
+++ b/components/rowListItem.xml
@@ -5,7 +5,7 @@
-
+
diff --git a/components/rowListScene.xml b/components/rowListScene.xml
index 15be50a..d59dca7 100644
--- a/components/rowListScene.xml
+++ b/components/rowListScene.xml
@@ -1,6 +1,6 @@
-
-
+
+
From 2e6c86b8a1cfc48b2806349d7308850868820f18 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Thu, 30 Sep 2021 11:39:32 +0200
Subject: [PATCH 12/17] handled crash and changes
---
components/itemDetailsScreen.brs | 2 +-
components/rowItemDataContent.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/components/itemDetailsScreen.brs b/components/itemDetailsScreen.brs
index fd29d3b..ee7d913 100644
--- a/components/itemDetailsScreen.brs
+++ b/components/itemDetailsScreen.brs
@@ -18,7 +18,7 @@ sub handleItemDetails()
m.itemTime.text = "Duration : " + FormatDuration(m.top.content.time) + " Hour(s)"
if m.top.content.tags <> invalid
tagsCount = m.top.content.tags.Count()
- for each i in count
+ for i = 0 to tagsCount - 1
if i = tagsCount - 1
m.itemTags.text += m.top.content.tags[i]
else
diff --git a/components/rowItemDataContent.xml b/components/rowItemDataContent.xml
index 52670ac..84cbb44 100644
--- a/components/rowItemDataContent.xml
+++ b/components/rowItemDataContent.xml
@@ -1,5 +1,5 @@
-
+
From bffe827820b0e885e2501f9f08dd8aee6ce55734 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Fri, 1 Oct 2021 12:47:40 +0200
Subject: [PATCH 13/17] removed the new SceneGraph screen and added a UI screen
---
.clj-kondo/.cache/2021.09.25/lock | 0
...DetailsScene.xml => ItemDetailsScreen.xml} | 4 +-
components/itemDetailsScreen.brs | 5 +--
components/rowListScene.brs | 38 ++++++++++++++++---
4 files changed, 37 insertions(+), 10 deletions(-)
create mode 100644 .clj-kondo/.cache/2021.09.25/lock
rename components/{itemDetailsScene.xml => ItemDetailsScreen.xml} (87%)
diff --git a/.clj-kondo/.cache/2021.09.25/lock b/.clj-kondo/.cache/2021.09.25/lock
new file mode 100644
index 0000000..e69de29
diff --git a/components/itemDetailsScene.xml b/components/ItemDetailsScreen.xml
similarity index 87%
rename from components/itemDetailsScene.xml
rename to components/ItemDetailsScreen.xml
index fdd25d8..821084b 100644
--- a/components/itemDetailsScene.xml
+++ b/components/ItemDetailsScreen.xml
@@ -1,5 +1,5 @@
-
+
@@ -11,7 +11,7 @@
-
+
diff --git a/components/itemDetailsScreen.brs b/components/itemDetailsScreen.brs
index ee7d913..6e76ad0 100644
--- a/components/itemDetailsScreen.brs
+++ b/components/itemDetailsScreen.brs
@@ -1,6 +1,5 @@
sub init()
m.itemTitle = m.top.findNode("itemTitle")
- m.watchButton = m.top.findNode("watchButton")
m.itemDescription = m.top.findNode("itemDescription")
m.itemTags = m.top.findNode("itemTags")
m.itemTime = m.top.findNode("itemTime")
@@ -13,8 +12,8 @@ sub init()
end sub
sub handleItemDetails()
- m.itemTitle.text = m.top.content.TITLE
- m.itemDescription.text = m.top.content.DESCRIPTION
+ m.itemTitle.text = m.top.content.title
+ m.itemDescription.text = m.top.content.description
m.itemTime.text = "Duration : " + FormatDuration(m.top.content.time) + " Hour(s)"
if m.top.content.tags <> invalid
tagsCount = m.top.content.tags.Count()
diff --git a/components/rowListScene.brs b/components/rowListScene.brs
index 4e909f6..19fa181 100644
--- a/components/rowListScene.brs
+++ b/components/rowListScene.brs
@@ -3,15 +3,14 @@ sub init()
m.flag = true
m.global.ratio = 1
m.rowList = m.top.findNode("mainRowList")
- m.currFocus = invalid
m.MainBoldLabel = m.top.findNode("MainBoldLabel")
m.DateAndDurationLabel = m.top.findNode("DateAndDurationLabel")
m.DescriptionLabel = m.top.findNode("DescriptionLabel")
m.CategoryLabel = m.top.findNode("CategoryLabel")
m.fadeInAnimation = m.top.findNode("fadeInAnimation")
+ m.heroDetailsId = m.top.findNode("heroDetailsId")
m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
m.rowList.content = createObject("roSGNode", "RowListContent")
- m.createScreen = createObject("roSGNOde", "createScreen")
m.rowList.setFocus(true)
m.rowList.findNode("RowListItem")
m.top.observeField("HeroDetails", "handleHeroDetails")
@@ -60,8 +59,37 @@ sub handleUpdate()
end sub
sub handleItemSelected()
+ m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
- m.createScreen.screenTitle = "itemDetailsScene"
m.createScreen.content = itemDetailsNode
- m.createScreen.control = "RUN"
-end sub
\ No newline at end of file
+ m.top.appendChild(m.createScreen)
+ m.createScreen.visible = false
+ toggleDetails()
+end sub
+
+sub toggleDetails()
+ m.rowList.visible = not m.rowList.visible
+ m.heroDetailsId.visible = not m.heroDetailsId.visible
+ m.createScreen.visible = not m.createScreen.visible
+ if m.createScreen.visible
+ m.createScreen.setFocus(true)
+ else
+ m.rowList.setFocus(true)
+ end if
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press then
+ if key = "back" and m.createScreen.visible
+ toggleDetails()
+ return true
+ else if key = "right" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
+ return true
+ else if key = "left" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
+ return true
+ end if
+ end if
+ return false
+end function
\ No newline at end of file
From eb2539bef7ffdcf40f8971dc67b872736c495bff Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Fri, 8 Oct 2021 14:56:45 +0200
Subject: [PATCH 14/17] made the changes
---
.../itemDetailsScreen_20211008143034.brs | 41 +++++++
.../itemDetailsScreen_20211008143306.brs | 45 ++++++++
.../itemDetailsScreen_20211008143308.brs | 46 ++++++++
.../itemDetailsScreen_20211008143412.brs | 38 +++++++
.../rowListScene_20211008143034.brs | 95 ++++++++++++++++
.../rowListScene_20211008143545.brs | 95 ++++++++++++++++
.../rowListScene_20211008143904.brs | 94 ++++++++++++++++
.../rowListScene_20211008144007.brs | 97 ++++++++++++++++
.../rowListScene_20211008144104.brs | 99 +++++++++++++++++
.../rowListScene_20211008144108.brs | 99 +++++++++++++++++
.../rowListScene_20211008144149.brs | 99 +++++++++++++++++
.../rowListScene_20211008144320.brs | 101 +++++++++++++++++
.../rowListScene_20211008145431.brs | 104 ++++++++++++++++++
components/itemDetailsScreen.brs | 11 +-
components/rowListScene.brs | 21 +++-
components/tasks/createScreen.brs | 21 ----
components/tasks/createScreen.xml | 10 --
17 files changed, 1072 insertions(+), 44 deletions(-)
create mode 100644 .history/components/itemDetailsScreen_20211008143034.brs
create mode 100644 .history/components/itemDetailsScreen_20211008143306.brs
create mode 100644 .history/components/itemDetailsScreen_20211008143308.brs
create mode 100644 .history/components/itemDetailsScreen_20211008143412.brs
create mode 100644 .history/components/rowListScene_20211008143034.brs
create mode 100644 .history/components/rowListScene_20211008143545.brs
create mode 100644 .history/components/rowListScene_20211008143904.brs
create mode 100644 .history/components/rowListScene_20211008144007.brs
create mode 100644 .history/components/rowListScene_20211008144104.brs
create mode 100644 .history/components/rowListScene_20211008144108.brs
create mode 100644 .history/components/rowListScene_20211008144149.brs
create mode 100644 .history/components/rowListScene_20211008144320.brs
create mode 100644 .history/components/rowListScene_20211008145431.brs
delete mode 100644 components/tasks/createScreen.brs
delete mode 100644 components/tasks/createScreen.xml
diff --git a/.history/components/itemDetailsScreen_20211008143034.brs b/.history/components/itemDetailsScreen_20211008143034.brs
new file mode 100644
index 0000000..6e76ad0
--- /dev/null
+++ b/.history/components/itemDetailsScreen_20211008143034.brs
@@ -0,0 +1,41 @@
+sub init()
+ m.itemTitle = m.top.findNode("itemTitle")
+ m.itemDescription = m.top.findNode("itemDescription")
+ m.itemTags = m.top.findNode("itemTags")
+ m.itemTime = m.top.findNode("itemTime")
+ m.ButtonGroup = m.top.findNode("ButtonGroup")
+ m.top.ObserveField("content", "handleItemDetails")
+ m.ButtonGroup.focusedTextFont = "font:LargeBoldSystemFont"
+ m.ButtonGroup.textFont = "font:LargeBoldSystemFont"
+ m.ButtonGroup.vertAlignment = "center"
+ m.ButtonGroup.horizAlignment = "center"
+end sub
+
+sub handleItemDetails()
+ m.itemTitle.text = m.top.content.title
+ m.itemDescription.text = m.top.content.description
+ m.itemTime.text = "Duration : " + FormatDuration(m.top.content.time) + " Hour(s)"
+ if m.top.content.tags <> invalid
+ tagsCount = m.top.content.tags.Count()
+ for i = 0 to tagsCount - 1
+ if i = tagsCount - 1
+ m.itemTags.text += m.top.content.tags[i]
+ else
+ m.itemTags.text += m.top.content.tags[i] + " - "
+ end if
+ end for
+ else
+ m.itemTags.text = "No tags available"
+ end if
+end sub
+
+function FormatDuration(duration as Integer) as String
+ minutes = (duration \ 60).ToStr()
+ seconds = duration MOD 60
+ if seconds < 10
+ seconds = "0" + seconds.ToStr()
+ else
+ seconds = seconds.ToStr()
+ end if
+ return minutes + ":" + seconds
+end function
\ No newline at end of file
diff --git a/.history/components/itemDetailsScreen_20211008143306.brs b/.history/components/itemDetailsScreen_20211008143306.brs
new file mode 100644
index 0000000..6db3a5e
--- /dev/null
+++ b/.history/components/itemDetailsScreen_20211008143306.brs
@@ -0,0 +1,45 @@
+sub init()
+ m.itemTitle = m.top.findNode("itemTitle")
+ m.itemDescription = m.top.findNode("itemDescription")
+ m.itemTags = m.top.findNode("itemTags")
+ m.itemTime = m.top.findNode("itemTime")
+ m.ButtonGroup = m.top.findNode("ButtonGroup")
+ m.top.ObserveField("content", "handleItemDetails")
+ m.ButtonGroup.focusedTextFont = "font:LargeBoldSystemFont"
+ m.ButtonGroup.textFont = "font:LargeBoldSystemFont"
+ m.ButtonGroup.vertAlignment = "center"
+ m.ButtonGroup.horizAlignment = "center"
+end sub
+
+sub handleItemDetails()
+ m.itemTitle.text = m.top.content.title
+ m.itemDescription.text = m.top.content.description
+ m.itemTime.text = "Duration : " + FormatDuration(m.top.content.time) + " Hour(s)"
+ if m.top.content.tags <> invalid
+ ' tagsCount = m.top.content.tags.Count()
+ ' for i = 0 to tagsCount - 1
+ ' if i = tagsCount - 1
+ ' m.itemTags.text += m.top.content.tags[i]
+ ' else
+ ' m.itemTags.text += m.top.content.tags[i] + " - "
+ ' end if
+ ' end for
+ seperator = ""
+ for each tag in m.top.content.tags
+ m.itemTags.text += seperator + tag
+ seperator = " - "
+ else
+ m.itemTags.text = "No tags available"
+ end if
+end sub
+
+function FormatDuration(duration as Integer) as String
+ minutes = (duration \ 60).ToStr()
+ seconds = duration MOD 60
+ if seconds < 10
+ seconds = "0" + seconds.ToStr()
+ else
+ seconds = seconds.ToStr()
+ end if
+ return minutes + ":" + seconds
+end function
\ No newline at end of file
diff --git a/.history/components/itemDetailsScreen_20211008143308.brs b/.history/components/itemDetailsScreen_20211008143308.brs
new file mode 100644
index 0000000..c28d000
--- /dev/null
+++ b/.history/components/itemDetailsScreen_20211008143308.brs
@@ -0,0 +1,46 @@
+sub init()
+ m.itemTitle = m.top.findNode("itemTitle")
+ m.itemDescription = m.top.findNode("itemDescription")
+ m.itemTags = m.top.findNode("itemTags")
+ m.itemTime = m.top.findNode("itemTime")
+ m.ButtonGroup = m.top.findNode("ButtonGroup")
+ m.top.ObserveField("content", "handleItemDetails")
+ m.ButtonGroup.focusedTextFont = "font:LargeBoldSystemFont"
+ m.ButtonGroup.textFont = "font:LargeBoldSystemFont"
+ m.ButtonGroup.vertAlignment = "center"
+ m.ButtonGroup.horizAlignment = "center"
+end sub
+
+sub handleItemDetails()
+ m.itemTitle.text = m.top.content.title
+ m.itemDescription.text = m.top.content.description
+ m.itemTime.text = "Duration : " + FormatDuration(m.top.content.time) + " Hour(s)"
+ if m.top.content.tags <> invalid
+ ' tagsCount = m.top.content.tags.Count()
+ ' for i = 0 to tagsCount - 1
+ ' if i = tagsCount - 1
+ ' m.itemTags.text += m.top.content.tags[i]
+ ' else
+ ' m.itemTags.text += m.top.content.tags[i] + " - "
+ ' end if
+ ' end for
+ seperator = ""
+ for each tag in m.top.content.tags
+ m.itemTags.text += seperator + tag
+ seperator = " - "
+ end for
+ else
+ m.itemTags.text = "No tags available"
+ end if
+end sub
+
+function FormatDuration(duration as Integer) as String
+ minutes = (duration \ 60).ToStr()
+ seconds = duration MOD 60
+ if seconds < 10
+ seconds = "0" + seconds.ToStr()
+ else
+ seconds = seconds.ToStr()
+ end if
+ return minutes + ":" + seconds
+end function
\ No newline at end of file
diff --git a/.history/components/itemDetailsScreen_20211008143412.brs b/.history/components/itemDetailsScreen_20211008143412.brs
new file mode 100644
index 0000000..c666195
--- /dev/null
+++ b/.history/components/itemDetailsScreen_20211008143412.brs
@@ -0,0 +1,38 @@
+sub init()
+ m.itemTitle = m.top.findNode("itemTitle")
+ m.itemDescription = m.top.findNode("itemDescription")
+ m.itemTags = m.top.findNode("itemTags")
+ m.itemTime = m.top.findNode("itemTime")
+ m.ButtonGroup = m.top.findNode("ButtonGroup")
+ m.top.ObserveField("content", "handleItemDetails")
+ m.ButtonGroup.focusedTextFont = "font:LargeBoldSystemFont"
+ m.ButtonGroup.textFont = "font:LargeBoldSystemFont"
+ m.ButtonGroup.vertAlignment = "center"
+ m.ButtonGroup.horizAlignment = "center"
+end sub
+
+sub handleItemDetails()
+ m.itemTitle.text = m.top.content.title
+ m.itemDescription.text = m.top.content.description
+ m.itemTime.text = "Duration : " + FormatDuration(m.top.content.time) + " Hour(s)"
+ if m.top.content.tags <> invalid
+ seperator = ""
+ for each tag in m.top.content.tags
+ m.itemTags.text += seperator + tag
+ seperator = " - "
+ end for
+ else
+ m.itemTags.text = "No tags available"
+ end if
+end sub
+
+function FormatDuration(duration as Integer) as String
+ minutes = (duration \ 60).ToStr()
+ seconds = duration MOD 60
+ if seconds < 10
+ seconds = "0" + seconds.ToStr()
+ else
+ seconds = seconds.ToStr()
+ end if
+ return minutes + ":" + seconds
+end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008143034.brs b/.history/components/rowListScene_20211008143034.brs
new file mode 100644
index 0000000..19fa181
--- /dev/null
+++ b/.history/components/rowListScene_20211008143034.brs
@@ -0,0 +1,95 @@
+sub init()
+ m.global.addField("ratio", "float", FALSE)
+ m.flag = true
+ m.global.ratio = 1
+ m.rowList = m.top.findNode("mainRowList")
+ m.MainBoldLabel = m.top.findNode("MainBoldLabel")
+ m.DateAndDurationLabel = m.top.findNode("DateAndDurationLabel")
+ m.DescriptionLabel = m.top.findNode("DescriptionLabel")
+ m.CategoryLabel = m.top.findNode("CategoryLabel")
+ m.fadeInAnimation = m.top.findNode("fadeInAnimation")
+ m.heroDetailsId = m.top.findNode("heroDetailsId")
+ m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
+ m.rowList.content = createObject("roSGNode", "RowListContent")
+ m.rowList.setFocus(true)
+ m.rowList.findNode("RowListItem")
+ m.top.observeField("HeroDetails", "handleHeroDetails")
+ m.rowList.observeField("rowItemSelected", "handleItemSelected")
+ m.fadeOutAnimation.observeField("state", "handleAnimationDone")
+ videoMode = createObject("roDeviceInfo")
+ if videoMode.GetVideoMode() = "720p"
+ m.global.ratio = 0.66
+ end if
+ if m.global.ratio = 0.66
+ m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
+ m.rowList.rowItemSpacing = [[5, 0]]
+ m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
+ m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
+ m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
+ m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
+ m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
+ end if
+end sub
+
+sub handleHeroDetails()
+ if m.flag
+ m.flag = false
+ handleUpdate()
+ else
+ handleItemFocusChange()
+ end if
+end sub
+
+sub handleAnimationDone()
+ if m.fadeOutAnimation.state = "stopped"
+ handleUpdate()
+ m.fadeInAnimation.control = "start"
+ end if
+end sub
+
+sub handleItemFocusChange()
+ m.fadeOutAnimation.control = "start"
+end sub
+
+sub handleUpdate()
+ m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
+ m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
+ m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
+ m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
+end sub
+
+sub handleItemSelected()
+ m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
+ itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
+ m.createScreen.content = itemDetailsNode
+ m.top.appendChild(m.createScreen)
+ m.createScreen.visible = false
+ toggleDetails()
+end sub
+
+sub toggleDetails()
+ m.rowList.visible = not m.rowList.visible
+ m.heroDetailsId.visible = not m.heroDetailsId.visible
+ m.createScreen.visible = not m.createScreen.visible
+ if m.createScreen.visible
+ m.createScreen.setFocus(true)
+ else
+ m.rowList.setFocus(true)
+ end if
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press then
+ if key = "back" and m.createScreen.visible
+ toggleDetails()
+ return true
+ else if key = "right" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
+ return true
+ else if key = "left" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
+ return true
+ end if
+ end if
+ return false
+end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008143545.brs b/.history/components/rowListScene_20211008143545.brs
new file mode 100644
index 0000000..8e88c20
--- /dev/null
+++ b/.history/components/rowListScene_20211008143545.brs
@@ -0,0 +1,95 @@
+sub init()
+ m.global.addField("ratio", "float", FALSE)
+ m.flag = true
+ m.global.ratio = 1
+ m.rowList = m.top.findNode("mainRowList")
+ m.heroDetailsId = m.top.findNode("heroDetailsId")
+ m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
+ m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
+ m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
+ m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
+ m.fadeInAnimation = m.top.findNode("fadeInAnimation")
+ m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
+ m.rowList.content = createObject("roSGNode", "RowListContent")
+ m.rowList.setFocus(true)
+ m.rowList.findNode("RowListItem")
+ m.top.observeField("HeroDetails", "handleHeroDetails")
+ m.rowList.observeField("rowItemSelected", "handleItemSelected")
+ m.fadeOutAnimation.observeField("state", "handleAnimationDone")
+ videoMode = createObject("roDeviceInfo")
+ if videoMode.GetVideoMode() = "720p"
+ m.global.ratio = 0.66
+ end if
+ if m.global.ratio = 0.66
+ m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
+ m.rowList.rowItemSpacing = [[5, 0]]
+ m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
+ m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
+ m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
+ m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
+ m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
+ end if
+end sub
+
+sub handleHeroDetails()
+ if m.flag
+ m.flag = false
+ handleUpdate()
+ else
+ handleItemFocusChange()
+ end if
+end sub
+
+sub handleAnimationDone()
+ if m.fadeOutAnimation.state = "stopped"
+ handleUpdate()
+ m.fadeInAnimation.control = "start"
+ end if
+end sub
+
+sub handleItemFocusChange()
+ m.fadeOutAnimation.control = "start"
+end sub
+
+sub handleUpdate()
+ m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
+ m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
+ m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
+ m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
+end sub
+
+sub handleItemSelected()
+ m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
+ itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
+ m.createScreen.content = itemDetailsNode
+ m.top.appendChild(m.createScreen)
+ m.createScreen.visible = false
+ toggleDetails()
+end sub
+
+sub toggleDetails()
+ m.rowList.visible = not m.rowList.visible
+ m.heroDetailsId.visible = not m.heroDetailsId.visible
+ m.createScreen.visible = not m.createScreen.visible
+ if m.createScreen.visible
+ m.createScreen.setFocus(true)
+ else
+ m.rowList.setFocus(true)
+ end if
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press then
+ if key = "back" and m.createScreen.visible
+ toggleDetails()
+ return true
+ else if key = "right" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
+ return true
+ else if key = "left" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
+ return true
+ end if
+ end if
+ return false
+end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008143904.brs b/.history/components/rowListScene_20211008143904.brs
new file mode 100644
index 0000000..f2f9b6a
--- /dev/null
+++ b/.history/components/rowListScene_20211008143904.brs
@@ -0,0 +1,94 @@
+sub init()
+ m.global.addField("ratio", "float", FALSE)
+ m.flag = true
+ m.global.ratio = 1
+ m.rowList = m.top.findNode("mainRowList")
+ m.heroDetailsId = m.top.findNode("heroDetailsId")
+ m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
+ m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
+ m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
+ m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
+ m.fadeInAnimation = m.top.findNode("fadeInAnimation")
+ m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
+ m.rowList.content = createObject("roSGNode", "RowListContent")
+ m.rowList.setFocus(true)
+ m.top.observeField("HeroDetails", "handleHeroDetails")
+ m.rowList.observeField("rowItemSelected", "handleItemSelected")
+ m.fadeOutAnimation.observeField("state", "handleAnimationDone")
+ videoMode = createObject("roDeviceInfo")
+ if videoMode.GetVideoMode() = "720p"
+ m.global.ratio = 0.66
+ end if
+ if m.global.ratio = 0.66
+ m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
+ m.rowList.rowItemSpacing = [[5, 0]]
+ m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
+ m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
+ m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
+ m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
+ m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
+ end if
+end sub
+
+sub handleHeroDetails()
+ if m.flag
+ m.flag = false
+ handleUpdate()
+ else
+ handleItemFocusChange()
+ end if
+end sub
+
+sub handleAnimationDone()
+ if m.fadeOutAnimation.state = "stopped"
+ handleUpdate()
+ m.fadeInAnimation.control = "start"
+ end if
+end sub
+
+sub handleItemFocusChange()
+ m.fadeOutAnimation.control = "start"
+end sub
+
+sub handleUpdate()
+ m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
+ m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
+ m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
+ m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
+end sub
+
+sub handleItemSelected()
+ m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
+ itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
+ m.createScreen.content = itemDetailsNode
+ m.top.appendChild(m.createScreen)
+ m.createScreen.visible = false
+ toggleDetails()
+end sub
+
+sub toggleDetails()
+ m.rowList.visible = not m.rowList.visible
+ m.heroDetailsId.visible = not m.heroDetailsId.visible
+ m.createScreen.visible = not m.createScreen.visible
+ if m.createScreen.visible
+ m.createScreen.setFocus(true)
+ else
+ m.rowList.setFocus(true)
+ end if
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press then
+ if key = "back" and m.createScreen.visible
+ toggleDetails()
+ return true
+ else if key = "right" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
+ return true
+ else if key = "left" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
+ return true
+ end if
+ end if
+ return false
+end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008144007.brs b/.history/components/rowListScene_20211008144007.brs
new file mode 100644
index 0000000..db0deed
--- /dev/null
+++ b/.history/components/rowListScene_20211008144007.brs
@@ -0,0 +1,97 @@
+sub init()
+ m.global.addField("ratio", "float", FALSE)
+ m.flag = true
+ m.global.ratio = 1
+ m.rowList = m.top.findNode("mainRowList")
+ m.heroDetailsId = m.top.findNode("heroDetailsId")
+ m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
+ m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
+ m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
+ m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
+ m.fadeInAnimation = m.top.findNode("fadeInAnimation")
+ m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
+ m.rowList.content = createObject("roSGNode", "RowListContent")
+ m.rowList.setFocus(true)
+ m.top.observeField("HeroDetails", "handleHeroDetails")
+ m.rowList.observeField("rowItemSelected", "handleItemSelected")
+ m.fadeOutAnimation.observeField("state", "handleAnimationDone")
+
+
+ ' Handling Responsivness
+ videoMode = createObject("roDeviceInfo")
+ if videoMode.GetVideoMode() = "720p"
+ m.global.ratio = 0.66
+ end if
+ if m.global.ratio = 0.66
+ m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
+ m.rowList.rowItemSpacing = [[5, 0]]
+ m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
+ m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
+ m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
+ m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
+ m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
+ end if
+end sub
+
+sub handleHeroDetails()
+ if m.flag
+ m.flag = false
+ handleUpdate()
+ else
+ handleItemFocusChange()
+ end if
+end sub
+
+sub handleAnimationDone()
+ if m.fadeOutAnimation.state = "stopped"
+ handleUpdate()
+ m.fadeInAnimation.control = "start"
+ end if
+end sub
+
+sub handleItemFocusChange()
+ m.fadeOutAnimation.control = "start"
+end sub
+
+sub handleUpdate()
+ m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
+ m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
+ m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
+ m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
+end sub
+
+sub handleItemSelected()
+ m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
+ itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
+ m.createScreen.content = itemDetailsNode
+ m.top.appendChild(m.createScreen)
+ m.createScreen.visible = false
+ toggleDetails()
+end sub
+
+sub toggleDetails()
+ m.rowList.visible = not m.rowList.visible
+ m.heroDetailsId.visible = not m.heroDetailsId.visible
+ m.createScreen.visible = not m.createScreen.visible
+ if m.createScreen.visible
+ m.createScreen.setFocus(true)
+ else
+ m.rowList.setFocus(true)
+ end if
+end sub
+
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press then
+ if key = "back" and m.createScreen.visible
+ toggleDetails()
+ return true
+ else if key = "right" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
+ return true
+ else if key = "left" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
+ return true
+ end if
+ end if
+ return false
+end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008144104.brs b/.history/components/rowListScene_20211008144104.brs
new file mode 100644
index 0000000..d33ed61
--- /dev/null
+++ b/.history/components/rowListScene_20211008144104.brs
@@ -0,0 +1,99 @@
+sub init()
+ m.global.addField("ratio", "float", FALSE)
+ m.flag = true
+ m.global.ratio = 1
+ m.rowList = m.top.findNode("mainRowList")
+ m.heroDetailsId = m.top.findNode("heroDetailsId")
+ m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
+ m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
+ m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
+ m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
+ m.fadeInAnimation = m.top.findNode("fadeInAnimation")
+ m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
+ m.rowList.content = createObject("roSGNode", "RowListContent")
+ m.rowList.setFocus(true)
+ m.top.observeField("HeroDetails", "handleHeroDetails")
+ m.rowList.observeField("rowItemSelected", "handleItemSelected")
+ m.fadeOutAnimation.observeField("state", "handleAnimationDone")
+
+
+ ' Handling Responsivness
+ videoMode = createObject("roDeviceInfo")
+ if videoMode.GetVideoMode() = "720p"
+ m.global.ratio = 0.66
+ end if
+ if m.global.ratio = 0.66
+ m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
+ m.rowList.rowItemSpacing = [[5, 0]]
+ m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
+ m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
+ m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
+ m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
+ m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
+ end if
+end sub
+
+sub handleHeroDetails()
+ if m.flag
+ m.flag = false
+ handleUpdate()
+ else
+ handleItemFocusChange()
+ end if
+end sub
+
+sub handleAnimationDone()
+ if m.fadeOutAnimation.state = "stopped"
+ handleUpdate()
+ m.fadeInAnimation.control = "start"
+ end if
+end sub
+
+sub handleItemFocusChange()
+ m.fadeOutAnimation.control = "start"
+end sub
+
+sub handleUpdate()
+ m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
+ m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
+ m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
+ m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
+end sub
+
+sub handleItemSelected()
+ m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
+ itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
+ m.createScreen.content = itemDetailsNode
+ m.top.appendChild(m.createScreen)
+ m.createScreen.visible = false
+ toggleDetails()
+end sub
+
+sub toggleDetails()
+ m.rowList.visible = not m.rowList.visible
+ m.heroDetailsId.visible = not m.heroDetailsId.visible
+ m.createScreen.visible = not m.createScreen.visible
+ if m.createScreen.visible
+ m.createScreen.setFocus(true)
+ else
+ m.rowList.setFocus(true)
+ end if
+end sub
+
+
+' Handling entering and exiting the Details Pane
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press then
+ if key = "back" and m.createScreen.visible
+ toggleDetails()
+ return true
+ else if key = "right" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
+ return true
+ else if key = "left" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
+ return true
+ end if
+ end if
+ return false
+end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008144108.brs b/.history/components/rowListScene_20211008144108.brs
new file mode 100644
index 0000000..4cf09f0
--- /dev/null
+++ b/.history/components/rowListScene_20211008144108.brs
@@ -0,0 +1,99 @@
+sub init()
+ m.global.addField("ratio", "float", FALSE)
+ m.flag = true
+ m.global.ratio = 1
+ m.rowList = m.top.findNode("mainRowList")
+ m.heroDetailsId = m.top.findNode("heroDetailsId")
+ m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
+ m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
+ m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
+ m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
+ m.fadeInAnimation = m.top.findNode("fadeInAnimation")
+ m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
+ m.rowList.content = createObject("roSGNode", "RowListContent")
+ m.rowList.setFocus(true)
+ m.top.observeField("HeroDetails", "handleHeroDetails")
+ m.rowList.observeField("rowItemSelected", "handleItemSelected")
+ m.fadeOutAnimation.observeField("state", "handleAnimationDone")
+
+
+ ' Handling Responsivness
+ videoMode = createObject("roDeviceInfo")
+ if videoMode.GetVideoMode() = "720p"
+ m.global.ratio = 0.66
+ end if
+ if m.global.ratio = 0.66
+ m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
+ m.rowList.rowItemSpacing = [[5, 0]]
+ m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
+ m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
+ m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
+ m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
+ m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
+ end if
+end sub
+
+sub handleHeroDetails()
+ if m.flag
+ m.flag = false
+ handleUpdate()
+ else
+ handleItemFocusChange()
+ end if
+end sub
+
+sub handleAnimationDone()
+ if m.fadeOutAnimation.state = "stopped"
+ handleUpdate()
+ m.fadeInAnimation.control = "start"
+ end if
+end sub
+
+sub handleItemFocusChange()
+ m.fadeOutAnimation.control = "start"
+end sub
+
+sub handleUpdate()
+ m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
+ m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
+ m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
+ m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
+end sub
+
+sub handleItemSelected()
+ m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
+ itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
+ m.createScreen.content = itemDetailsNode
+ m.top.appendChild(m.createScreen)
+ m.createScreen.visible = false
+ toggleDetails()
+end sub
+
+sub toggleDetails()
+ m.rowList.visible = not m.rowList.visible
+ m.heroDetailsId.visible = not m.heroDetailsId.visible
+ m.createScreen.visible = not m.createScreen.visible
+ if m.createScreen.visible
+ m.createScreen.setFocus(true)
+ else
+ m.rowList.setFocus(true)
+ end if
+end sub
+
+
+' Handling entering and exiting the Details Screen
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press then
+ if key = "back" and m.createScreen.visible
+ toggleDetails()
+ return true
+ else if key = "right" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
+ return true
+ else if key = "left" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
+ return true
+ end if
+ end if
+ return false
+end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008144149.brs b/.history/components/rowListScene_20211008144149.brs
new file mode 100644
index 0000000..de53a3e
--- /dev/null
+++ b/.history/components/rowListScene_20211008144149.brs
@@ -0,0 +1,99 @@
+sub init()
+ m.global.addField("ratio", "float", FALSE)
+ m.flag = true
+ m.global.ratio = 1
+ m.rowList = m.top.findNode("mainRowList")
+ m.heroDetailsId = m.top.findNode("heroDetailsId")
+ m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
+ m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
+ m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
+ m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
+ m.fadeInAnimation = m.top.findNode("fadeInAnimation")
+ m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
+ m.rowList.content = createObject("roSGNode", "RowListContent")
+ m.rowList.setFocus(true)
+ m.top.observeField("HeroDetails", "handleHeroDetails")
+ m.rowList.observeField("rowItemSelected", "handleItemSelected")
+ m.fadeOutAnimation.observeField("state", "handleAnimationDone")
+
+
+ ' Handling Responsivness
+ videoMode = createObject("roDeviceInfo")
+ if videoMode.GetVideoMode() = "720p"
+ m.global.ratio = 0.66
+ end if
+ if m.global.ratio = 0.66
+ m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
+ m.rowList.rowItemSpacing = [[5, 0]]
+ m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
+ m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
+ m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
+ m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
+ m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
+ end if
+end sub
+
+sub handleHeroDetails()
+ if m.flag
+ m.flag = false
+ handleUpdate()
+ else
+ handleItemFocusChange()
+ end if
+end sub
+
+sub handleAnimationDone()
+ if m.fadeOutAnimation.state = "stopped"
+ handleUpdate()
+ m.fadeInAnimation.control = "start"
+ end if
+end sub
+
+sub handleItemFocusChange()
+ m.fadeOutAnimation.control = "start"
+end sub
+
+sub handleUpdate()
+ m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
+ m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
+ m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
+ m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
+end sub
+
+sub handleItemSelected()
+ m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
+ itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
+ m.createScreen.content = itemDetailsNode
+ m.top.appendChild(m.createScreen)
+ m.createScreen.visible = false
+ toggleDetails()
+end sub
+
+sub toggleDetails()
+ m.rowList.visible = not m.rowList.visible
+ m.heroDetailsId.visible = not m.heroDetailsId.visible
+ m.createScreen.visible = not m.createScreen.visible
+ if m.createScreen.visible
+ m.createScreen.setFocus(true)
+ else
+ m.rowList.setFocus(true)
+ end if
+end sub
+
+
+' Handling navigating and exiting the Details Screen
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press then
+ if key = "back" and m.createScreen.visible
+ toggleDetails()
+ return true
+ else if key = "right" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
+ return true
+ else if key = "left" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
+ return true
+ end if
+ end if
+ return false
+end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008144320.brs b/.history/components/rowListScene_20211008144320.brs
new file mode 100644
index 0000000..f9c63c8
--- /dev/null
+++ b/.history/components/rowListScene_20211008144320.brs
@@ -0,0 +1,101 @@
+sub init()
+ m.global.addField("ratio", "float", FALSE)
+ m.flag = true
+ m.global.ratio = 1
+ m.rowList = m.top.findNode("mainRowList")
+ m.heroDetailsId = m.top.findNode("heroDetailsId")
+ m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
+ m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
+ m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
+ m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
+ m.fadeInAnimation = m.top.findNode("fadeInAnimation")
+ m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
+ m.rowList.content = createObject("roSGNode", "RowListContent")
+ m.rowList.setFocus(true)
+ m.top.observeField("HeroDetails", "handleHeroDetails")
+ m.rowList.observeField("rowItemSelected", "handleItemSelected")
+ m.fadeOutAnimation.observeField("state", "handleAnimationDone")
+
+
+ ' Handling Responsivness
+ videoMode = createObject("roDeviceInfo")
+ if videoMode.GetVideoMode() = "720p"
+ m.global.ratio = 0.66
+ end if
+ if m.global.ratio = 0.66
+ m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
+ m.rowList.rowItemSpacing = [[5, 0]]
+ m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
+ m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
+ m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
+ m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
+ m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
+ end if
+end sub
+
+sub handleHeroDetails()
+ if m.flag
+ m.flag = false
+ handleUpdate()
+ else
+ handleItemFocusChange()
+ end if
+end sub
+
+sub handleAnimationDone()
+ if m.fadeOutAnimation.state = "stopped"
+ handleUpdate()
+ m.fadeInAnimation.control = "start"
+ end if
+end sub
+
+sub handleItemFocusChange()
+ m.fadeOutAnimation.control = "start"
+end sub
+
+' Update the text of the data in the details page
+sub handleUpdate()
+ m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
+ m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
+ m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
+ m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
+end sub
+
+' Clicking a Row List item
+sub handleItemSelected()
+ m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
+ itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
+ m.createScreen.content = itemDetailsNode
+ m.top.appendChild(m.createScreen)
+ m.createScreen.visible = false
+ toggleDetails()
+end sub
+
+' Toggle if the details screen is visible or not
+sub toggleDetails()
+ m.rowList.visible = not m.rowList.visible
+ m.heroDetailsId.visible = not m.heroDetailsId.visible
+ m.createScreen.visible = not m.createScreen.visible
+ if m.createScreen.visible
+ m.createScreen.setFocus(true)
+ else
+ m.rowList.setFocus(true)
+ end if
+end sub
+
+' Handling navigating and exiting the Details Screen
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press then
+ if key = "back" and m.createScreen.visible
+ toggleDetails()
+ return true
+ else if key = "right" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
+ return true
+ else if key = "left" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
+ return true
+ end if
+ end if
+ return false
+end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008145431.brs b/.history/components/rowListScene_20211008145431.brs
new file mode 100644
index 0000000..e2fbb84
--- /dev/null
+++ b/.history/components/rowListScene_20211008145431.brs
@@ -0,0 +1,104 @@
+sub init()
+ m.global.addField("ratio", "float", FALSE)
+ m.flag = true
+ m.global.ratio = 1
+ m.rowList = m.top.findNode("mainRowList")
+ m.heroDetailsId = m.top.findNode("heroDetailsId")
+ m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
+ m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
+ m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
+ m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
+ m.fadeInAnimation = m.top.findNode("fadeInAnimation")
+ m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
+ m.rowList.content = createObject("roSGNode", "RowListContent")
+ m.rowList.setFocus(true)
+ m.top.observeField("HeroDetails", "handleHeroDetails")
+ m.rowList.observeField("rowItemSelected", "handleItemSelected")
+ m.fadeOutAnimation.observeField("state", "handleAnimationDone")
+
+
+ ' Handling Responsivness
+ videoMode = createObject("roDeviceInfo")
+ if videoMode.GetVideoMode() = "720p"
+ m.global.ratio = 0.66
+ end if
+ if m.global.ratio = 0.66
+ m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
+ m.rowList.rowItemSpacing = [[5, 0]]
+ m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
+ m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
+ m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
+ m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
+ m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
+ end if
+end sub
+
+' changing the details on the background OR animate focus
+sub handleHeroDetails()
+ if m.flag
+ m.flag = false
+ handleUpdate()
+ else
+ handleItemFocusChange()
+ end if
+end sub
+
+' animate the changing of the background's data on item focus change
+sub handleAnimationDone()
+ if m.fadeOutAnimation.state = "stopped"
+ handleUpdate()
+ m.fadeInAnimation.control = "start"
+ end if
+end sub
+
+' Start animating the changing of the background data on scroll
+sub handleItemFocusChange()
+ m.fadeOutAnimation.control = "start"
+end sub
+
+' Update the text of the data in the details page
+sub handleUpdate()
+ m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
+ m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
+ m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
+ m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
+end sub
+
+' Clicking a Row List item
+sub handleItemSelected()
+ m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
+ itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
+ m.createScreen.content = itemDetailsNode
+ m.top.appendChild(m.createScreen)
+ m.createScreen.visible = false
+ toggleDetails()
+end sub
+
+' Toggle if the details screen is visible or not
+sub toggleDetails()
+ m.rowList.visible = not m.rowList.visible
+ m.heroDetailsId.visible = not m.heroDetailsId.visible
+ m.createScreen.visible = not m.createScreen.visible
+ if m.createScreen.visible
+ m.createScreen.setFocus(true)
+ else
+ m.rowList.setFocus(true)
+ end if
+end sub
+
+' Handling navigating and exiting the Details Screen
+function onKeyEvent(key as String, press as Boolean) as Boolean
+ if press then
+ if key = "back" and m.createScreen.visible
+ toggleDetails()
+ return true
+ else if key = "right" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
+ return true
+ else if key = "left" and m.createScreen.visible
+ m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
+ return true
+ end if
+ end if
+ return false
+end function
\ No newline at end of file
diff --git a/components/itemDetailsScreen.brs b/components/itemDetailsScreen.brs
index 6e76ad0..c666195 100644
--- a/components/itemDetailsScreen.brs
+++ b/components/itemDetailsScreen.brs
@@ -16,13 +16,10 @@ sub handleItemDetails()
m.itemDescription.text = m.top.content.description
m.itemTime.text = "Duration : " + FormatDuration(m.top.content.time) + " Hour(s)"
if m.top.content.tags <> invalid
- tagsCount = m.top.content.tags.Count()
- for i = 0 to tagsCount - 1
- if i = tagsCount - 1
- m.itemTags.text += m.top.content.tags[i]
- else
- m.itemTags.text += m.top.content.tags[i] + " - "
- end if
+ seperator = ""
+ for each tag in m.top.content.tags
+ m.itemTags.text += seperator + tag
+ seperator = " - "
end for
else
m.itemTags.text = "No tags available"
diff --git a/components/rowListScene.brs b/components/rowListScene.brs
index 19fa181..e2fbb84 100644
--- a/components/rowListScene.brs
+++ b/components/rowListScene.brs
@@ -3,19 +3,21 @@ sub init()
m.flag = true
m.global.ratio = 1
m.rowList = m.top.findNode("mainRowList")
- m.MainBoldLabel = m.top.findNode("MainBoldLabel")
- m.DateAndDurationLabel = m.top.findNode("DateAndDurationLabel")
- m.DescriptionLabel = m.top.findNode("DescriptionLabel")
- m.CategoryLabel = m.top.findNode("CategoryLabel")
- m.fadeInAnimation = m.top.findNode("fadeInAnimation")
m.heroDetailsId = m.top.findNode("heroDetailsId")
+ m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
+ m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
+ m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
+ m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
+ m.fadeInAnimation = m.top.findNode("fadeInAnimation")
m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
m.rowList.content = createObject("roSGNode", "RowListContent")
m.rowList.setFocus(true)
- m.rowList.findNode("RowListItem")
m.top.observeField("HeroDetails", "handleHeroDetails")
m.rowList.observeField("rowItemSelected", "handleItemSelected")
m.fadeOutAnimation.observeField("state", "handleAnimationDone")
+
+
+ ' Handling Responsivness
videoMode = createObject("roDeviceInfo")
if videoMode.GetVideoMode() = "720p"
m.global.ratio = 0.66
@@ -31,6 +33,7 @@ sub init()
end if
end sub
+' changing the details on the background OR animate focus
sub handleHeroDetails()
if m.flag
m.flag = false
@@ -40,6 +43,7 @@ sub handleHeroDetails()
end if
end sub
+' animate the changing of the background's data on item focus change
sub handleAnimationDone()
if m.fadeOutAnimation.state = "stopped"
handleUpdate()
@@ -47,10 +51,12 @@ sub handleAnimationDone()
end if
end sub
+' Start animating the changing of the background data on scroll
sub handleItemFocusChange()
m.fadeOutAnimation.control = "start"
end sub
+' Update the text of the data in the details page
sub handleUpdate()
m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
@@ -58,6 +64,7 @@ sub handleUpdate()
m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
end sub
+' Clicking a Row List item
sub handleItemSelected()
m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
@@ -67,6 +74,7 @@ sub handleItemSelected()
toggleDetails()
end sub
+' Toggle if the details screen is visible or not
sub toggleDetails()
m.rowList.visible = not m.rowList.visible
m.heroDetailsId.visible = not m.heroDetailsId.visible
@@ -78,6 +86,7 @@ sub toggleDetails()
end if
end sub
+' Handling navigating and exiting the Details Screen
function onKeyEvent(key as String, press as Boolean) as Boolean
if press then
if key = "back" and m.createScreen.visible
diff --git a/components/tasks/createScreen.brs b/components/tasks/createScreen.brs
deleted file mode 100644
index c5a4308..0000000
--- a/components/tasks/createScreen.brs
+++ /dev/null
@@ -1,21 +0,0 @@
-sub init()
- m.top.functionname = "createScreen"
-end sub
-
-sub createScreen()
- screen = CreateObject("roSGScreen")
- m.port = CreateObject("roMessagePort")
- screen.setMessagePort(m.port)
- scene = screen.CreateScene("itemDetailsScreen")
- scene.content = m.top.content
- scene.backgroundUri = m.top.content.HDPosterURL
- screen.show()
- scene.setFocus(true)
- while(true)
- msg = wait(0, m.port)
- msgType = type(msg)
- if msgType = "roSGScreenEvent"
- if msg.isScreenClosed() then return
- end if
- end while
-end sub
\ No newline at end of file
diff --git a/components/tasks/createScreen.xml b/components/tasks/createScreen.xml
deleted file mode 100644
index 2802e67..0000000
--- a/components/tasks/createScreen.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
From 495f0ce9fd92f03c7bbdce7be36c0e17ee3669cb Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Sat, 16 Oct 2021 21:17:30 +0200
Subject: [PATCH 15/17] Delete .history directory
---
.../itemDetailsScreen_20211008143034.brs | 41 -------
.../itemDetailsScreen_20211008143306.brs | 45 --------
.../itemDetailsScreen_20211008143308.brs | 46 --------
.../itemDetailsScreen_20211008143412.brs | 38 -------
.../rowListScene_20211008143034.brs | 95 ----------------
.../rowListScene_20211008143545.brs | 95 ----------------
.../rowListScene_20211008143904.brs | 94 ----------------
.../rowListScene_20211008144007.brs | 97 ----------------
.../rowListScene_20211008144104.brs | 99 -----------------
.../rowListScene_20211008144108.brs | 99 -----------------
.../rowListScene_20211008144149.brs | 99 -----------------
.../rowListScene_20211008144320.brs | 101 -----------------
.../rowListScene_20211008145431.brs | 104 ------------------
13 files changed, 1053 deletions(-)
delete mode 100644 .history/components/itemDetailsScreen_20211008143034.brs
delete mode 100644 .history/components/itemDetailsScreen_20211008143306.brs
delete mode 100644 .history/components/itemDetailsScreen_20211008143308.brs
delete mode 100644 .history/components/itemDetailsScreen_20211008143412.brs
delete mode 100644 .history/components/rowListScene_20211008143034.brs
delete mode 100644 .history/components/rowListScene_20211008143545.brs
delete mode 100644 .history/components/rowListScene_20211008143904.brs
delete mode 100644 .history/components/rowListScene_20211008144007.brs
delete mode 100644 .history/components/rowListScene_20211008144104.brs
delete mode 100644 .history/components/rowListScene_20211008144108.brs
delete mode 100644 .history/components/rowListScene_20211008144149.brs
delete mode 100644 .history/components/rowListScene_20211008144320.brs
delete mode 100644 .history/components/rowListScene_20211008145431.brs
diff --git a/.history/components/itemDetailsScreen_20211008143034.brs b/.history/components/itemDetailsScreen_20211008143034.brs
deleted file mode 100644
index 6e76ad0..0000000
--- a/.history/components/itemDetailsScreen_20211008143034.brs
+++ /dev/null
@@ -1,41 +0,0 @@
-sub init()
- m.itemTitle = m.top.findNode("itemTitle")
- m.itemDescription = m.top.findNode("itemDescription")
- m.itemTags = m.top.findNode("itemTags")
- m.itemTime = m.top.findNode("itemTime")
- m.ButtonGroup = m.top.findNode("ButtonGroup")
- m.top.ObserveField("content", "handleItemDetails")
- m.ButtonGroup.focusedTextFont = "font:LargeBoldSystemFont"
- m.ButtonGroup.textFont = "font:LargeBoldSystemFont"
- m.ButtonGroup.vertAlignment = "center"
- m.ButtonGroup.horizAlignment = "center"
-end sub
-
-sub handleItemDetails()
- m.itemTitle.text = m.top.content.title
- m.itemDescription.text = m.top.content.description
- m.itemTime.text = "Duration : " + FormatDuration(m.top.content.time) + " Hour(s)"
- if m.top.content.tags <> invalid
- tagsCount = m.top.content.tags.Count()
- for i = 0 to tagsCount - 1
- if i = tagsCount - 1
- m.itemTags.text += m.top.content.tags[i]
- else
- m.itemTags.text += m.top.content.tags[i] + " - "
- end if
- end for
- else
- m.itemTags.text = "No tags available"
- end if
-end sub
-
-function FormatDuration(duration as Integer) as String
- minutes = (duration \ 60).ToStr()
- seconds = duration MOD 60
- if seconds < 10
- seconds = "0" + seconds.ToStr()
- else
- seconds = seconds.ToStr()
- end if
- return minutes + ":" + seconds
-end function
\ No newline at end of file
diff --git a/.history/components/itemDetailsScreen_20211008143306.brs b/.history/components/itemDetailsScreen_20211008143306.brs
deleted file mode 100644
index 6db3a5e..0000000
--- a/.history/components/itemDetailsScreen_20211008143306.brs
+++ /dev/null
@@ -1,45 +0,0 @@
-sub init()
- m.itemTitle = m.top.findNode("itemTitle")
- m.itemDescription = m.top.findNode("itemDescription")
- m.itemTags = m.top.findNode("itemTags")
- m.itemTime = m.top.findNode("itemTime")
- m.ButtonGroup = m.top.findNode("ButtonGroup")
- m.top.ObserveField("content", "handleItemDetails")
- m.ButtonGroup.focusedTextFont = "font:LargeBoldSystemFont"
- m.ButtonGroup.textFont = "font:LargeBoldSystemFont"
- m.ButtonGroup.vertAlignment = "center"
- m.ButtonGroup.horizAlignment = "center"
-end sub
-
-sub handleItemDetails()
- m.itemTitle.text = m.top.content.title
- m.itemDescription.text = m.top.content.description
- m.itemTime.text = "Duration : " + FormatDuration(m.top.content.time) + " Hour(s)"
- if m.top.content.tags <> invalid
- ' tagsCount = m.top.content.tags.Count()
- ' for i = 0 to tagsCount - 1
- ' if i = tagsCount - 1
- ' m.itemTags.text += m.top.content.tags[i]
- ' else
- ' m.itemTags.text += m.top.content.tags[i] + " - "
- ' end if
- ' end for
- seperator = ""
- for each tag in m.top.content.tags
- m.itemTags.text += seperator + tag
- seperator = " - "
- else
- m.itemTags.text = "No tags available"
- end if
-end sub
-
-function FormatDuration(duration as Integer) as String
- minutes = (duration \ 60).ToStr()
- seconds = duration MOD 60
- if seconds < 10
- seconds = "0" + seconds.ToStr()
- else
- seconds = seconds.ToStr()
- end if
- return minutes + ":" + seconds
-end function
\ No newline at end of file
diff --git a/.history/components/itemDetailsScreen_20211008143308.brs b/.history/components/itemDetailsScreen_20211008143308.brs
deleted file mode 100644
index c28d000..0000000
--- a/.history/components/itemDetailsScreen_20211008143308.brs
+++ /dev/null
@@ -1,46 +0,0 @@
-sub init()
- m.itemTitle = m.top.findNode("itemTitle")
- m.itemDescription = m.top.findNode("itemDescription")
- m.itemTags = m.top.findNode("itemTags")
- m.itemTime = m.top.findNode("itemTime")
- m.ButtonGroup = m.top.findNode("ButtonGroup")
- m.top.ObserveField("content", "handleItemDetails")
- m.ButtonGroup.focusedTextFont = "font:LargeBoldSystemFont"
- m.ButtonGroup.textFont = "font:LargeBoldSystemFont"
- m.ButtonGroup.vertAlignment = "center"
- m.ButtonGroup.horizAlignment = "center"
-end sub
-
-sub handleItemDetails()
- m.itemTitle.text = m.top.content.title
- m.itemDescription.text = m.top.content.description
- m.itemTime.text = "Duration : " + FormatDuration(m.top.content.time) + " Hour(s)"
- if m.top.content.tags <> invalid
- ' tagsCount = m.top.content.tags.Count()
- ' for i = 0 to tagsCount - 1
- ' if i = tagsCount - 1
- ' m.itemTags.text += m.top.content.tags[i]
- ' else
- ' m.itemTags.text += m.top.content.tags[i] + " - "
- ' end if
- ' end for
- seperator = ""
- for each tag in m.top.content.tags
- m.itemTags.text += seperator + tag
- seperator = " - "
- end for
- else
- m.itemTags.text = "No tags available"
- end if
-end sub
-
-function FormatDuration(duration as Integer) as String
- minutes = (duration \ 60).ToStr()
- seconds = duration MOD 60
- if seconds < 10
- seconds = "0" + seconds.ToStr()
- else
- seconds = seconds.ToStr()
- end if
- return minutes + ":" + seconds
-end function
\ No newline at end of file
diff --git a/.history/components/itemDetailsScreen_20211008143412.brs b/.history/components/itemDetailsScreen_20211008143412.brs
deleted file mode 100644
index c666195..0000000
--- a/.history/components/itemDetailsScreen_20211008143412.brs
+++ /dev/null
@@ -1,38 +0,0 @@
-sub init()
- m.itemTitle = m.top.findNode("itemTitle")
- m.itemDescription = m.top.findNode("itemDescription")
- m.itemTags = m.top.findNode("itemTags")
- m.itemTime = m.top.findNode("itemTime")
- m.ButtonGroup = m.top.findNode("ButtonGroup")
- m.top.ObserveField("content", "handleItemDetails")
- m.ButtonGroup.focusedTextFont = "font:LargeBoldSystemFont"
- m.ButtonGroup.textFont = "font:LargeBoldSystemFont"
- m.ButtonGroup.vertAlignment = "center"
- m.ButtonGroup.horizAlignment = "center"
-end sub
-
-sub handleItemDetails()
- m.itemTitle.text = m.top.content.title
- m.itemDescription.text = m.top.content.description
- m.itemTime.text = "Duration : " + FormatDuration(m.top.content.time) + " Hour(s)"
- if m.top.content.tags <> invalid
- seperator = ""
- for each tag in m.top.content.tags
- m.itemTags.text += seperator + tag
- seperator = " - "
- end for
- else
- m.itemTags.text = "No tags available"
- end if
-end sub
-
-function FormatDuration(duration as Integer) as String
- minutes = (duration \ 60).ToStr()
- seconds = duration MOD 60
- if seconds < 10
- seconds = "0" + seconds.ToStr()
- else
- seconds = seconds.ToStr()
- end if
- return minutes + ":" + seconds
-end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008143034.brs b/.history/components/rowListScene_20211008143034.brs
deleted file mode 100644
index 19fa181..0000000
--- a/.history/components/rowListScene_20211008143034.brs
+++ /dev/null
@@ -1,95 +0,0 @@
-sub init()
- m.global.addField("ratio", "float", FALSE)
- m.flag = true
- m.global.ratio = 1
- m.rowList = m.top.findNode("mainRowList")
- m.MainBoldLabel = m.top.findNode("MainBoldLabel")
- m.DateAndDurationLabel = m.top.findNode("DateAndDurationLabel")
- m.DescriptionLabel = m.top.findNode("DescriptionLabel")
- m.CategoryLabel = m.top.findNode("CategoryLabel")
- m.fadeInAnimation = m.top.findNode("fadeInAnimation")
- m.heroDetailsId = m.top.findNode("heroDetailsId")
- m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
- m.rowList.content = createObject("roSGNode", "RowListContent")
- m.rowList.setFocus(true)
- m.rowList.findNode("RowListItem")
- m.top.observeField("HeroDetails", "handleHeroDetails")
- m.rowList.observeField("rowItemSelected", "handleItemSelected")
- m.fadeOutAnimation.observeField("state", "handleAnimationDone")
- videoMode = createObject("roDeviceInfo")
- if videoMode.GetVideoMode() = "720p"
- m.global.ratio = 0.66
- end if
- if m.global.ratio = 0.66
- m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
- m.rowList.rowItemSpacing = [[5, 0]]
- m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
- m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
- m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
- m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
- m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
- end if
-end sub
-
-sub handleHeroDetails()
- if m.flag
- m.flag = false
- handleUpdate()
- else
- handleItemFocusChange()
- end if
-end sub
-
-sub handleAnimationDone()
- if m.fadeOutAnimation.state = "stopped"
- handleUpdate()
- m.fadeInAnimation.control = "start"
- end if
-end sub
-
-sub handleItemFocusChange()
- m.fadeOutAnimation.control = "start"
-end sub
-
-sub handleUpdate()
- m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
- m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
- m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
- m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
-end sub
-
-sub handleItemSelected()
- m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
- itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
- m.createScreen.content = itemDetailsNode
- m.top.appendChild(m.createScreen)
- m.createScreen.visible = false
- toggleDetails()
-end sub
-
-sub toggleDetails()
- m.rowList.visible = not m.rowList.visible
- m.heroDetailsId.visible = not m.heroDetailsId.visible
- m.createScreen.visible = not m.createScreen.visible
- if m.createScreen.visible
- m.createScreen.setFocus(true)
- else
- m.rowList.setFocus(true)
- end if
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press then
- if key = "back" and m.createScreen.visible
- toggleDetails()
- return true
- else if key = "right" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
- return true
- else if key = "left" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
- return true
- end if
- end if
- return false
-end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008143545.brs b/.history/components/rowListScene_20211008143545.brs
deleted file mode 100644
index 8e88c20..0000000
--- a/.history/components/rowListScene_20211008143545.brs
+++ /dev/null
@@ -1,95 +0,0 @@
-sub init()
- m.global.addField("ratio", "float", FALSE)
- m.flag = true
- m.global.ratio = 1
- m.rowList = m.top.findNode("mainRowList")
- m.heroDetailsId = m.top.findNode("heroDetailsId")
- m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
- m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
- m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
- m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
- m.fadeInAnimation = m.top.findNode("fadeInAnimation")
- m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
- m.rowList.content = createObject("roSGNode", "RowListContent")
- m.rowList.setFocus(true)
- m.rowList.findNode("RowListItem")
- m.top.observeField("HeroDetails", "handleHeroDetails")
- m.rowList.observeField("rowItemSelected", "handleItemSelected")
- m.fadeOutAnimation.observeField("state", "handleAnimationDone")
- videoMode = createObject("roDeviceInfo")
- if videoMode.GetVideoMode() = "720p"
- m.global.ratio = 0.66
- end if
- if m.global.ratio = 0.66
- m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
- m.rowList.rowItemSpacing = [[5, 0]]
- m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
- m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
- m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
- m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
- m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
- end if
-end sub
-
-sub handleHeroDetails()
- if m.flag
- m.flag = false
- handleUpdate()
- else
- handleItemFocusChange()
- end if
-end sub
-
-sub handleAnimationDone()
- if m.fadeOutAnimation.state = "stopped"
- handleUpdate()
- m.fadeInAnimation.control = "start"
- end if
-end sub
-
-sub handleItemFocusChange()
- m.fadeOutAnimation.control = "start"
-end sub
-
-sub handleUpdate()
- m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
- m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
- m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
- m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
-end sub
-
-sub handleItemSelected()
- m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
- itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
- m.createScreen.content = itemDetailsNode
- m.top.appendChild(m.createScreen)
- m.createScreen.visible = false
- toggleDetails()
-end sub
-
-sub toggleDetails()
- m.rowList.visible = not m.rowList.visible
- m.heroDetailsId.visible = not m.heroDetailsId.visible
- m.createScreen.visible = not m.createScreen.visible
- if m.createScreen.visible
- m.createScreen.setFocus(true)
- else
- m.rowList.setFocus(true)
- end if
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press then
- if key = "back" and m.createScreen.visible
- toggleDetails()
- return true
- else if key = "right" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
- return true
- else if key = "left" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
- return true
- end if
- end if
- return false
-end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008143904.brs b/.history/components/rowListScene_20211008143904.brs
deleted file mode 100644
index f2f9b6a..0000000
--- a/.history/components/rowListScene_20211008143904.brs
+++ /dev/null
@@ -1,94 +0,0 @@
-sub init()
- m.global.addField("ratio", "float", FALSE)
- m.flag = true
- m.global.ratio = 1
- m.rowList = m.top.findNode("mainRowList")
- m.heroDetailsId = m.top.findNode("heroDetailsId")
- m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
- m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
- m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
- m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
- m.fadeInAnimation = m.top.findNode("fadeInAnimation")
- m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
- m.rowList.content = createObject("roSGNode", "RowListContent")
- m.rowList.setFocus(true)
- m.top.observeField("HeroDetails", "handleHeroDetails")
- m.rowList.observeField("rowItemSelected", "handleItemSelected")
- m.fadeOutAnimation.observeField("state", "handleAnimationDone")
- videoMode = createObject("roDeviceInfo")
- if videoMode.GetVideoMode() = "720p"
- m.global.ratio = 0.66
- end if
- if m.global.ratio = 0.66
- m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
- m.rowList.rowItemSpacing = [[5, 0]]
- m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
- m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
- m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
- m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
- m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
- end if
-end sub
-
-sub handleHeroDetails()
- if m.flag
- m.flag = false
- handleUpdate()
- else
- handleItemFocusChange()
- end if
-end sub
-
-sub handleAnimationDone()
- if m.fadeOutAnimation.state = "stopped"
- handleUpdate()
- m.fadeInAnimation.control = "start"
- end if
-end sub
-
-sub handleItemFocusChange()
- m.fadeOutAnimation.control = "start"
-end sub
-
-sub handleUpdate()
- m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
- m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
- m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
- m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
-end sub
-
-sub handleItemSelected()
- m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
- itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
- m.createScreen.content = itemDetailsNode
- m.top.appendChild(m.createScreen)
- m.createScreen.visible = false
- toggleDetails()
-end sub
-
-sub toggleDetails()
- m.rowList.visible = not m.rowList.visible
- m.heroDetailsId.visible = not m.heroDetailsId.visible
- m.createScreen.visible = not m.createScreen.visible
- if m.createScreen.visible
- m.createScreen.setFocus(true)
- else
- m.rowList.setFocus(true)
- end if
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press then
- if key = "back" and m.createScreen.visible
- toggleDetails()
- return true
- else if key = "right" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
- return true
- else if key = "left" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
- return true
- end if
- end if
- return false
-end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008144007.brs b/.history/components/rowListScene_20211008144007.brs
deleted file mode 100644
index db0deed..0000000
--- a/.history/components/rowListScene_20211008144007.brs
+++ /dev/null
@@ -1,97 +0,0 @@
-sub init()
- m.global.addField("ratio", "float", FALSE)
- m.flag = true
- m.global.ratio = 1
- m.rowList = m.top.findNode("mainRowList")
- m.heroDetailsId = m.top.findNode("heroDetailsId")
- m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
- m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
- m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
- m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
- m.fadeInAnimation = m.top.findNode("fadeInAnimation")
- m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
- m.rowList.content = createObject("roSGNode", "RowListContent")
- m.rowList.setFocus(true)
- m.top.observeField("HeroDetails", "handleHeroDetails")
- m.rowList.observeField("rowItemSelected", "handleItemSelected")
- m.fadeOutAnimation.observeField("state", "handleAnimationDone")
-
-
- ' Handling Responsivness
- videoMode = createObject("roDeviceInfo")
- if videoMode.GetVideoMode() = "720p"
- m.global.ratio = 0.66
- end if
- if m.global.ratio = 0.66
- m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
- m.rowList.rowItemSpacing = [[5, 0]]
- m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
- m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
- m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
- m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
- m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
- end if
-end sub
-
-sub handleHeroDetails()
- if m.flag
- m.flag = false
- handleUpdate()
- else
- handleItemFocusChange()
- end if
-end sub
-
-sub handleAnimationDone()
- if m.fadeOutAnimation.state = "stopped"
- handleUpdate()
- m.fadeInAnimation.control = "start"
- end if
-end sub
-
-sub handleItemFocusChange()
- m.fadeOutAnimation.control = "start"
-end sub
-
-sub handleUpdate()
- m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
- m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
- m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
- m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
-end sub
-
-sub handleItemSelected()
- m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
- itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
- m.createScreen.content = itemDetailsNode
- m.top.appendChild(m.createScreen)
- m.createScreen.visible = false
- toggleDetails()
-end sub
-
-sub toggleDetails()
- m.rowList.visible = not m.rowList.visible
- m.heroDetailsId.visible = not m.heroDetailsId.visible
- m.createScreen.visible = not m.createScreen.visible
- if m.createScreen.visible
- m.createScreen.setFocus(true)
- else
- m.rowList.setFocus(true)
- end if
-end sub
-
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press then
- if key = "back" and m.createScreen.visible
- toggleDetails()
- return true
- else if key = "right" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
- return true
- else if key = "left" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
- return true
- end if
- end if
- return false
-end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008144104.brs b/.history/components/rowListScene_20211008144104.brs
deleted file mode 100644
index d33ed61..0000000
--- a/.history/components/rowListScene_20211008144104.brs
+++ /dev/null
@@ -1,99 +0,0 @@
-sub init()
- m.global.addField("ratio", "float", FALSE)
- m.flag = true
- m.global.ratio = 1
- m.rowList = m.top.findNode("mainRowList")
- m.heroDetailsId = m.top.findNode("heroDetailsId")
- m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
- m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
- m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
- m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
- m.fadeInAnimation = m.top.findNode("fadeInAnimation")
- m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
- m.rowList.content = createObject("roSGNode", "RowListContent")
- m.rowList.setFocus(true)
- m.top.observeField("HeroDetails", "handleHeroDetails")
- m.rowList.observeField("rowItemSelected", "handleItemSelected")
- m.fadeOutAnimation.observeField("state", "handleAnimationDone")
-
-
- ' Handling Responsivness
- videoMode = createObject("roDeviceInfo")
- if videoMode.GetVideoMode() = "720p"
- m.global.ratio = 0.66
- end if
- if m.global.ratio = 0.66
- m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
- m.rowList.rowItemSpacing = [[5, 0]]
- m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
- m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
- m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
- m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
- m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
- end if
-end sub
-
-sub handleHeroDetails()
- if m.flag
- m.flag = false
- handleUpdate()
- else
- handleItemFocusChange()
- end if
-end sub
-
-sub handleAnimationDone()
- if m.fadeOutAnimation.state = "stopped"
- handleUpdate()
- m.fadeInAnimation.control = "start"
- end if
-end sub
-
-sub handleItemFocusChange()
- m.fadeOutAnimation.control = "start"
-end sub
-
-sub handleUpdate()
- m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
- m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
- m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
- m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
-end sub
-
-sub handleItemSelected()
- m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
- itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
- m.createScreen.content = itemDetailsNode
- m.top.appendChild(m.createScreen)
- m.createScreen.visible = false
- toggleDetails()
-end sub
-
-sub toggleDetails()
- m.rowList.visible = not m.rowList.visible
- m.heroDetailsId.visible = not m.heroDetailsId.visible
- m.createScreen.visible = not m.createScreen.visible
- if m.createScreen.visible
- m.createScreen.setFocus(true)
- else
- m.rowList.setFocus(true)
- end if
-end sub
-
-
-' Handling entering and exiting the Details Pane
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press then
- if key = "back" and m.createScreen.visible
- toggleDetails()
- return true
- else if key = "right" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
- return true
- else if key = "left" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
- return true
- end if
- end if
- return false
-end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008144108.brs b/.history/components/rowListScene_20211008144108.brs
deleted file mode 100644
index 4cf09f0..0000000
--- a/.history/components/rowListScene_20211008144108.brs
+++ /dev/null
@@ -1,99 +0,0 @@
-sub init()
- m.global.addField("ratio", "float", FALSE)
- m.flag = true
- m.global.ratio = 1
- m.rowList = m.top.findNode("mainRowList")
- m.heroDetailsId = m.top.findNode("heroDetailsId")
- m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
- m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
- m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
- m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
- m.fadeInAnimation = m.top.findNode("fadeInAnimation")
- m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
- m.rowList.content = createObject("roSGNode", "RowListContent")
- m.rowList.setFocus(true)
- m.top.observeField("HeroDetails", "handleHeroDetails")
- m.rowList.observeField("rowItemSelected", "handleItemSelected")
- m.fadeOutAnimation.observeField("state", "handleAnimationDone")
-
-
- ' Handling Responsivness
- videoMode = createObject("roDeviceInfo")
- if videoMode.GetVideoMode() = "720p"
- m.global.ratio = 0.66
- end if
- if m.global.ratio = 0.66
- m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
- m.rowList.rowItemSpacing = [[5, 0]]
- m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
- m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
- m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
- m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
- m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
- end if
-end sub
-
-sub handleHeroDetails()
- if m.flag
- m.flag = false
- handleUpdate()
- else
- handleItemFocusChange()
- end if
-end sub
-
-sub handleAnimationDone()
- if m.fadeOutAnimation.state = "stopped"
- handleUpdate()
- m.fadeInAnimation.control = "start"
- end if
-end sub
-
-sub handleItemFocusChange()
- m.fadeOutAnimation.control = "start"
-end sub
-
-sub handleUpdate()
- m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
- m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
- m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
- m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
-end sub
-
-sub handleItemSelected()
- m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
- itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
- m.createScreen.content = itemDetailsNode
- m.top.appendChild(m.createScreen)
- m.createScreen.visible = false
- toggleDetails()
-end sub
-
-sub toggleDetails()
- m.rowList.visible = not m.rowList.visible
- m.heroDetailsId.visible = not m.heroDetailsId.visible
- m.createScreen.visible = not m.createScreen.visible
- if m.createScreen.visible
- m.createScreen.setFocus(true)
- else
- m.rowList.setFocus(true)
- end if
-end sub
-
-
-' Handling entering and exiting the Details Screen
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press then
- if key = "back" and m.createScreen.visible
- toggleDetails()
- return true
- else if key = "right" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
- return true
- else if key = "left" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
- return true
- end if
- end if
- return false
-end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008144149.brs b/.history/components/rowListScene_20211008144149.brs
deleted file mode 100644
index de53a3e..0000000
--- a/.history/components/rowListScene_20211008144149.brs
+++ /dev/null
@@ -1,99 +0,0 @@
-sub init()
- m.global.addField("ratio", "float", FALSE)
- m.flag = true
- m.global.ratio = 1
- m.rowList = m.top.findNode("mainRowList")
- m.heroDetailsId = m.top.findNode("heroDetailsId")
- m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
- m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
- m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
- m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
- m.fadeInAnimation = m.top.findNode("fadeInAnimation")
- m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
- m.rowList.content = createObject("roSGNode", "RowListContent")
- m.rowList.setFocus(true)
- m.top.observeField("HeroDetails", "handleHeroDetails")
- m.rowList.observeField("rowItemSelected", "handleItemSelected")
- m.fadeOutAnimation.observeField("state", "handleAnimationDone")
-
-
- ' Handling Responsivness
- videoMode = createObject("roDeviceInfo")
- if videoMode.GetVideoMode() = "720p"
- m.global.ratio = 0.66
- end if
- if m.global.ratio = 0.66
- m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
- m.rowList.rowItemSpacing = [[5, 0]]
- m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
- m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
- m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
- m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
- m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
- end if
-end sub
-
-sub handleHeroDetails()
- if m.flag
- m.flag = false
- handleUpdate()
- else
- handleItemFocusChange()
- end if
-end sub
-
-sub handleAnimationDone()
- if m.fadeOutAnimation.state = "stopped"
- handleUpdate()
- m.fadeInAnimation.control = "start"
- end if
-end sub
-
-sub handleItemFocusChange()
- m.fadeOutAnimation.control = "start"
-end sub
-
-sub handleUpdate()
- m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
- m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
- m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
- m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
-end sub
-
-sub handleItemSelected()
- m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
- itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
- m.createScreen.content = itemDetailsNode
- m.top.appendChild(m.createScreen)
- m.createScreen.visible = false
- toggleDetails()
-end sub
-
-sub toggleDetails()
- m.rowList.visible = not m.rowList.visible
- m.heroDetailsId.visible = not m.heroDetailsId.visible
- m.createScreen.visible = not m.createScreen.visible
- if m.createScreen.visible
- m.createScreen.setFocus(true)
- else
- m.rowList.setFocus(true)
- end if
-end sub
-
-
-' Handling navigating and exiting the Details Screen
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press then
- if key = "back" and m.createScreen.visible
- toggleDetails()
- return true
- else if key = "right" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
- return true
- else if key = "left" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
- return true
- end if
- end if
- return false
-end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008144320.brs b/.history/components/rowListScene_20211008144320.brs
deleted file mode 100644
index f9c63c8..0000000
--- a/.history/components/rowListScene_20211008144320.brs
+++ /dev/null
@@ -1,101 +0,0 @@
-sub init()
- m.global.addField("ratio", "float", FALSE)
- m.flag = true
- m.global.ratio = 1
- m.rowList = m.top.findNode("mainRowList")
- m.heroDetailsId = m.top.findNode("heroDetailsId")
- m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
- m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
- m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
- m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
- m.fadeInAnimation = m.top.findNode("fadeInAnimation")
- m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
- m.rowList.content = createObject("roSGNode", "RowListContent")
- m.rowList.setFocus(true)
- m.top.observeField("HeroDetails", "handleHeroDetails")
- m.rowList.observeField("rowItemSelected", "handleItemSelected")
- m.fadeOutAnimation.observeField("state", "handleAnimationDone")
-
-
- ' Handling Responsivness
- videoMode = createObject("roDeviceInfo")
- if videoMode.GetVideoMode() = "720p"
- m.global.ratio = 0.66
- end if
- if m.global.ratio = 0.66
- m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
- m.rowList.rowItemSpacing = [[5, 0]]
- m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
- m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
- m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
- m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
- m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
- end if
-end sub
-
-sub handleHeroDetails()
- if m.flag
- m.flag = false
- handleUpdate()
- else
- handleItemFocusChange()
- end if
-end sub
-
-sub handleAnimationDone()
- if m.fadeOutAnimation.state = "stopped"
- handleUpdate()
- m.fadeInAnimation.control = "start"
- end if
-end sub
-
-sub handleItemFocusChange()
- m.fadeOutAnimation.control = "start"
-end sub
-
-' Update the text of the data in the details page
-sub handleUpdate()
- m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
- m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
- m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
- m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
-end sub
-
-' Clicking a Row List item
-sub handleItemSelected()
- m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
- itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
- m.createScreen.content = itemDetailsNode
- m.top.appendChild(m.createScreen)
- m.createScreen.visible = false
- toggleDetails()
-end sub
-
-' Toggle if the details screen is visible or not
-sub toggleDetails()
- m.rowList.visible = not m.rowList.visible
- m.heroDetailsId.visible = not m.heroDetailsId.visible
- m.createScreen.visible = not m.createScreen.visible
- if m.createScreen.visible
- m.createScreen.setFocus(true)
- else
- m.rowList.setFocus(true)
- end if
-end sub
-
-' Handling navigating and exiting the Details Screen
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press then
- if key = "back" and m.createScreen.visible
- toggleDetails()
- return true
- else if key = "right" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
- return true
- else if key = "left" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
- return true
- end if
- end if
- return false
-end function
\ No newline at end of file
diff --git a/.history/components/rowListScene_20211008145431.brs b/.history/components/rowListScene_20211008145431.brs
deleted file mode 100644
index e2fbb84..0000000
--- a/.history/components/rowListScene_20211008145431.brs
+++ /dev/null
@@ -1,104 +0,0 @@
-sub init()
- m.global.addField("ratio", "float", FALSE)
- m.flag = true
- m.global.ratio = 1
- m.rowList = m.top.findNode("mainRowList")
- m.heroDetailsId = m.top.findNode("heroDetailsId")
- m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
- m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
- m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
- m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
- m.fadeInAnimation = m.top.findNode("fadeInAnimation")
- m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
- m.rowList.content = createObject("roSGNode", "RowListContent")
- m.rowList.setFocus(true)
- m.top.observeField("HeroDetails", "handleHeroDetails")
- m.rowList.observeField("rowItemSelected", "handleItemSelected")
- m.fadeOutAnimation.observeField("state", "handleAnimationDone")
-
-
- ' Handling Responsivness
- videoMode = createObject("roDeviceInfo")
- if videoMode.GetVideoMode() = "720p"
- m.global.ratio = 0.66
- end if
- if m.global.ratio = 0.66
- m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
- m.rowList.rowItemSpacing = [[5, 0]]
- m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
- m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
- m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
- m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
- m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
- end if
-end sub
-
-' changing the details on the background OR animate focus
-sub handleHeroDetails()
- if m.flag
- m.flag = false
- handleUpdate()
- else
- handleItemFocusChange()
- end if
-end sub
-
-' animate the changing of the background's data on item focus change
-sub handleAnimationDone()
- if m.fadeOutAnimation.state = "stopped"
- handleUpdate()
- m.fadeInAnimation.control = "start"
- end if
-end sub
-
-' Start animating the changing of the background data on scroll
-sub handleItemFocusChange()
- m.fadeOutAnimation.control = "start"
-end sub
-
-' Update the text of the data in the details page
-sub handleUpdate()
- m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
- m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
- m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
- m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
-end sub
-
-' Clicking a Row List item
-sub handleItemSelected()
- m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
- itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
- m.createScreen.content = itemDetailsNode
- m.top.appendChild(m.createScreen)
- m.createScreen.visible = false
- toggleDetails()
-end sub
-
-' Toggle if the details screen is visible or not
-sub toggleDetails()
- m.rowList.visible = not m.rowList.visible
- m.heroDetailsId.visible = not m.heroDetailsId.visible
- m.createScreen.visible = not m.createScreen.visible
- if m.createScreen.visible
- m.createScreen.setFocus(true)
- else
- m.rowList.setFocus(true)
- end if
-end sub
-
-' Handling navigating and exiting the Details Screen
-function onKeyEvent(key as String, press as Boolean) as Boolean
- if press then
- if key = "back" and m.createScreen.visible
- toggleDetails()
- return true
- else if key = "right" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
- return true
- else if key = "left" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
- return true
- end if
- end if
- return false
-end function
\ No newline at end of file
From 14f15698a11ae3b659bca9402c1cf44892ea8da1 Mon Sep 17 00:00:00 2001
From: vampirekiddo <33176106+vampirekiddo@users.noreply.github.com>
Date: Sat, 16 Oct 2021 21:17:39 +0200
Subject: [PATCH 16/17] Delete .clj-kondo/.cache/2021.09.25 directory
---
.clj-kondo/.cache/2021.09.25/lock | 0
1 file changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 .clj-kondo/.cache/2021.09.25/lock
diff --git a/.clj-kondo/.cache/2021.09.25/lock b/.clj-kondo/.cache/2021.09.25/lock
deleted file mode 100644
index e69de29..0000000
From e40ac99ebc77f3471eb21f249fb803d02a53476a Mon Sep 17 00:00:00 2001
From: Mostafa Cherri
Date: Sat, 30 Oct 2021 20:51:32 +0300
Subject: [PATCH 17/17] Simplify the code and fix it
---
components/ItemDetailsScreen.xml | 6 +-
...DataContent.xml => RowItemDataContent.xml} | 2 +-
...{rowListContent.xml => RowListContent.xml} | 2 +-
.../{rowListItem.xml => RowListItem.xml} | 4 +-
components/RowListScene.xml | 25 ++++
components/itemDetailsScreen.brs | 43 ++++--
components/rowListContent.brs | 10 +-
components/rowListItem.brs | 46 +++----
components/rowListScene.brs | 127 ++++++++++--------
components/rowListScene.xml | 27 ----
components/tasks/httpTask.brs | 6 +-
manifest | 5 +-
12 files changed, 167 insertions(+), 136 deletions(-)
rename components/{rowItemDataContent.xml => RowItemDataContent.xml} (87%)
rename components/{rowListContent.xml => RowListContent.xml} (69%)
rename components/{rowListItem.xml => RowListItem.xml} (87%)
create mode 100644 components/RowListScene.xml
delete mode 100644 components/rowListScene.xml
diff --git a/components/ItemDetailsScreen.xml b/components/ItemDetailsScreen.xml
index 821084b..2953cf2 100644
--- a/components/ItemDetailsScreen.xml
+++ b/components/ItemDetailsScreen.xml
@@ -1,11 +1,13 @@
-
+
+
+
-
+
diff --git a/components/rowItemDataContent.xml b/components/RowItemDataContent.xml
similarity index 87%
rename from components/rowItemDataContent.xml
rename to components/RowItemDataContent.xml
index 84cbb44..42accf3 100644
--- a/components/rowItemDataContent.xml
+++ b/components/RowItemDataContent.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/components/rowListContent.xml b/components/RowListContent.xml
similarity index 69%
rename from components/rowListContent.xml
rename to components/RowListContent.xml
index f70ce16..28e7d8e 100644
--- a/components/rowListContent.xml
+++ b/components/RowListContent.xml
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/components/rowListItem.xml b/components/RowListItem.xml
similarity index 87%
rename from components/rowListItem.xml
rename to components/RowListItem.xml
index 897af09..ca927f0 100644
--- a/components/rowListItem.xml
+++ b/components/RowListItem.xml
@@ -5,9 +5,9 @@
-
+
-
+
diff --git a/components/RowListScene.xml b/components/RowListScene.xml
new file mode 100644
index 0000000..34ee4f6
--- /dev/null
+++ b/components/RowListScene.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/itemDetailsScreen.brs b/components/itemDetailsScreen.brs
index c666195..c6a9a68 100644
--- a/components/itemDetailsScreen.brs
+++ b/components/itemDetailsScreen.brs
@@ -1,20 +1,29 @@
sub init()
- m.itemTitle = m.top.findNode("itemTitle")
- m.itemDescription = m.top.findNode("itemDescription")
- m.itemTags = m.top.findNode("itemTags")
- m.itemTime = m.top.findNode("itemTime")
- m.ButtonGroup = m.top.findNode("ButtonGroup")
+ m.mainContent = m.top.findNode("mainContent")
+ m.itemTitle = m.mainContent.findNode("itemTitle")
+ m.itemDescription = m.mainContent.findNode("itemDescription")
+ m.itemTags = m.mainContent.findNode("itemTags")
+ m.itemTime = m.mainContent.findNode("itemTime")
+ m.ButtonGroup = m.mainContent.findNode("ButtonGroup")
m.top.ObserveField("content", "handleItemDetails")
m.ButtonGroup.focusedTextFont = "font:LargeBoldSystemFont"
m.ButtonGroup.textFont = "font:LargeBoldSystemFont"
m.ButtonGroup.vertAlignment = "center"
m.ButtonGroup.horizAlignment = "center"
+
+
+ ratio = m.global.ratio
+
+ m.mainContent.translation = [cint(m.mainContent.translation[0] * ratio), cint(m.mainContent.translation[1] * ratio)]
+
+ m.watch = m.ButtonGroup.findNode("watch")
+ m.plus = m.ButtonGroup.findNode("plus")
end sub
sub handleItemDetails()
m.itemTitle.text = m.top.content.title
m.itemDescription.text = m.top.content.description
- m.itemTime.text = "Duration : " + FormatDuration(m.top.content.time) + " Hour(s)"
+ m.itemTime.text = "Duration : " + formatDuration(m.top.content.time) + " Hour(s)"
if m.top.content.tags <> invalid
seperator = ""
for each tag in m.top.content.tags
@@ -26,13 +35,19 @@ sub handleItemDetails()
end if
end sub
-function FormatDuration(duration as Integer) as String
- minutes = (duration \ 60).ToStr()
- seconds = duration MOD 60
- if seconds < 10
- seconds = "0" + seconds.ToStr()
- else
- seconds = seconds.ToStr()
+function formatDuration(duration as integer) as string
+ minutes = (duration \ 60).toStr()
+ seconds = (duration MOD 60).toStr()
+ if len(seconds) < 2
+ seconds = "0" + seconds
end if
return minutes + ":" + seconds
-end function
\ No newline at end of file
+end function
+
+sub focusWatch()
+ m.watch.setFocus(true)
+end sub
+
+sub focusPlus()
+ m.plus.setFocus(true)
+end sub
diff --git a/components/rowListContent.brs b/components/rowListContent.brs
index 613a952..546beda 100644
--- a/components/rowListContent.brs
+++ b/components/rowListContent.brs
@@ -1,9 +1,13 @@
sub init()
m.http = createObject("roSGNode", "httpTask")
- m.http.request = { payload: {
+ m.http.request = {
+ payload: {
userId: 1,
title: "WOW, IT WORKED ^_^",
- }, url: "https://alghool.net/RokuDev/data.json", requestType: "GET" }
+ },
+ url: "https://alghool.net/RokuDev/data.json",
+ requestType: "GET"
+ }
m.http.control = "RUN"
m.http.observeFieldScoped("response", "populateRowList")
end sub
@@ -16,7 +20,7 @@ sub populateRowList()
itemData = itemNode.createChild("rowItemDataContent")
itemData.setFields({
title: data.title
- HDPosterURL: data.thumbnail
+ hdPosterURL: data.thumbnail
description: data.longDescription
tags: data.tags
time: data.time
diff --git a/components/rowListItem.brs b/components/rowListItem.brs
index d69ae6b..ff4476d 100644
--- a/components/rowListItem.brs
+++ b/components/rowListItem.brs
@@ -4,42 +4,42 @@ sub init()
m.itemMask = m.top.findNode("itemMask")
m.itemDescription = m.top.findNode("itemDescription")
m.parentComponent = m.top.getScene()
+
+ ratio = m.global.ratio
+
+ m.itemPoster.scaleRotateCenter = [cint(m.itemPoster.scaleRotateCenter[0] * ratio), cint(m.itemPoster.scaleRotateCenter[1] * ratio)]
+ m.itemPoster.width = cint(m.itemPoster.width * ratio)
+ m.itemPoster.height = cint(m.itemPoster.height * ratio)
+ m.itemPoster.translation = [cint(m.itemPoster.translation[0] * ratio), cint(m.itemPoster.translation[1] * ratio)]
+
+ m.itemMask.width = cint(m.itemMask.width * ratio)
+ m.itemMask.height = cint(m.itemMask.height * ratio)
+ m.itemMask.scaleRotateCenter = [cint(m.itemMask.scaleRotateCenter[0] * ratio), cint(m.itemMask.scaleRotateCenter[1] * ratio)]
+
+ m.itemTitle.width = cint(m.itemTitle.width * ratio)
+ m.itemTitle.translation = [cint(m.itemTitle.translation[0] * ratio), cint(m.itemTitle.translation[1] * ratio)]
+ m.itemTitle.scaleRotateCenter = [cint(m.itemTitle.scaleRotateCenter[0] * ratio), cint(m.itemTitle.scaleRotateCenter[1] * ratio)]
+ m.itemTitle.font.size = cint(32 * ratio)
+
+ m.itemDescription.width = cint(m.itemDescription.width * ratio)
+ m.itemDescription.translation = [cint(m.itemDescription.translation[0] * ratio), cint(m.itemDescription.translation[1] * ratio)]
+ m.itemDescription.scaleRotateCenter = [cint(m.itemDescription.scaleRotateCenter[0] * ratio), cint(m.itemDescription.scaleRotateCenter[1] * ratio)]
+ m.itemDescription.font.size = cint(16 * ratio)
end sub
sub showContent()
itemContent = m.top.itemContent
m.TITLE = itemContent.title
- m.itemPoster.uri = itemContent.HDPosterUrl
+ m.itemPoster.uri = itemContent.hdPosterURL
m.itemTitle.text = itemContent.title
m.itemDescription.text = itemContent.description
- m.itemTitle.font.size = INT(32 * m.global.ratio)
- m.itemDescription.font.size = INT(24 * m.global.ratio)
- m.itemTitle.width = INT(m.itemTitle.width * m.global.ratio)
- m.itemDescription.width = INT(m.itemDescription.width * m.global.ratio)
- m.itemTitle.translation = [INT(m.itemTitle.translation[0] * m.global.ratio), INT(m.itemTitle.translation[1] * m.global.ratio)]
- m.itemDescription.translation = [INT(m.itemDescription.translation[0] * m.global.ratio), INT(m.itemDescription.translation[1] * m.global.ratio)]
- m.itemMask.width = INT(m.itemMask.width * m.global.ratio)
- m.itemMask.height = INT(m.itemMask.height * m.global.ratio)
- m.itemPoster.width = INT(m.itemPoster.width * m.global.ratio)
- m.itemPoster.height = INT(m.itemPoster.height * m.global.ratio)
end sub
sub handleFocus()
scale = 1 + (m.top.focusPercent * 0.15)
m.itemPoster.scale = [scale, scale]
- if m.top.focusPercent = 1
- m.parentComponent.backgroundURI = m.itemPoster.uri
- m.parentComponent.HeroDetails = {
- MainBoldLabel: m.itemTitle.text
- DateAndDurationLabel: "21 Sep 21 | 3m"
- DescriptionLabel: m.itemDescription.text
- CategoryLabel: "World"
- focus: m.itemPoster.uri
- }
- end if
end sub
sub handleRowFocus()
- focusPercent = m.top.rowFocusPercent
- m.itemMask.opacity = 0.85 - (focusPercent * 0.85)
+ m.itemMask.opacity = 0.85 - (m.top.rowFocusPercent * 0.85)
end sub
\ No newline at end of file
diff --git a/components/rowListScene.brs b/components/rowListScene.brs
index e2fbb84..02d77b2 100644
--- a/components/rowListScene.brs
+++ b/components/rowListScene.brs
@@ -1,102 +1,117 @@
sub init()
m.global.addField("ratio", "float", FALSE)
- m.flag = true
- m.global.ratio = 1
+ m.global.ratio = 1.0
+ m.mainOverlay = m.top.findNode("mainOverlay")
m.rowList = m.top.findNode("mainRowList")
- m.heroDetailsId = m.top.findNode("heroDetailsId")
- m.MainBoldLabel = m.heroDetailsId.findNode("MainBoldLabel")
- m.DateAndDurationLabel = m.heroDetailsId.findNode("DateAndDurationLabel")
- m.DescriptionLabel = m.heroDetailsId.findNode("DescriptionLabel")
- m.CategoryLabel = m.heroDetailsId.findNode("CategoryLabel")
+ m.heroDetails = m.top.findNode("heroDetails")
+ m.providerLogo = m.heroDetails.findNode("providerLogo")
+ m.mainBoldLabel = m.heroDetails.findNode("mainBoldLabel")
+ m.dateAndDurationLabel = m.heroDetails.findNode("dateAndDurationLabel")
+ m.descriptionLabel = m.heroDetails.findNode("descriptionLabel")
+ m.categoryLabel = m.heroDetails.findNode("categoryLabel")
m.fadeInAnimation = m.top.findNode("fadeInAnimation")
m.fadeOutAnimation = m.top.findNode("fadeOutAnimation")
m.rowList.content = createObject("roSGNode", "RowListContent")
m.rowList.setFocus(true)
- m.top.observeField("HeroDetails", "handleHeroDetails")
m.rowList.observeField("rowItemSelected", "handleItemSelected")
+ m.rowList.observeField("rowItemFocused", "onRowItemFocused")
m.fadeOutAnimation.observeField("state", "handleAnimationDone")
' Handling Responsivness
videoMode = createObject("roDeviceInfo")
if videoMode.GetVideoMode() = "720p"
- m.global.ratio = 0.66
- end if
- if m.global.ratio = 0.66
- m.rowList.rowHeights = [Cdbl(m.rowList.rowHeights[0] * m.global.ratio) + 10]
- m.rowList.rowItemSpacing = [[5, 0]]
- m.rowList.focusXOffset = [Cdbl(m.rowList.focusXOffset[0] * m.global.ratio) - 50]
- m.rowList.rowItemSize = [[INT(m.rowList.rowItemSize[0][0] * m.global.ratio) + 20, INT(m.rowList.rowItemSize[0][1] * m.global.ratio)]]
- m.rowList.translation = [INT(m.rowList.translation[0] * m.global.ratio), INT(m.rowList.translation[1] / m.global.ratio) - 100]
- m.rowList.rowLabelOffset = [[INT(m.rowList.rowLabelOffset[0][0] * m.global.ratio), INT(m.rowList.rowLabelOffset[0][1] * m.global.ratio) - 6]]
- m.rowList.itemSize = [1400, INT(m.rowList.itemSize[1] * m.global.ratio)]
- end if
-end sub
+ ratio = 2.0 / 3
+ m.global.ratio = ratio
-' changing the details on the background OR animate focus
-sub handleHeroDetails()
- if m.flag
- m.flag = false
- handleUpdate()
- else
- handleItemFocusChange()
+ m.mainOverlay.width = cint(m.mainOverlay.width * ratio)
+ m.mainOverlay.height = cint(m.mainOverlay.height * ratio)
+
+ print m.heroDetails.translation[0] * ratio, m.heroDetails.translation[0]
+ m.heroDetails.translation = [cint(m.heroDetails.translation[0] * ratio), cint(m.heroDetails.translation[1] * ratio)]
+
+ m.providerLogo.translation = [cint(m.providerLogo.translation[0] * ratio), cint(m.providerLogo.translation[1] * ratio)]
+
+ m.mainBoldLabel.translation = [cint(m.mainBoldLabel.translation[0] * ratio), cint(m.mainBoldLabel.translation[1] * ratio)]
+ m.mainBoldLabel.width = cint(m.mainBoldLabel.width * ratio)
+ m.mainBoldLabel.font.size = cint(46 * ratio)
+
+ m.dateAndDurationLabel.translation = [cint(m.dateAndDurationLabel.translation[0] * ratio), cint(m.dateAndDurationLabel.translation[1] * ratio)]
+ m.dateAndDurationLabel.font.size = cint(36 * ratio)
+
+ m.descriptionLabel.translation = [cint(m.descriptionLabel.translation[0] * ratio), cint(m.descriptionLabel.translation[1] * ratio)]
+ m.descriptionLabel.width = cint(m.descriptionLabel.width * ratio)
+ m.descriptionLabel.font.size = cint(36 * ratio)
+
+ m.categoryLabel.translation = [cint(m.categoryLabel.translation[0] * ratio), cint(m.categoryLabel.translation[1] * ratio)]
+ m.categoryLabel.font.size = cint(46 * ratio)
+
+ m.rowList.focusXOffset = [cint(m.rowList.focusXOffset[0] * ratio)]
+ m.rowList.translation = [cint(m.rowList.translation[0] * ratio), cint(m.rowList.translation[1] * ratio)]
+ m.rowList.rowLabelOffset = [[cint(m.rowList.rowLabelOffset[0][0] * ratio), cint(m.rowList.rowLabelOffset[0][1] * ratio)]]
+ m.rowList.itemSize = [cint(m.rowList.itemSize[0] * ratio), cint(m.rowList.itemSize[1] * ratio)]
+ m.rowList.rowItemSize = [[cint(m.rowList.rowItemSize[0][0] * ratio), cint(m.rowList.rowItemSize[0][1] * ratio)]]
+ m.rowList.rowHeights = [cint(m.rowList.rowHeights[0] * ratio)]
end if
end sub
' animate the changing of the background's data on item focus change
sub handleAnimationDone()
if m.fadeOutAnimation.state = "stopped"
- handleUpdate()
+ m.mainOverlay.uri = getItem(m.rowList.rowItemFocused).hdPosterURL
m.fadeInAnimation.control = "start"
end if
end sub
-' Start animating the changing of the background data on scroll
-sub handleItemFocusChange()
- m.fadeOutAnimation.control = "start"
-end sub
-
-' Update the text of the data in the details page
-sub handleUpdate()
- m.MainBoldLabel.text = m.top.HeroDetails.MainBoldLabel
- m.DateAndDurationLabel.text = m.top.HeroDetails.DateAndDurationLabel
- m.DescriptionLabel.text = m.top.HeroDetails.DescriptionLabel
- m.CategoryLabel.text = m.top.HeroDetails.CategoryLabel
-end sub
-
' Clicking a Row List item
sub handleItemSelected()
- m.createScreen = createObject("roSGNOde", "ItemDetailsScreen")
- itemDetailsNode = m.rowList.content.getChild(m.rowList.rowItemSelected[0]).getChild(m.rowList.rowItemSelected[1])
- m.createScreen.content = itemDetailsNode
- m.top.appendChild(m.createScreen)
- m.createScreen.visible = false
+ m.itemDetailsScreen = createObject("roSGNOde", "ItemDetailsScreen")
+ m.itemDetailsScreen.content = getItem(m.rowList.rowItemSelected)
+ m.itemDetailsScreen.visible = false
+ m.top.appendChild(m.itemDetailsScreen)
toggleDetails()
end sub
+function getItem(item as object) as object
+ return m.rowList.content.getChild(item[0]).getChild(item[1])
+end function
+
+sub onRowItemFocused()
+ item = getItem(m.rowList.rowItemFocused)
+ m.mainBoldLabel.text = item.title
+ m.dateAndDurationLabel.text = "21 Sep 21 | 3m"
+ m.descriptionLabel.text = item.description
+ m.categoryLabel.text = "World"
+ m.fadeOutAnimation.control = "start"
+end sub
+
' Toggle if the details screen is visible or not
sub toggleDetails()
m.rowList.visible = not m.rowList.visible
- m.heroDetailsId.visible = not m.heroDetailsId.visible
- m.createScreen.visible = not m.createScreen.visible
- if m.createScreen.visible
- m.createScreen.setFocus(true)
+ m.heroDetails.visible = not m.heroDetails.visible
+ m.itemDetailsScreen.visible = not m.itemDetailsScreen.visible
+ if m.itemDetailsScreen.visible
+ m.itemDetailsScreen.setFocus(true)
else
m.rowList.setFocus(true)
+ m.itemDetailsScreen = invalid
end if
end sub
' Handling navigating and exiting the Details Screen
-function onKeyEvent(key as String, press as Boolean) as Boolean
+function onKeyEvent(key as string, press as boolean) as boolean
if press then
- if key = "back" and m.createScreen.visible
+ print "onKeyEvent "; key
+ if key = "back" and m.itemDetailsScreen = invalid
+ return false
+ else if key = "back" and m.itemDetailsScreen.visible
toggleDetails()
return true
- else if key = "right" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(1).setFocus(true)
+ else if key = "right" and m.itemDetailsScreen.visible
+ m.itemDetailsScreen.callFunc("focusPlus")
return true
- else if key = "left" and m.createScreen.visible
- m.createScreen.getChild(0).getChild(4).getChild(0).setFocus(true)
+ else if key = "left" and m.itemDetailsScreen.visible
+ m.itemDetailsScreen.callFunc("focusWatch")
return true
end if
end if
diff --git a/components/rowListScene.xml b/components/rowListScene.xml
deleted file mode 100644
index d59dca7..0000000
--- a/components/rowListScene.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/components/tasks/httpTask.brs b/components/tasks/httpTask.brs
index aee48f2..00bf58d 100644
--- a/components/tasks/httpTask.brs
+++ b/components/tasks/httpTask.brs
@@ -29,14 +29,14 @@ end function
function fire(request as Object) as Object
httpRequest = initiateHttpClient(request.url)
- requestId = httpRequest.getIdentity().ToStr()
+ requestId = httpRequest.getIdentity().toStr()
m.urlRequest[requestId] = {
request:httpRequest
}
if checkRequestType(request.requestType)
httpRequest.AsyncPostFromString(formatJson(request.payload))
else
- httpRequest.AsyncGetToString()
+ httpRequest.AsyncGettoString()
end if
end function
@@ -46,7 +46,7 @@ function handleResponse(responseString as String, message as Object, isOk as Boo
else
body = "An Error has Occurred!!"
end if
- requestId = message.GetSourceIdentity().ToStr()
+ requestId = message.GetSourceIdentity().toStr()
m.urlRequest[requestId] = invalid
return {
requestId: requestId
diff --git a/manifest b/manifest
index 3a2d81f..f832eb5 100644
--- a/manifest
+++ b/manifest
@@ -7,17 +7,14 @@ minor_version=0
build_version=00000
mm_icon_focus_hd=pkg:/images/rsgde_mm_focus_hd.jpg
-
mm_icon_focus_sd=pkg:/images/rde_mm_focus_sd.png
splash_screen_sd=pkg:/images/rde_splash_sd.jpg
-
splash_screen_hd=pkg:/images/rsgde_splash_hd.jpg
-
splash_screen_fhd=pkg:/images/rde_splash_fhd.jpg
splash_color=#662D91
splash_min_time=1000
-ui_resolutions = "fhd,hd"
+ui_resolutions=fhd,hd