Netvent/storyly-sdk

Skeleton view blinks for a moment while loading stories

Closed this issue · 2 comments

o-nos commented

Hello
We noticed that every time we load stories we see 4 empty circles (Skeleton view) blinking for a moment while loading stories.
This happens when we do have stories, and storyGroupList: List<StoryGroup> is not empty.

That Skeleton view hurts the overall experience with the stories. Like, why does that Skeleton view even shown for a sec when we have stories? I have no control over those 4 empty circles that occupy the screen, so that's the reason I'm raising this issue.

Environment Details

Storyly SDK Version: 1.32.0
Android SDK Version: compileSdkVersion 32
Device Model: OnePlus 10T, 6, and 6T
Device OS Version: Android 12

Expected Behavior

Stories are loaded without the Skeleton view being even shown when there're actual stories.

Current Behavior

The Skeleton view always blinks for a moment before showing the actual stories.

Steps to Reproduce

We just implemented it as you told us in your official docs.
Here's the gist of our implementation
In the gist we have logs on line 29. And that's the Logcat of that line:

D/StorylyViewHolder: onStorylyLoaded, isEmpty: false
D/StorylyViewHolder: onStorylyLoaded, isEmpty: false
D/StorylyViewHolder: onStorylyLoaded, isEmpty: false
D/StorylyViewHolder: onStorylyLoaded, isEmpty: false

we update the list 4 times here, there're stories but we see Skeleton view somewhere between 1st and 2nd call, I bet. On the 4th call of that onStorylyLoaded callback we see the actual stories.

yigcal commented

Hello @o-nos ,

Are you using the storylyLoaded callback to receive data loading state updates of StorylyView? This callback is called multiple times after StorylyView data is ready from Local data and API data after StorylyView is initialized. In addition, you can use storylyLoadFailed callback in case of any network data load fail cases.

In your case, it seems by using the dataSource and storyGroupList arguments of storylyLoaded callback, you can change the visibility of the view to VISIBLE(which will be initially GONE) when dataSource value is Local and/or API and when the size of the storyGroupList is bigger than 0.

Thanks,

o-nos commented

yes, I make use of storylyLoaded callback, and storylyLoadFailed as well.

If I rely on API data only, it's better, but it's still showing me Skeleton view for a moment when storyGroupList size > 0. Always shows, the size of stories list does not matter.

I've "fixed" this with setting this one to our background colour to match Skeleton Views, so it's "invisible".