Class DocumentSharingProviderProcessor

    • Constructor Detail

      • DocumentSharingProviderProcessor

        DocumentSharingProviderProcessor()
    • Method Detail

      • prepareDocumentForSharing

         static Single<Uri> prepareDocumentForSharing(@NonNull() Context context, @NonNull() PdfDocument document, @NonNull() PdfProcessorTask processorTask, @Nullable() String documentName)

        Prepares document for sharing via Android share framework.

        • Scheduler:
        • Method does not operate by default on a particular Scheduler.
        Parameters:
        document - Document we are going to share.
        processorTask - Task to use for processing the document before sharing.
        documentName - Optional document name used for sharing (this is the shared document file name as seen by other apps).
        Returns:

        Single emitting Uri that can be used for sharing the document to other apps or an error if the document could not be exported for sharing.

      • prepareDocumentForSharing

        @NonNull() static Single<Uri> prepareDocumentForSharing(@NonNull() Context context, @NonNull() PdfDocument document, @Nullable() String documentName)

        Prepares document for sharing via Android share framework.

        • Scheduler:
        • Method does not operate by default on a particular Scheduler.
        Parameters:
        document - Document that should be shared.
        documentName - Optional document name used for sharing (this is the shared document file name as seen by other apps).
        Returns:

        Single emitting Uri that can be used for sharing the document to other apps or an error if the document could not be exported for sharing.

      • prepareEmbeddedFileForSharing

        @NonNull() static Single<Uri> prepareEmbeddedFileForSharing(@NonNull() Context context, @NonNull() EmbeddedFile embeddedFile)

        Extracts embedded file to directory backed by DocumentSharingProvider.

        • Scheduler:
        • Method does not operate by default on a particular Scheduler.
        Parameters:
        embeddedFile - Embedded file we want to extract.
        Returns:

        Single emitting Uri that can be used for sharing the embedded file to other apps or an error if the file could not be exported.

      • prepareBitmapForSharing

        @NonNull() static Single<Uri> prepareBitmapForSharing(@NonNull() Context context, @NonNull() Bitmap bitmap)

        Writes bitmap to directory backed by DocumentSharingProvider.

        • Scheduler:
        • Method does not operate by default on a particular Scheduler.
        Parameters:
        context - Context to use.
        bitmap - Bitmap that should be compressed and saved into file.
        Returns:

        Single emitting Uri that can be used for sharing the bitmap file to other apps or an error if the bitmap could not be exported.

      • prepareBitmapForSharing

         static Single<Uri> prepareBitmapForSharing(@NonNull() Context context, @NonNull() Bitmap bitmap, @NonNull() Bitmap.CompressFormat compressFormat, int compressQuality, @Nullable() String fileName)

        Writes bitmap to directory backed by DocumentSharingProvider.

        • Scheduler:
        • Method does not operate by default on a particular Scheduler.
        Parameters:
        context - Context to use.
        bitmap - Bitmap that should be compressed and saved into file.
        compressFormat - The format of the compressed image.
        compressQuality - The quality that compressor should use.
        fileName - Optional file name used for sharing (this is the shared file name as seen by other apps).
        Returns:

        Single emitting Uri that can be used for sharing the bitmap file to other apps or an error if the bitmap could not be exported.

      • prepareFileForSharing

        @NonNull() static Single<Uri> prepareFileForSharing(@NonNull() Context context, @NonNull() DataProvider fileDataProvider, @Nullable() String fileName)

        Writes file to directory backed by DocumentSharingProvider.

        • Scheduler:
        • Method does not operate by default on a particular Scheduler.
        Parameters:
        context - Context to use.
        fileDataProvider - Data provider with file data.
        fileName - Optional file name used for sharing (this is the shared file name as seen by other apps).
        Returns:

        Single emitting Uri that can be used for sharing the file to other apps or an error if the file could not be exported.

      • prepareSoundAnnotationForSharing

        @NonNull() static Single<Uri> prepareSoundAnnotationForSharing(@NonNull() Context context, @NonNull() SoundAnnotation soundAnnotation)

        Extracts audio data embedded in a SoundAnnotation to a directory backed by . Audio data is written as a WAV file.

        • Scheduler:
        • Method does not operate by default on a particular Scheduler.
        Parameters:
        soundAnnotation - Sound annotation that should be shared.
        Returns:

        Single emitting Uri that can be used for sharing the sound annotation to other apps or an error if the audio data could not be exported.

      • prepareSoundAnnotationForSharing

        @NonNull() static Single<Uri> prepareSoundAnnotationForSharing(@NonNull() Context context, @NonNull() SoundAnnotation soundAnnotation, @Nullable() String fileName)

        Extracts audio data embedded in a SoundAnnotation to a directory backed by . Audio data is written as a WAV file.

        • Scheduler:
        • Method does not operate by default on a particular Scheduler.
        Parameters:
        soundAnnotation - Sound annotation that should be shared.
        fileName - Optional file name used for sharing the wave file (this is the shared file name as seen by other apps).
        Returns:

        Single emitting Uri that can be used for sharing the sound annotation to other apps or an error if the audio data could not be exported.

      • soundAnnotationSupportsSharing

         static boolean soundAnnotationSupportsSharing(@NonNull() SoundAnnotation soundAnnotation)

        Checks whether sound annotation can be shared: is attached to document and has audio data in supported format (i.e. with encoding SIGNED).

        Parameters:
        soundAnnotation - Sound annotation that should be shared.
        Returns:

        True when sound annotation has audio data that can be shared.