Add a startup activity for the status bar #3747
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Loving the Widget, but I found that I needed to disable/enable after every restart due to the ExperimentalSettings flag not being available in the project config when the StatusBarManager starts up.
This PR registers a backgroup startup activity that only runs after the project (including the application) settings have loaded.
It also moves the settings watcher into this class to keep the Factory "pure". When the experimental status of the widget moves to production, the startup activity is still useful for the settings watcher.
Lastly, and purely because I wasted an hour wondering why the widget wasn't working after a sandbox reset, I've defaulted the widget to display as soon as the experimental setting is enabled. Looking at the comments, I think the setting was originally at project level, but it is now at application level, and it makes sense to me that if I enable it in Experimental Settings, it should immediately appear in the status bar.