Move the activity indicator from the navigator to the testapp

Open
#127 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
swift
Domain
api, mobile

Research direction

Start by reading DocumentWebView.swift at the linked location to understand how the activity indicator is currently displayed while a resource loads. Then compare the proposed approaches: loading events with a test-app-owned indicator, exposing the resource view, or providing an indicator factory. Done means settling and implementing an API that lets the test app control the UX without losing correct placement on the scrolling resource.

Written by the indexing model from the issue text.

Description

Right now an activity indicator is displayed inside the navigator while a resource (from the readingOrder) is loaded.

https://github.com/readium/r2-navigator-swift/blob/1f80d58fba510d62b0d2fed5cd43632576552a8b/r2-navigator-swift/EPUB/DocumentWebView.swift#L502

This is a problem because the test app should be in control of everything related to the UX and style.

I suggest moving this into the testapp itself, and add events in the navigator API to notify the testapp that a resource is being loaded.

Note that this pose an issue because the test app can't directly put an activity indicator on the resource view that is being scrolled, it will be positioned absolutely above the navigator and not scroll with the document. Maybe we need an API from the navigator to expose the view of the resource, so that the testapp can add it directly on it.

As an alternative, the testapp could provide an "activity indicator factory" that will be called by the navigator, and the navigator will automatically add/remove the activity indicator on the resource when relevant.

Dominant language
Swift
Stars
557
Forks
249
Avg merge
3h 52m
Merged PRs (30d)
19

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from readium/swift-toolkit

All issues in readium/swift-toolkit

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.