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 | setBackButtonIcon(_:) setBackButtonColor(forContent:background:border:) |
(2) Background | setBackgroundColor(_:) |
(3) Context image | setContextImage(_:) |
(4) Bottom sheet | setBottomSheetColor(_:) setBottomSheetCornerRadius(_:) |
(5) Title | setTitleText(_:color:font:) |
(6) Caption | setCaptionText(_:color:font:) |
(7) First instruction | setFirstInstructionIcon(_:) setFirstInstructionIconColor(forContent:background:border:) setFirstInstructionTitleText(_:color:font:) |
(8) Second instruction | setSecondInstructionIcon(_:) setSecondInstructionIconColor(forContent:background:border:) setSecondInstructionTitleText(_:color:font:) |
(9) Continue button | setContinueButtonText(_:font:) setContinueButtonColor(forContent:background:border:) |
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 | setBackButtonIcon(_:) setBackButtonColor(forContent:background:border:) |
(2) Close button | setCloseButtonIcon(_:) setCloseButtonColor(forContent:background:border:) |
(3) Front indicator | setFrontIndicatorText(_:) setFrontIndicatorColor(_:) setFrontIndicatorFocusedState(withImage:textColor:textFont:) setFrontIndicatorUnfocusedState(withImage:textColor:textFont:) |
(4) Back indicator | setBackIndicatorText(_:) setBackIndicatorColor(_:) setBackIndicatorFocusedState(withImage:textColor:textFont:) setBackIndicatorUnfocusedState(withImage:textColor:textFont:) |
(5) Instruction text | setInstructionGuideText(forFront:back:confirmation:) setInstructionGuideTextColor(_:) setInstructionGuideTextFont(_:) |
(6) Preview | setCapturePreviewBorderColor(forCaptured:uncapturedState:) |
(7) Background | setBackgroundColor(_:) |
(8) Capture button | setCaptureButtonIcon(_:) setCaptureButtonColor(forContent:background:border:) |
(9) Bottom sheet | setBottomSheetColor(_:) setBottomSheetCornerRadius(_:) |
(10) Confirmation message | setConfirmationMessage(withText:color:font:) |
(11) Retry button | setRetryButtonText(_:font:) setRetryButtonColor(forContent:background:border:) |
(12) Confirm button | setConfirmButtonText(_:forConfirmationText:font:) setConfirmButtonColor(forContent:background:border:) |
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 | setSuccessBackgroundColor(_:) setSuccesImage(_:) setSuccessMessage(_:,color:font:) |
(2) Error | setErrorBackgroundColor(_:) setErrorImage(_:) setErrorMessage(_:color:font:) |
(3) Retry | setRetryBackgroundColor(_:) setRetryImage(_:) setRetryMessage(_:color:font:) setRetryButtonText(_:font:) setRetryButtonColor(forContent:background:border:) |
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 | setBackButtonIcon(_:) setBackButtonColor(forContent:background:border:) |
(2) Camera image | setCameraImage(_:color:) |
(3) Title | setTitle(text:color:font:) |
(4) Caption | setCaption(text:color:font:) |
(5) Check permission button | setCheckPermissionButtonText(_:font:) setCheckPermissionButtonColor(forContent:background:border:) |
(6) Background | setBackgroundColor(_:) |
(7) Bottom sheet | setBottomSheetBackgroundColor(_:) setBottomSheetCornerRadius(_:) setBottomSheetTitle(text:color:font:) setBottomSheetCaption(text:color:font:) |
(8) Open settings button | setOpenSettingsButtonText(_:font:) setOpenSettingsButtonColor(forContent:background:border:) |
(9) Close button | setCloseButtonText(_:font:) setCloseButtonColor(forContent:background:border:) |
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 1 day ago