AI-generated Key Takeaways
-
GmsDocumentScannerOptions.Builder
provides options for customizing the document scanning process, such as enabling gallery imports, setting page limits, defining result formats, and choosing the scanner mode. -
It allows developers to control features like enabling/disabling gallery imports using
setGalleryImportAllowed
, limiting the number of scanned pages withsetPageLimit
, and setting desired output formats (JPEG, PDF) throughsetResultFormats
. -
Developers can specify the scanner mode (
SCANNER_MODE_FULL
,SCANNER_MODE_BASE_WITH_FILTER
,SCANNER_MODE_BASE
) usingsetScannerMode
to control the level of functionality and features available during scanning. -
After configuration, the
build()
method creates aGmsDocumentScannerOptions
instance based on the specified settings, which is then used to initiate the document scanning process.
Builder for GmsDocumentScannerOptions
.
Public Constructor Summary
Builder()
Builder for
GmsDocumentScannerOptions .
|
Public Method Summary
GmsDocumentScannerOptions |
build()
Builds a
GmsDocumentScannerOptions instance.
|
GmsDocumentScannerOptions.Builder |
setGalleryImportAllowed(boolean galleryImportAllowed)
Sets whether to show a UI button to allow the user to import images from photo
gallery.
|
GmsDocumentScannerOptions.Builder |
setPageLimit(int pageLimit)
Sets a page limit for the maximum number of pages that can be scanned in a
single scanning session.
|
GmsDocumentScannerOptions.Builder |
setResultFormats(int format, int... moreFormats)
Sets scanner
GmsDocumentScannerOptions.ResultFormat s.
|
GmsDocumentScannerOptions.Builder |
setScannerMode(int scannerMode)
Sets the scanner mode which determines what features are enabled.
|
Inherited Method Summary
Public Constructors
public Builder ()
Builder for
GmsDocumentScannerOptions
.
Public Methods
public GmsDocumentScannerOptions build ()
Builds a
GmsDocumentScannerOptions
instance.
public GmsDocumentScannerOptions.Builder setGalleryImportAllowed (boolean galleryImportAllowed)
Sets whether to show a UI button to allow the user to import images from photo gallery.
The default value is true
.
public GmsDocumentScannerOptions.Builder setPageLimit (int pageLimit)
Sets a page limit for the maximum number of pages that can be scanned in a single scanning session.
The provided value should be be greater than or equal to 1.
If no page limit is set, the restriction on the number of pages that can be scanned is determined by hardware resources, for example, memory, disk storage.
public GmsDocumentScannerOptions.Builder setResultFormats (int format, int... moreFormats)
Sets scanner
GmsDocumentScannerOptions.ResultFormat
s.
Available formats:
GmsDocumentScannerOptions.RESULT_FORMAT_JPEG
,
GmsDocumentScannerOptions.RESULT_FORMAT_PDF
.
The default value is
GmsDocumentScannerOptions.RESULT_FORMAT_JPEG
.
public GmsDocumentScannerOptions.Builder setScannerMode (int scannerMode)
Sets the scanner mode which determines what features are enabled.
Available modes:
GmsDocumentScannerOptions.SCANNER_MODE_FULL
,
GmsDocumentScannerOptions.SCANNER_MODE_BASE_WITH_FILTER
,
GmsDocumentScannerOptions.SCANNER_MODE_BASE
.
The default value is
GmsDocumentScannerOptions.SCANNER_MODE_FULL
.