From 68e322b1caca5e867156d38b726ab47a50057a34 Mon Sep 17 00:00:00 2001 From: Neil Burrows Date: Wed, 10 Jun 2020 17:43:32 +0100 Subject: [PATCH 1/2] Updated design and functionality of ItemGrid for Movies --- components/ItemGrid2/GridItem.brs | 40 +++++++ components/ItemGrid2/GridItem.xml | 12 +++ components/ItemGrid2/ItemGrid2.brs | 133 ++++++++++++++++++++++++ components/ItemGrid2/ItemGrid2.xml | 37 +++++++ components/ItemGrid2/LoadItemsTask2.brs | 54 ++++++++++ components/ItemGrid2/LoadItemsTask2.xml | 20 ++++ components/data/JFContentItem.xml | 12 +++ components/data/MovieData.brs | 38 ++++++- components/data/MovieData.xml | 11 +- components/movies/Movies.brs | 14 --- components/movies/Movies.xml | 14 --- images/PosterFailed.png | Bin 0 -> 3687 bytes images/PosterLoading.png | Bin 0 -> 3842 bytes source/Main.brs | 4 +- source/ShowScenes.brs | 32 +----- 15 files changed, 351 insertions(+), 70 deletions(-) create mode 100644 components/ItemGrid2/GridItem.brs create mode 100644 components/ItemGrid2/GridItem.xml create mode 100644 components/ItemGrid2/ItemGrid2.brs create mode 100644 components/ItemGrid2/ItemGrid2.xml create mode 100644 components/ItemGrid2/LoadItemsTask2.brs create mode 100644 components/ItemGrid2/LoadItemsTask2.xml create mode 100644 components/data/JFContentItem.xml delete mode 100644 components/movies/Movies.brs delete mode 100644 components/movies/Movies.xml create mode 100644 images/PosterFailed.png create mode 100644 images/PosterLoading.png diff --git a/components/ItemGrid2/GridItem.brs b/components/ItemGrid2/GridItem.brs new file mode 100644 index 000000000..9fb84111d --- /dev/null +++ b/components/ItemGrid2/GridItem.brs @@ -0,0 +1,40 @@ +sub init() + m.itemPoster = m.top.findNode("itemPoster") + m.itemText = m.top.findNode("itemText") +end sub + +sub itemContentChanged() + + itemData = m.top.itemContent + + if itemData = invalid then return + + itemPoster = m.top.findNode("itemPoster") + + if itemData.type = "Movie" then + itemPoster.uri = itemData.PosterUrl + m.itemText.text = itemData.Title + return + end if + + print "Unhandled Item Type: " + itemData.type + +end sub + +' +'Resize Poster and Title Vivbility on focus change +sub focusChanged() + + if m.top.itemHasFocus = true then + m.itemPoster.width = 295 + m.itemPoster.height = 440 + m.itemPoster.translation = [0,0] + m.itemText.visible = true + else + m.itemPoster.width = 250 + m.itemPoster.height = 375 + m.itemPoster.translation = [21,35] + m.itemText.visible = false + end if + +end sub diff --git a/components/ItemGrid2/GridItem.xml b/components/ItemGrid2/GridItem.xml new file mode 100644 index 000000000..7e885f4c3 --- /dev/null +++ b/components/ItemGrid2/GridItem.xml @@ -0,0 +1,12 @@ + + + + + + + + + + +