This repository has been archived by the owner on Jul 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from readium/feature/pdf
Add a PDF navigator
- Loading branch information
Showing
13 changed files
with
392 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
r2-navigator/src/main/java/org/readium/r2/navigator/NavigatorFragmentFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Module: r2-navigator-kotlin | ||
* Developers: Mickaël Menu | ||
* | ||
* Copyright (c) 2020. Readium Foundation. All rights reserved. | ||
* Use of this source code is governed by a BSD-style license which is detailed in the | ||
* LICENSE file present in the project repository where this source code is maintained. | ||
*/ | ||
|
||
package org.readium.r2.navigator | ||
|
||
import androidx.fragment.app.Fragment | ||
import androidx.fragment.app.FragmentFactory | ||
import org.readium.r2.navigator.pdf.PdfNavigatorFragment | ||
import org.readium.r2.shared.publication.Locator | ||
import org.readium.r2.shared.publication.Publication | ||
|
||
class NavigatorFragmentFactory( | ||
private val publication: Publication, | ||
private val initialLocator: Locator? = null, | ||
private val listener: Navigator.Listener? = null | ||
) : FragmentFactory() { | ||
|
||
override fun instantiate(classLoader: ClassLoader, className: String): Fragment = | ||
when (className) { | ||
PdfNavigatorFragment::class.java.name -> PdfNavigatorFragment(publication, initialLocator, listener) | ||
else -> super.instantiate(classLoader, className) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.