-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exposing Fragment instead of Activity #176
Comments
As stated in this video from Google, the best practice is now to have a single This should be implemented at the app level, this doesn't change the fact that the navigator should expose fragments. However, an |
Kind of curious how this will be accomplished. Yeah, ideally a library like this should not be exposing activities, that should be up to the app using the library. But decoupling six activities from here will take some time. |
@johanpoirier did most of the work already in readium/r2-navigator-kotlin#148. The strategy we applied is to move most of the activities code to the fragments and then embed the fragments in the original activities, delegating the old APIs to the fragments. You have a good example in the R2CbzActivity. We kept some things in the activities: anything related to UX, particularly the action bar, and the code for highlights and TTS in EPUB. These features will be put back in the Fragment later, after review of the public API. Finally, we have a |
I merged readium/r2-navigator-kotlin#148 into the
Even though we're not 100% there (missing highlights/TTS + audiobook), I'm closing this issue. Feel free to open a new issue to report any problem you may encounter integrating the fragments. |
Currently, the navigator is exposing one
Activity
class for each format (e.g.R2EpubActivity
), but this introduces a number of issues:Activity
.Publication
), which is a big issue if objects are too big or if we need non-data objects (e.g.DRMContext
for rights handling).https://github.com/readium/r2-navigator-kotlin/blob/6096daf3c009bfffa76527143097f8d1aab59d65/r2-navigator/src/main/java/org/readium/r2/navigator/epub/R2EpubActivity.kt#L391-L392
Instead, we should expose a
Fragment
which is much more flexible and fixes all these issues.The text was updated successfully, but these errors were encountered: