diff --git a/components/ItemGrid/ItemGrid.brs b/components/ItemGrid/ItemGrid.brs
index 2ddaaca2..f5bd3b9d 100644
--- a/components/ItemGrid/ItemGrid.brs
+++ b/components/ItemGrid/ItemGrid.brs
@@ -724,9 +724,10 @@ function onKeyEvent(key as string, press as boolean) as boolean
return true
else if itemToPlay <> invalid and itemToPlay.type = "Photo"
' Spawn photo player task
- photoPlayer = CreateObject("roSgNode", "PhotoPlayerTask")
- photoPlayer.itemContent = itemToPlay
- photoPlayer.control = "RUN"
+ photoPlayer = CreateObject("roSgNode", "PhotoDetails")
+ photoPlayer.items = markupGrid
+ photoPlayer.itemIndex = markupGrid.itemFocused
+ m.global.sceneManager.callfunc("pushScene", photoPlayer)
return true
end if
else if key = "left" and topGrp.isinFocusChain()
diff --git a/components/photos/PhotoDetails.brs b/components/photos/PhotoDetails.brs
index 0903a779..c65d00ac 100644
--- a/components/photos/PhotoDetails.brs
+++ b/components/photos/PhotoDetails.brs
@@ -1,13 +1,17 @@
sub init()
m.top.optionsAvailable = false ' Change once Shuffle option is added
m.top.overhangVisible = false
+ itemContentChanged()
end sub
sub itemContentChanged()
- m.LoadLibrariesTask = createObject("roSGNode", "LoadPhotoTask")
- m.LoadLibrariesTask.itemContent = m.top.itemContent
- m.LoadLibrariesTask.observeField("results", "onPhotoLoaded")
- m.LoadLibrariesTask.control = "RUN"
+ if isValidToContinue(m.top.itemIndex)
+ m.LoadLibrariesTask = createObject("roSGNode", "LoadPhotoTask")
+ itemContent = m.top.items.content.getChild(m.top.itemIndex)
+ m.LoadLibrariesTask.itemContent = itemContent
+ m.LoadLibrariesTask.observeField("results", "onPhotoLoaded")
+ m.LoadLibrariesTask.control = "RUN"
+ end if
end sub
sub onPhotoLoaded()
@@ -19,3 +23,33 @@ sub onPhotoLoaded()
message_dialog("This image type is not supported.")
end if
end sub
+
+function onKeyEvent(key as string, press as boolean) as boolean
+ if not press then return false
+
+ if key = "right"
+ if isValidToContinue(m.top.itemIndex + 1)
+ m.top.itemIndex++
+ end if
+ return true
+ end if
+
+ if key = "left"
+ if isValidToContinue(m.top.itemIndex - 1)
+ m.top.itemIndex--
+ end if
+ return true
+ end if
+
+ return false
+end function
+
+function isValidToContinue(index as integer)
+ if isValid(m.top.items) and isValid(m.top.items.content)
+ if index >= 0 and index < m.top.items.content.getChildCount()
+ return true
+ end if
+ end if
+
+ return false
+end function
diff --git a/components/photos/PhotoDetails.xml b/components/photos/PhotoDetails.xml
index ea7d7f7e..016c963f 100644
--- a/components/photos/PhotoDetails.xml
+++ b/components/photos/PhotoDetails.xml
@@ -6,7 +6,8 @@
-
+
+
diff --git a/components/photos/PhotoPlayerTask.brs b/components/photos/PhotoPlayerTask.brs
deleted file mode 100644
index 337f6da6..00000000
--- a/components/photos/PhotoPlayerTask.brs
+++ /dev/null
@@ -1,17 +0,0 @@
-sub init()
- m.top.functionName = "loadItems"
-end sub
-
-sub loadItems()
- item = m.top.itemContent
-
- group = CreateObject("roSGNode", "PhotoDetails")
- group.optionsAvailable = false
- m.global.sceneManager.callFunc("pushScene", group)
-
- group.itemContent = item
-
- ' TODO/FIXME:
- ' Wait some time and move to the next photo...
-
-end sub
diff --git a/components/photos/PhotoPlayerTask.xml b/components/photos/PhotoPlayerTask.xml
deleted file mode 100644
index 0f7ef147..00000000
--- a/components/photos/PhotoPlayerTask.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-