From edfb8200390ce6a6447d5f31567b2693d6891622 Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Mon, 4 Dec 2023 09:21:21 -0500 Subject: [PATCH 1/2] fix lazy loading itemgrid spinner --- components/ItemGrid/ItemGrid.bs | 3 ++- components/ItemGrid/MovieLibraryView.bs | 3 ++- components/ItemGrid/MusicLibraryView.bs | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/components/ItemGrid/ItemGrid.bs b/components/ItemGrid/ItemGrid.bs index c140f2313..c851e30b5 100644 --- a/components/ItemGrid/ItemGrid.bs +++ b/components/ItemGrid/ItemGrid.bs @@ -569,8 +569,9 @@ end sub ' 'Load next set of items sub loadMoreData() - startLoadingSpinner(false) if m.Loading = true then return + + startLoadingSpinner(false) m.Loading = true m.loadItemsTask.startIndex = m.loadedItems m.loadItemsTask.observeField("content", "ItemDataLoaded") diff --git a/components/ItemGrid/MovieLibraryView.bs b/components/ItemGrid/MovieLibraryView.bs index 9fe494015..b4c5d1304 100644 --- a/components/ItemGrid/MovieLibraryView.bs +++ b/components/ItemGrid/MovieLibraryView.bs @@ -687,8 +687,9 @@ end sub ' 'Load next set of items sub loadMoreData() - startLoadingSpinner(false) if m.Loading = true then return + + startLoadingSpinner(false) m.Loading = true m.loadItemsTask.startIndex = m.loadedItems m.loadItemsTask.observeField("content", "ItemDataLoaded") diff --git a/components/ItemGrid/MusicLibraryView.bs b/components/ItemGrid/MusicLibraryView.bs index 0ca07b5bf..77d79d62c 100644 --- a/components/ItemGrid/MusicLibraryView.bs +++ b/components/ItemGrid/MusicLibraryView.bs @@ -108,7 +108,7 @@ end sub 'Load initial set of Data sub loadInitialItems() m.loadItemsTask.control = "stop" - startLoadingSpinner() + startLoadingSpinner(false) if LCase(m.top.parentItem.json.Type) = "collectionfolder" m.top.HomeLibraryItem = m.top.parentItem.Id @@ -550,8 +550,9 @@ end sub ' 'Load next set of items sub loadMoreData() - startLoadingSpinner(false) if m.Loading = true then return + + startLoadingSpinner(false) m.Loading = true m.loadItemsTask.startIndex = m.loadedItems m.loadItemsTask.observeField("content", "ItemDataLoaded") From 1e4a404c5c332212a5af510729801990464e23d0 Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Mon, 4 Dec 2023 12:40:07 -0500 Subject: [PATCH 2/2] remove spinner when calling scenemanger.popScene() --- components/data/SceneManager.bs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/data/SceneManager.bs b/components/data/SceneManager.bs index 71f36a2fa..994443309 100644 --- a/components/data/SceneManager.bs +++ b/components/data/SceneManager.bs @@ -1,4 +1,5 @@ import "pkg:/source/roku_modules/log/LogMixin.brs" +import "pkg:/source/utils/misc.bs" sub init() m.log = log.Logger("SceneManager") @@ -120,7 +121,7 @@ sub popScene() ' Exit app if the stack is empty after removing group m.scene.exit = true end if - + stopLoadingSpinner() end sub