Skip to content

Commit

Permalink
Release version 1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Team Mobile Schorsch committed Jun 2, 2022
1 parent 4e94b46 commit 09dcd35
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 75 deletions.
6 changes: 6 additions & 0 deletions Documentation/source/Customization guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ Some background and text colors use the `GiniColor` type with which you can set
- Opaque view style (when tool tip is shown) → `GiniConfiguration.multipageToolTipOpaqueBackgroundStyle`

##### 3. Page item
- Page upload state icon
- Successful upload &#8594; <span style="color:#009EDF">*successfullUploadIcon*</span> image asset
- Failed upload &#8594; <span style="color:#009EDF">*failureUploadIcon*</span> image asset
- Page upload state icon background color
- Successful upload &#8594; `GiniConfiguration.multipagePageSuccessfullUploadIconBackgroundColor`
- Failed upload &#8594; `GiniConfiguration.multipagePageFailureUploadIconBackgroundColor`
- Page circle indicator color &#8594; `GiniConfiguration.indicatorCircleColor` using `GiniColor` with dark mode and light mode colors
- Page indicator color &#8594; `GiniConfiguration.multipagePageIndicatorColor`
- Page background color &#8594; `GiniConfiguration.multipagePageBackgroundColor` using `GiniColor` with dark mode and light mode colors
Expand Down
4 changes: 2 additions & 2 deletions Documentation/source/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Once you have your Swift package set up, adding `GiniCaptureSDK` as a dependency

```swift
dependencies: [
.package(url: "https://github.com/gini/capture-sdk-ios.git", .exact("1.7.1"))
.package(url: "https://github.com/gini/capture-sdk-ios.git", .exact("1.8.0"))
]
```

In case that you want to use the certificate pinning in the library, add `GiniCaptureSDKPinning`:
```swift
dependencies: [
.package(url: "https://github.com/gini/capture-sdk-pinning-ios.git", .exact("1.7.1"))
.package(url: "https://github.com/gini/capture-sdk-pinning-ios.git", .exact("1.8.0"))
]
```

Expand Down
10 changes: 10 additions & 0 deletions Sources/GiniCaptureSDK/Core/GiniConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,16 @@ import UIKit
*/
public var multipageToolTipOpaqueBackgroundStyle: OpaqueViewStyle = .blurred(style: .light)

/**
Sets the background color for the successfull upload icon.
*/
public var multipagePageSuccessfullUploadIconBackgroundColor = Colors.Gini.springGreen

/**
Sets the background color for the failed upload icon.
*/
public var multipagePageFailureUploadIconBackgroundColor = Colors.Gini.springGreen

// MARK: Analysis options

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,9 @@ public enum AnalysisStrings: LocalizableStringResource {
return ("defaultPdfDokumentTitle", "Default PDF document title")
}
}

public var isCustomizable: Bool {
switch self {
case .cancelledMessage, .documentCreationErrorMessage, .loadingText, .pdfPages, .defaultPdfDokumentTitle,
.suggestion1Text, .suggestion2Text, .suggestion3Text, .suggestion4Text, .suggestion5Text,
.suggestionHeader:
return true
case .analysisErrorMessage:
return false
}
return true
}

public var fallbackTableEntry: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,7 @@ enum CameraStrings: LocalizableStringResource {
}

var isCustomizable: Bool {
switch self {
case .captureButton, .captureFailedMessage, .errorPopupCancelButton,
.errorPopupGrantAccessButton, .errorPopupPickAnotherFileButton, .errorPopupReviewPagesButton,
.exceededFileSizeErrorMessage, .documentValidationGeneralErrorMessage,
.mixedArraysPopupCancelButton, .mixedArraysPopupUsePhotosButton, .mixedDocumentsErrorMessage,
.notAuthorizedButton, .notAuthorizedMessage, .photoLibraryAccessDeniedMessage, .qrCodeDetectedPopupMessage,
.qrCodeDetectedPopupButton, .tooManyPagesErrorMessage, .unknownErrorMessage, .wrongFormatErrorMessage, .unsupportedQrCodeDetectedPopupMessage, .fileImportTipLabel, .qrCodeTipLabel, .importFileButtonLabel, .failedToOpenDocumentErrorMessage:
return true
case .capturedImagesStackSubtitleLabel, .popupTitleImportPDF,
.popupTitleImportPDForPhotos, .popupOptionPhotos, .popupOptionFiles, .popupCancel:
return false
}
return true
}

var fallbackTableEntry: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ enum GalleryStrings: LocalizableStringResource {
}

var isCustomizable: Bool {
switch self {
case .albumsTitle:
return true
case .imagePickerOpenButton:
return false
}
return true
}

var fallbackTableEntry: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,7 @@ enum HelpStrings: LocalizableStringResource {
}

var isCustomizable: Bool {
switch self {
case .openWithTutorialCollectionHeader, .openWithTutorialStep1Title, .openWithTutorialStep1Subtitle,
.openWithTutorialStep2Title, .openWithTutorialStep2Subtitle, .openWithTutorialStep3Title,
.openWithTutorialStep3Subtitle:
return true
case .menuTitle, .menuFirstItemText, .menuSecondItemText, .menuThirdItemText, .openWithTutorialTitle,
.supportedFormatsTitle, .supportedFormatsSection1Title, .supportedFormatsSection1Item1Text,
.supportedFormatsSection1Item2Text, .supportedFormatsSection1Item3Text, .supportedFormatsSection1Item4Text, .supportedFormatsSection2Title,
.supportedFormatsSection2Item1Text, .supportedFormatsSection2Item2Text:
return false
}
return true
}

var fallbackTableEntry: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ public enum ImageAnalysisNoResultsStrings: LocalizableStringResource {
}

public var isCustomizable: Bool {
switch self {
case .collectionHeaderText, .goToCameraButton, .titleText, .warningText, .warningHelpMenuText:
return false
}
return true
}

public var fallbackTableEntry: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ enum MultipageReviewStrings: LocalizableStringResource {
}

var isCustomizable: Bool {
switch self {
case .retakeActionButton, .retryActionButton, .reorderContainerTooltipMessage, .dragAndDropTipMessage:
return true
case .addButtonLabel, .titleMessage:
return false
}
return true
}

var fallbackTableEntry: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ enum NavigationBarStrings: LocalizableStringResource {
}

var isCustomizable: Bool {
switch self {
case .analysisTitle, .cameraTitle, .onboardingTitle, .reviewTitle:
return true
}
return true
}

var fallbackTableEntry: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ public enum OnboardingStrings: LocalizableStringResource {
}

public var isCustomizable: Bool {
switch self {
case .onboardingFirstPageText, .onboardingSecondPageText, .onboardingThirdPageText, .onboardingFourthPageText,
.onboardingFifthPageText:
return true
}
return true
}

public var fallbackTableEntry: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ enum ReviewStrings: LocalizableStringResource {
}

var isCustomizable: Bool {
switch self {
case .bottomText, .documentImageTitle, .rotateButton, .topText, .unknownErrorMessage:
return true
}
return true
}

var fallbackTableEntry: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,13 @@ final class PageStateView: UIView {
func update(to status: State) {
switch status {
case .succeeded:
backgroundColor = Colors.Gini.springGreen
icon.image = UIImage.init(named: "successfullUploadIcon",
in: giniCaptureBundle(),
compatibleWith: nil)
backgroundColor = GiniConfiguration.shared.multipagePageSuccessfullUploadIconBackgroundColor
icon.image = UIImageNamedPreferred(named: "successfullUploadIcon")
loadingIndicator.stopAnimating()

case .failed:
backgroundColor = Colors.Gini.crimson
icon.image = UIImage.init(named: "failureUploadIcon",
in: giniCaptureBundle(),
compatibleWith: nil)
backgroundColor = GiniConfiguration.shared.multipagePageFailureUploadIconBackgroundColor
icon.image = UIImageNamedPreferred(named: "failureUploadIcon")
loadingIndicator.stopAnimating()
case .loading:
backgroundColor = .clear
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class OnboardingContainerViewController: UIViewController, ContainerViewCo
let pageControl = UIPageControl()
pageControl.translatesAutoresizingMaskIntoConstraints = false
pageControl.currentPage = 0
pageControl.numberOfPages = self.giniConfiguration.onboardingPages.count + 1 // Empty page at the end
pageControl.numberOfPages = self.giniConfiguration.onboardingPages.count
pageControl.currentPageIndicatorTintColor = UIColor.from(giniColor: giniConfiguration.onboardingCurrentPageIndicatorColor).withAlphaComponent(giniConfiguration.onboardingCurrentPageIndicatorAlpha)
pageControl.pageIndicatorTintColor = UIColor.from(giniColor: giniConfiguration.onboardingPageIndicatorColor)
pageControl.isUserInteractionEnabled = false
Expand Down Expand Up @@ -188,7 +188,7 @@ extension OnboardingContainerViewController: UIScrollViewDelegate {
// Update fixed elements position
let pageWidth = scrollView.frame.size.width
let contentOffsetX = scrollView.contentOffset.x
var frameOffsetX = contentOffsetX - pageWidth * CGFloat(pageControl.numberOfPages - 2)
var frameOffsetX = contentOffsetX - pageWidth * CGFloat(pageControl.numberOfPages - 1)
let fixedFrame = view.frame
frameOffsetX = max(-frameOffsetX, -fixedFrame.width)
frameOffsetX = min(frameOffsetX, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ import UIKit
addConstraints()
}

public override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
scrollView.contentInsetAdjustmentBehavior = .never
}

/**
Scrolls the scroll view to the next page.

Expand Down
2 changes: 1 addition & 1 deletion Sources/GiniCaptureSDK/GiniCaptureSDKVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
// Created by Nadya Karaban on 29.10.21.
//

public let GiniCaptureSDKVersion = "1.7.1"
public let GiniCaptureSDKVersion = "1.8.0"
2 changes: 1 addition & 1 deletion Tests/GiniCaptureSDKTests/PageStateViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class PageStateViewTests: XCTestCase {

func testFailureState() {
statusView.update(to: .failed)
XCTAssertEqual(statusView.backgroundColor, Colors.Gini.crimson, "background color should be red")
XCTAssertEqual(statusView.backgroundColor, Colors.Gini.springGreen, "background color should be green")
XCTAssertEqual(statusView.icon.image,
UIImage(named: "failureUploadIcon",
in: giniCaptureBundle(),
Expand Down

0 comments on commit 09dcd35

Please sign in to comment.