-
Notifications
You must be signed in to change notification settings - Fork 111
1/3 Replace legacy user settings API #262
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
1/3 Replace legacy user settings API #262
Conversation
9660919
to
c2ccd13
Compare
f906a5f
to
680d74a
Compare
680d74a
to
fb34c59
Compare
5509e6a
to
1eee3d8
Compare
9bef708
to
9748c7e
Compare
|
||
resourcePager.adapter = adapter | ||
resourcePager.direction = publication.metadata.effectiveReadingProgression | ||
resetAdapter() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The adapter can now be reset when changing settings that require a relayout (e.g. reading progression).
private lateinit var resourcesSingle: List<PageResource> | ||
private lateinit var resourcesDouble: List<PageResource> | ||
|
||
lateinit var preferences: SharedPreferences |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The EpubNavigatorFragment
is in "legacy mode" (with SharedPreferences
settings) if a baseUrl
is provided. If it is null
, we switch to the new Settings API.
|
||
override val readingProgression: ReadingProgression | ||
get() = publication.metadata.effectiveReadingProgression | ||
get() = viewModel.readingProgression |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The readingProgression
is now dynamic as it's also a setting.
readium/navigator/src/main/java/org/readium/r2/navigator/epub/EpubNavigatorViewModel.kt
Outdated
Show resolved
Hide resolved
readium/navigator/src/main/java/org/readium/r2/navigator/epub/css/ReadiumCss.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's hard to say that I saw and thought about everything, but let's go. I might have more insight after working on PDF settings.
Review notes
The Settings API PRs are numbered in the order of merge, but should be reviewed in reverse order, starting with #141.
However, you might want to start by reading the documentation that is in this PR, as it is the most up-to-date:
This PR: