-
Notifications
You must be signed in to change notification settings - Fork 1.3k
HomeFragment should observe wallpaper changes. #26555
HomeFragment should observe wallpaper changes. #26555
Comments
With the code from b22e500 applied I see cases in which the wallpaper is not applied until coming back to the hoomescreen. WallpaperOrNot.mp4 |
Testing the implementation from b22e500 on a OnePlus 7T Pro I see that :
At a quick glance it seems like we can set the wallpaper without affecting performance or at least significantly reducing the slowdown. An important issue that remains is shown in the above video and seems like a newly introduced one: reading the current wallpaper from the appState may happen too soon and then we would not show the wallpaper. |
Looking at this more it seems like the previous idea of parallelizing setting the wallpaper with all the setup in
|
I don't have a strong opinion about the direction we take with this, but wanted to add some additional context.
At a glance, these numbers look pretty concerning. However, we are now loading metadata about wallpapers from the remote server. Accounting for network time, this actually looks like it could be on the low-end, especially if there's ever problems with our service. The current implementation waits until this networking is finished before setting the current wallpaper. This is in order to check whether the current wallpaper is part of an expired promotion or not. It also allows us to construct the fully qualified data type of the current wallpaper using the remote metadata. Thinking about it more now, I don't think there's any good reason for for this because:
I had planned to improve storage for wallpapers generally as part of #26033, but it slipped the time constraints of the MR. I think a more robust Room or DataStore implementation would be good now that the data is growing in complexity, but I'm also not sure it's worth doing until the shape of the data has stabilized. I'm not convinced that's happened yet. For now, we could also cache the other properties I mentioned in settings and construct a useful |
Actually, since this is a bug that will affect beta and release I am going to hack together a caching mechanism to add to #26515 so that we can resolve the bug ASAP |
I'm now realizing that the networking code had not been introduced yet on the patch in question. There is still quite a bit of IO however, including downloading wallpapers if any are missing. Any change required for it will also be required for the networking code as per my concerns above. The networking code has landed in main now, however. #26515 probably should have been landed and uplifted before landing 299f887. We have two options:
|
I think the issue here is actually that |
The issue with that call is actually the usage of (Not sure why we chose to use For a Fragment the In regards to being able at this time to observe the store which is updated from FenixApplication with a new wallpaper before the Homescreen is displayed using observeManually seems to work great for me. |
…meScreen is visible. Created a new WallpapersObserver to have the functionality easier to reason about and be easier to test.
…meScreen is visible. By using Store.observeManually in a standalone coroutine we can observe the store and update the wallpapers even before onStart (in manual tests is right around onStart, certainly before the other widgets shown on homescreen). Created a new WallpapersObserver to have the functionality easier to reason about and be easier to test.
…meScreen is visible. By using Store.observeManually in a standalone coroutine we can observe the store and update the wallpapers even before onStart (in manual tests is right around onStart, certainly before the other widgets shown on homescreen). Created a new WallpapersObserver to have the functionality easier to reason about and be easier to test.
…meScreen is visible. By using Store.observeManually in a standalone coroutine we can observe the store and update the wallpapers even before onStart (in manual tests is right around onStart, certainly before the other widgets shown on homescreen). Created a new WallpapersObserver to have the functionality easier to reason about and be easier to test.
…sible. By using Store.observeManually in a standalone coroutine we can observe the store and update the wallpapers even before onStart (in manual tests is right around onStart, certainly before the other widgets shown on homescreen). Created a new WallpapersObserver to have the functionality easier to reason about and be easier to test.
Issue fixed by Matt in #26949 |
Verified as fixed on Nightly 107.0a1 from 09/20 with Google Pixel 6 (Android 13). The wallpaper set is properly displayed on homepage when the app is opened, when navigating to and from homepage and when the orientation is changed. |
With the upcoming wallpaper selection tool defined in https://mozilla-hub.atlassian.net/browse/FNXV2-21134, we need a way to actively observe changes to the current wallpaper when they are updated from the tool. The following conditions should be met:
For context, this issue is a result of conversation that took place in this comment thread: #26515 (comment)
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: