diff --git a/Plex/images/black/grid-spacer.png b/Plex/images/black/grid-spacer.png new file mode 100644 index 00000000..b457a611 Binary files /dev/null and b/Plex/images/black/grid-spacer.png differ diff --git a/Plex/images/grid-spacer.png b/Plex/images/grid-spacer.png new file mode 100644 index 00000000..60968443 Binary files /dev/null and b/Plex/images/grid-spacer.png differ diff --git a/Plex/source/GridScreen.brs b/Plex/source/GridScreen.brs index 24d95708..5ac4991b 100644 --- a/Plex/source/GridScreen.brs +++ b/Plex/source/GridScreen.brs @@ -163,7 +163,9 @@ Function showGridScreen() As Integer end for end if + m.isDescriptionVisible = true if RegRead("rf_grid_description_"+isType, "preferences", "enabled") <> "enabled" then + m.isDescriptionVisible = false m.screen.SetDescriptionVisible(false) end if Debug("isType: " + tostr(isType)) @@ -229,6 +231,8 @@ Function gridHandleMessage(msg) As Boolean if context <> invalid then item = context[index] if item <> invalid then + ' ignore spacers + if item <> invalid and tostr(item.key) = "_invalid_spacer_" then return true ' user entered a section - remeber the last section to focus when launching the channel again vc = GetViewController() @@ -278,6 +282,16 @@ Function gridHandleMessage(msg) As Boolean item = m.contentArray[m.selectedRow][m.focusedIndex] end if + ' if the full grid spacer is enabled, check if we need to hid or show the description + if RegRead("rf_fullgrid_spacer", "preferences", "disabled") = "enabled" then + if item <> invalid and tostr(item.key) = "_invalid_spacer_" then + m.screen.SetDescriptionVisible(false) + return true + else if m.isDescriptionVisible = true then + m.screen.SetDescriptionVisible(true) + end if + end if + vc = GetViewController() if vc.Home <> invalid AND m.screenid <> vc.Home.ScreenID then if item <> invalid and tostr(item.type) = "photo" and tostr(item.nodename) <> "Directory" then @@ -398,6 +412,9 @@ Function gridHandleMessage(msg) As Boolean context = m.contentArray[m.selectedRow] item = context[m.focusedIndex] + + ' ignore spacers + if item <> invalid and tostr(item.key) = "_invalid_spacer_" then return true itype = item.contenttype if itype = invalid then itype = item.type @@ -424,6 +441,12 @@ Function gridHandleMessage(msg) As Boolean Debug("--- Not showing prefs on ctype:" + tostr(item.contenttype) + " itype:" + tostr(item.type) ) end if else if msg.isRemoteKeyPressed() then + context = m.contentArray[m.selectedRow] + item = context[m.focusedIndex] + + ' ignore spacers + if item <> invalid and item.key = "_invalid_spacer_" then return true + if msg.GetIndex() = 13 then sec_metadata = getSectionType() ' sometimes we don't know the item is photo ( appClips ) 'if tostr(sec_metadata.type) = "photo" and m.item <> invalid and m.item.contenttype <> "section" then @@ -484,6 +507,19 @@ Sub gridOnDataLoaded(row As Integer, data As Object, startItem As Integer, count end if end if + ' Add a spacer item between the 1st and last item - exclude the full gred header row + if RegRead("rf_fullgrid_spacer", "preferences", "disabled") = "enabled" then + if m.gridrowsize <> invalid and data.Count() = m.gridrowsize and m.isfullgrid = true and (NOT(m.loader.hasHeaderRow = true) or row > 0) then + imageDir = GetGlobalAA().Lookup("rf_theme_dir") + spacer = {} + spacer.title = "" + spacer.key = "_invalid_spacer_" + spacer.SDPosterURL = imageDir + "grid-spacer.png" + spacer.HDPosterURL = imageDir + "grid-spacer.png" + data[m.gridrowsize] = spacer + end if + end if + m.contentArray[row] = data ' Don't bother showing empty rows diff --git a/Plex/source/PaginatedDataLoader.brs b/Plex/source/PaginatedDataLoader.brs index 7c8a704d..d711f0fc 100644 --- a/Plex/source/PaginatedDataLoader.brs +++ b/Plex/source/PaginatedDataLoader.brs @@ -162,7 +162,7 @@ Function createPaginatedLoader(container, initialLoadSize, pageSize, item = inva header_row = CreateObject("roAssociativeArray") header_row.content = subsecItems header_row.loadStatus = 0 ' 0:Not loaded, 1:Partially loaded, 2:Fully loaded - header_row.key = "_subsec_" + header_row.key = "_invalid_headerrow_" header_row.name = firstof(item.title,"Sub Sections") header_row.pendingRequests = 0 header_row.countLoaded = 0 @@ -180,7 +180,7 @@ Function createPaginatedLoader(container, initialLoadSize, pageSize, item = inva for index = 0 to loader.contentArray.Count() - 1 status = loader.contentArray[index] loader.names[index] = status.name - if status.key = "_search_" or status.key = "_subsec_" then + if status.key = "_search_" or status.key = "_invalid_headerrow_" then status.key = invalid end if next diff --git a/Plex/source/PreferenceScreen.brs b/Plex/source/PreferenceScreen.brs index df251cb8..9d2f8175 100644 --- a/Plex/source/PreferenceScreen.brs +++ b/Plex/source/PreferenceScreen.brs @@ -2224,6 +2224,17 @@ Function createSectionDisplayPrefsScreen(viewController) As Object default: "disabled" } + values = [ + { title: "Enabled", EnumValue: "enabled" }, + { title: "Disabled", EnumValue: "disabled" }, + + ] + obj.Prefs["rf_fullgrid_spacer"] = { + values: values + heading: "Insert a blank poster between the first and last item in a row", + default: "disabled" + } + ' Display Mode for Grid or Poster views ' { title: "Zoom", EnumValue: "zoom-to-fill", ShortDescriptionLine2: "zoom image to fill boundary" }, again, no one wants this display_modes = [ @@ -2292,7 +2303,8 @@ Function createSectionDisplayPrefsScreen(viewController) As Object obj.AddItem({title: "Grid Style/Size", ShortDescriptionLine2: "Size of Grid"}, "rf_grid_style", obj.GetEnumValue("rf_grid_style")) obj.AddItem({title: "Grid Display Mode", ShortDescriptionLine2: "Stretch or Fit images to fill the focus box"}, "rf_grid_displaymode", obj.GetEnumValue("rf_grid_displaymode")) obj.AddItem({title: "Grid Pop Out", ShortDescriptionLine2: "Description on bottom right"}, "rf_grid_description") - obj.AddItem({title: "Full Grid - hide text", ShortDescriptionLine2: "Hide text on top of each row"}, "rf_fullgrid_hidetext", obj.GetEnumValue("rf_fullgrid_hidetext")) + obj.AddItem({title: "Full Grid Hide Header", ShortDescriptionLine2: "Hide text on top of each row"}, "rf_fullgrid_hidetext", obj.GetEnumValue("rf_fullgrid_hidetext")) + obj.AddItem({title: "Full Grid Spacer", ShortDescriptionLine2: "Hide text on top of each row"}, "rf_fullgrid_spacer", obj.GetEnumValue("rf_fullgrid_spacer")) 'we can add this.. but it doesn't do much yet.. let's not totally confuse people.. yet. 'obj.AddItem({title: "Poster Display Mode", ShortDescriptionLine2: "Stretch or Fit images to fill the focus box"}, "rf_poster_displaymode", obj.GetEnumValue("rf_poster_displaymode")) obj.AddItem({title: "Close"}, "close") @@ -2310,7 +2322,7 @@ Function prefsSectionDisplayHandleMessage(msg) As Boolean m.ViewController.PopScreen(m) else if msg.isListItemSelected() then command = m.GetSelectedCommand(msg.GetIndex()) - if command = "use_grid_for_series" or command = "rf_poster_grid" or command = "rf_grid_style" or command = "rf_grid_displaymode" or command = "rf_poster_displaymode" or command = "rf_fullgrid_hidetext" or command = "rf_episode_episodic_style" or command = "section_sort" then + if command = "use_grid_for_series" or command = "rf_poster_grid" or command = "rf_grid_style" or command = "rf_grid_displaymode" or command = "rf_poster_displaymode" or command = "rf_fullgrid_hidetext" or command = "rf_episode_episodic_style" or command = "section_sort" or command = "rf_fullgrid_spacer" then m.HandleEnumPreference(command, msg.GetIndex()) else if command = "rf_grid_description" then screen = createGridDescriptionPrefsScreen(m.ViewController) diff --git a/Plex/source/rarflix_fullgrid.brs b/Plex/source/rarflix_fullgrid.brs index 289e5792..104ad6bc 100644 --- a/Plex/source/rarflix_fullgrid.brs +++ b/Plex/source/rarflix_fullgrid.brs @@ -236,7 +236,7 @@ Function createFULLgridPaginatedLoader(container, initialLoadSize, pageSize, ite header_row = CreateObject("roAssociativeArray") header_row.content = headerRow header_row.loadStatus = 0 ' 0:Not loaded, 1:Partially loaded, 2:Fully loaded - header_row.key = "_subsec_" + header_row.key = "_invalid_headerrow_" header_row.name = firstof(item.title,"Sub Sections") header_row.pendingRequests = 0 header_row.countLoaded = 0 @@ -251,7 +251,7 @@ Function createFULLgridPaginatedLoader(container, initialLoadSize, pageSize, ite for index = 0 to loader.contentArray.Count() - 1 status = loader.contentArray[index] loader.names[index] = status.name - if status.key = "_search_" or status.key = "_subsec_" then + if status.key = "_search_" or status.key = "_invalid_headerrow_" then status.key = invalid end if next