Skip to content

Move editor loading into the library#326

Open
jkmassel wants to merge 6 commits intotrunkfrom
refactor/android-loading-ui
Open

Move editor loading into the library#326
jkmassel wants to merge 6 commits intotrunkfrom
refactor/android-loading-ui

Conversation

@jkmassel
Copy link
Contributor

What?

Moves the editor loading UI from #316 into its own PR

Why?

The smaller change is easier to validate.

How?

Adds loading UI – if you test with the sample app, you'll see that it was removed from the activity and added to the view.

jkmassel and others added 6 commits February 18, 2026 10:37
GutenbergView previously extended WebView directly and delegated all
loading UI (progress bar, spinner, error states) to consumers via the
EditorLoadingListener interface. This forced every app embedding the
editor to implement its own loading UI boilerplate.

This change makes GutenbergView extend FrameLayout instead, containing
an internal WebView plus overlay views for loading states:

- EditorProgressView (progress bar + label) during dependency fetching
- ProgressBar (circular/indeterminate) during WebView initialization
- EditorErrorView (new) for error states

The view manages its own state transitions with 200ms fade animations,
matching the iOS EditorViewController pattern. The EditorLoadingListener
interface is removed entirely — consumers no longer need loading UI code.

Changes:
- GutenbergView: WebView -> FrameLayout with internal WebView child
- New EditorErrorView for displaying load failures
- Delete EditorLoadingListener (no longer needed)
- Simplify demo EditorActivity by removing ~90 lines of loading UI
- Update tests to use editorWebView accessor for WebView properties
- Delete unused activity_editor.xml layout

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Cancel in-flight view animations in onDetachedFromWindow

Prevents withEndAction callbacks from firing on detached views
if the editor is closed mid-animation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Remove unused LoadingState enum from GutenbergView

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Remove unused ASSET_LOADING_TIMEOUT_MS constant from GutenbergView

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…edFromWindow

These two listeners were not being nulled out during teardown,
inconsistent with all other listener cleanup in the same method.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jkmassel jkmassel requested a review from dcalhoun February 18, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments