DocCore
Além de poder usar o SDK em sua forma padrão de exibição, o SDK permite também, que as telas sejam customizadas e para tal, no DocCoreCustomizationBuilder
você terá acesso a todos os métodos de customização:
1. Tela de instruções
Identificador | Métodos |
---|---|
(1) Back button |
|
(2) Background |
|
(3) Context image |
|
(4) Bottom sheet |
|
(5) Title |
|
(6) Caption |
|
(7) First instruction |
|
(8) Second instruction |
|
(9) Continue button |
|
Código de exemplo
DocCoreCustomizationBuilder.builder()
.customizeInstructionScreen { instructionBuilder in
instructionBuilder
.setBackButtonIcon(UIImage(named: "back-icon")!)
.setBackButtonColor(
forContent: UIColor.red,
background: UIColor.green,
border: UIColor.white
)
.setBackgroundColor(UIColor.purple)
.setContextImage(UIImage(named: "context-image")!)
.setBottomSheetColor(UIColor.cyan)
.setBottomSheetCornerRadius(CGFloat(10))
.setTitleText(
"title-text",
color: UIColor.brown,
font: UIFont.systemFont(ofSize: 40)
)
.setCaptionText(
"caption-text",
color: UIColor.systemPink,
font: UIFont.systemFont(ofSize: 30)
)
.setFirstInstructionIcon(UIImage(named: "first-instruction-icon")!)
.setFirstInstructionIconColor(
forContent: UIColor.purple,
background: UIColor.green,
border: UIColor.red
)
.setFirstInstructionTitleText(
"fist-intruction-text",
color: UIColor.darkGray,
font: UIFont.systemFont(ofSize: 30)
)
.setSecondInstructionIcon(UIImage(named: "second-instruction-icon")!)
.setSecondInstructionIconColor(
forContent: UIColor.white,
background: UIColor.orange,
border: UIColor.black
)
.setSecondInstructionTitleText(
"second-intruction-text",
color: UIColor.magenta,
font: UIFont.systemFont(ofSize: 24)
)
.setContinueButtonText(
"continue-button-text",
font: UIFont.systemFont(ofSize: 50)
)
.setContinueButtonColor(
forContent: UIColor.lightGray,
background: UIColor.systemPink,
border: UIColor.white
)
}
2. Tela de captura de documento
Identificador | Métodos |
---|---|
(1) Back button |
|
(2) Close button |
|
(3) Front indicator |
|
(4) Back indicator |
|
(5) Instruction text |
|
(6) Preview |
|
(7) Background |
|
(8) Capture button |
|
(9) Bottom sheet |
|
(10) Confirmation message |
|
(11) Retry button |
|
(12) Confirm button |
|
Código de exemplo
DocCoreCustomizationBuilder.builder()
.customizeCaptureScreen { captureBuilder in
captureBuilder
.setBackButtonIcon(UIImage(named: "back-icon")!)
.setBackButtonColor(
forContent: UIColor.white,
background: UIColor.magenta,
border: UIColor.green
)
.setCloseButtonIcon(UIImage(named: "close-icon")!)
.setCloseButtonColor(
forContent: UIColor.magenta,
background: UIColor.green,
border: UIColor.white
)
.setFrontIndicatorText("Front")
.setFrontIndicatorColor(UIColor.blue)
.setFrontIndicatorFocusedState(
withImage: UIImage(named: "focused-front-icon"),
textColor: UIColor.purple,
textFont: UIFont.systemFont(ofSize: 20)
)
.setFrontIndicatorUnfocusedState(
withImage: UIImage(named: "unfocused-front-icon"),
textColor: UIColor.lightGray,
textFont: UIFont.systemFont(ofSize: 20)
)
.setBackIndicatorText("Back")
.setBackIndicatorColor(UIColor.darkGray)
.setBackIndicatorFocusedState(
withImage: UIImage(named: "focused-back-icon"),
textColor: UIColor.cyan,
textFont: UIFont.systemFont(ofSize: 20)
)
.setBackIndicatorUnfocusedState(
withImage: UIImage(named: "unfocused-back-icon"),
textColor: UIColor.black,
textFont: UIFont.systemFont(ofSize: 20)
)
.setInstructionGuideText(
forFront: "front-text",
back: "back-text",
confirmation: "confirmation-text"
)
.setInstructionGuideTextColor(UIColor.blue)
.setInstructionGuideTextFont(UIFont.systemFont(ofSize: 22))
.setCapturePreviewBorderColor(
forCaptured: UIColor.green,
uncapturedState: UIColor.blue
)
.setBackgroundColor(UIColor.red)
.setCaptureButtonIcon(UIImage(named: "capture-icon")!)
.setCaptureButtonColor(
forContent: UIColor.systemPink,
background: UIColor.orange,
border: UIColor.black
)
.setBottomSheetColor(UIColor.brown)
.setBottomSheetCornerRadius(CGFloat(15))
.setConfirmationMessage(
withText: "confirmation-message",
color: UIColor.white,
font: UIFont.systemFont(ofSize: 24)
)
.setRetryButtonText("retry-button-text", font: UIFont.systemFont(ofSize: 30))
.setRetryButtonColor(
forContent: UIColor.orange,
background: UIColor.black,
border: UIColor.systemPink
)
.setConfirmButtonText(
"confirm-button-text",
forConfirmationText: "confirm-button-confirmation-text",
font: UIFont.systemFont(ofSize: 30)
)
.setConfirmButtonColor(
forContent: UIColor.red,
background: UIColor.magenta,
border: UIColor.cyan
)
}
3. Tela de loading
Identificador | Métodos |
---|---|
(1) Background | setBackgroundColor(_:) |
(2) Loading | setLoading(withColor:width:scaleFactor:) |
Código de exemplo do Builder
DocCoreCustomizationBuilder.builder()
.customizeLoadingScreen { loadingBuilder in
loadingBuilder
.setBackgroundColor(UIColor.orange)
.setLoading(
withColor: UIColor.cyan,
width: CGFloat(20),
scaleFactor: Int(8)
)
}
4. Tela de resultado
Identificador | Métodos |
---|---|
(1) Success |
|
(2) Error |
|
(3) Retry |
|
Código de exemplo
DocCoreCustomizationBuilder.builder()
.customizeResultScreen { resultBuilder in
resultBuilder
.setSuccessBackgroundColor(UIColor.brown)
.setSuccesImage(UIImage(named: "success-icon")!)
.setSuccessMessage(
"success-message-text",
color: UIColor.white,
font: UIFont.systemFont(ofSize: 30)
)
.setErrorBackgroundColor(UIColor.systemPink)
.setErrorImage(UIImage(named: "error-icon")!)
.setErrorMessage(
"error-message-text",
color: UIColor.white,
font: UIFont.systemFont(ofSize: 40)
)
.setRetryBackgroundColor(UIColor.magenta)
.setRetryImage(UIImage(named: "retry-icon")!)
.setRetryMessage(
"retry-message-text",
color: UIColor.white,
font: UIFont.systemFont(ofSize: 40)
)
.setRetryButtonText("retry-button-text", font: UIFont.systemFont(ofSize: 35))
.setRetryButtonColor(
forContent: UIColor.cyan,
background: UIColor.brown,
border: UIColor.white
)
}
5. Tela de permissão da câmera
Identificador | Métodos |
---|---|
(1) Back button |
|
(2) Camera image |
|
(3) Title |
|
(4) Caption |
|
(5) Check permission button |
|
(6) Background |
|
(7) Bottom sheet |
|
(8) Open settings button |
|
(9) Close button |
|
Código de exemplo
DocCoreCustomizationBuilder.builder()
.customizeCameraPermissionScreen { cameraPermissionBuilder in
cameraPermissionBuilder
.setBackButtonIcon(UIImage(named: "back-button-icon")!)
.setBackButtonColor(
forContent: UIColor.red,
background: UIColor.blue,
border: UIColor.yellow
)
.setCameraImage(UIImage(named: "camera-icon"), color: UIColor.white)
.setTitle(
text: "title-text",
color: UIColor.green,
font: UIFont.systemFont(ofSize: 14)
)
.setCaption(
text: "caption-text",
color: UIColor.orange,
font: UIFont.systemFont(ofSize: 16)
)
.setCheckPermissionButtonText("check-permission-button-text", font: UIFont.systemFont(ofSize: 20))
.setCheckPermissionButtonColor(
forContent: UIColor.purple,
background: UIColor.systemPink,
border: UIColor.brown
)
.setBackgroundColor(UIColor.green)
.setBottomSheetBackgroundColor(UIColor.cyan)
.setBottomSheetCornerRadius(CGFloat(15.0))
.setBottomSheetTitle(
text: "bottom-sheet-title-text",
color: UIColor.yellow,
font: UIFont.systemFont(ofSize: 30)
)
.setBottomSheetCaption(
text: "bottom-sheet-caption-text",
color: UIColor.white,
font: UIFont.systemFont(ofSize: 20)
)
.setOpenSettingsButtonText("open-settings-button-text", font: UIFont.systemFont(ofSize: 18))
.setOpenSettingsButtonColor(
forContent: UIColor.black,
background: UIColor.orange,
border: UIColor.systemPink
)
.setCloseButtonText("close-button-text", font: UIFont.systemFont(ofSize: 12))
.setCloseButtonColor(
forContent: UIColor.magenta,
background: UIColor.systemPink,
border: UIColor.blue
)
}
Updated about 13 hours ago