-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks,android.view.View.OnCreateContextMenuListener,androidx.activity.result.ActivityResultCaller,androidx.lifecycle.HasDefaultViewModelProviderFactory,androidx.lifecycle.LifecycleOwner,androidx.lifecycle.ViewModelStoreOwner,androidx.savedstate.SavedStateRegistryOwner,org.readium.r2.navigator.Navigator,org.readium.r2.navigator.OverflowableNavigator,org.readium.r2.navigator.VisualNavigator,org.readium.r2.navigator.preferences.Configurable
public final class PdfNavigatorFragment<S extends Configurable.Settings, P extends Configurable.Preferences<P>> extends NavigatorFragment implements VisualNavigator, OverflowableNavigator, Configurable<S, P>
Navigator for PDF publications.
The PDF navigator delegates the actual PDF rendering to third-party engines like PDFium or PSPDFKit.
To use this Fragment, create a factory with PdfNavigatorFactory.createFragmentFactory.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfacePdfNavigatorFragment.Listenerpublic classPdfNavigatorFragment.Companion
-
Field Summary
-
Method Summary
Modifier and Type Method Description StateFlow<S>getSettings()StateFlow<Locator>getCurrentLocator()ViewgetPublicationView()StateFlow<OverflowableNavigator.Overflow>getOverflow()ReadingProgressiongetReadingProgression()LifecyclegetLifecycle()ViewModelStoregetViewModelStore()CreationExtrasgetDefaultViewModelCreationExtras()ViewModelProvider.FactorygetDefaultViewModelProviderFactory()final SavedStateRegistrygetSavedStateRegistry()LocatorgetCurrentLocation()StateFlow<Object>getPresentation()UnitonCreate(Bundle savedInstanceState)ViewonCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)UnitonViewCreated(View view, Bundle savedInstanceState)UnitonResume()UnitsubmitPreferences(P preferences)Submits a new set of Preferences to update the current Settings. Booleango(Locator locator, Boolean animated)Moves to the position in the publication corresponding to the given Locator. Booleango(Link link, Boolean animated)Moves to the position in the publication targeted by the given link. BooleangoForward(Boolean animated)Moves to the next content portion (eg. BooleangoBackward(Boolean animated)Moves to the previous content portion (eg. UnitaddInputListener(InputListener listener)Adds a new InputListener to receive touch, mouse or keyboard events. UnitremoveInputListener(InputListener listener)Removes a previously registered InputListener. -
Methods inherited from class org.readium.r2.navigator.NavigatorFragment
callStartTransitionListener, createFragmentContainer, dump, equals, findFragmentByWho, generateActivityResultKey, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getAnimatingAway, getArguments, getChildFragmentManager, getContext, getEnterAnim, getEnterTransition, getEnterTransitionCallback, getExitAnim, getExitTransition, getExitTransitionCallback, getFocusedView, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLoaderManager, getNextTransition, getParentFragment, getParentFragmentManager, getPopDirection, getPopEnterAnim, getPopExitAnim, getPostOnViewCreatedAlpha, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSharedElementEnterTransition, getSharedElementReturnTransition, getSharedElementSourceNames, getSharedElementTargetNames, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, hasOptionsMenu, hashCode, initState, isAdded, isDetached, isHidden, isInBackStack, isInLayout, isMenuVisible, isPostponed, isRemoving, isResumed, isStateSaved, isVisible, noteStateNotSaved, onActivityCreated, onActivityResult, onAttach, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onDestroyView, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onSaveInstanceState, onStart, onStop, onViewStateRestored, performActivityCreated, performAttach, performConfigurationChanged, performContextItemSelected, performCreate, performCreateOptionsMenu, performCreateView, performDestroy, performDestroyView, performDetach, performGetLayoutInflater, performLowMemory, performMultiWindowModeChanged, performOptionsItemSelected, performOptionsMenuClosed, performPause, performPictureInPictureModeChanged, performPrepareOptionsMenu, performPrimaryNavigationFragmentChanged, performResume, performSaveInstanceState, performStart, performStop, performViewCreated, postponeEnterTransition, postponeEnterTransition, registerForActivityResult, registerForActivityResult, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, restoreChildFragmentState, restoreViewState, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setAnimations, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setFocusedView, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setNextTransition, setPopDirection, setPostOnViewCreatedAlpha, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementNames, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu -
Methods inherited from class org.readium.r2.navigator.pdf.PdfNavigatorFragment
firstVisibleElementLocator -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getSettings
StateFlow<S> getSettings()
-
getCurrentLocator
StateFlow<Locator> getCurrentLocator()
-
getPublicationView
View getPublicationView()
-
getOverflow
StateFlow<OverflowableNavigator.Overflow> getOverflow()
-
getReadingProgression
ReadingProgression getReadingProgression()
-
getLifecycle
@NonNull() Lifecycle getLifecycle()
-
getViewModelStore
@NonNull() ViewModelStore getViewModelStore()
-
getDefaultViewModelCreationExtras
@NonNull()@CallSuper() CreationExtras getDefaultViewModelCreationExtras()
-
getDefaultViewModelProviderFactory
@NonNull() ViewModelProvider.Factory getDefaultViewModelProviderFactory()
-
getSavedStateRegistry
@NonNull() final SavedStateRegistry getSavedStateRegistry()
-
getCurrentLocation
Locator getCurrentLocation()
-
getPresentation
StateFlow<Object> getPresentation()
-
onCreateView
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
-
onViewCreated
Unit onViewCreated(View view, Bundle savedInstanceState)
-
submitPreferences
Unit submitPreferences(P preferences)
Submits a new set of Preferences to update the current Settings.
Note that the Configurable might not update its settings right away, or might even ignore some of the provided preferences. They are only used as hints to compute the new settings.
-
go
Boolean go(Locator locator, Boolean animated)
Moves to the position in the publication corresponding to the given Locator.
-
go
Boolean go(Link link, Boolean animated)
Moves to the position in the publication targeted by the given link.
-
goForward
Boolean goForward(Boolean animated)
Moves to the next content portion (eg. page) in the reading progression direction.
-
goBackward
Boolean goBackward(Boolean animated)
Moves to the previous content portion (eg. page) in the reading progression direction.
-
addInputListener
Unit addInputListener(InputListener listener)
Adds a new InputListener to receive touch, mouse or keyboard events.
Registration order is critical, as listeners may consume the events and prevent others from receiving them.
-
removeInputListener
Unit removeInputListener(InputListener listener)
Removes a previously registered InputListener.
-
-
-
-