Skip to content
This repository was archived by the owner on Oct 18, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
objects = {

/* Begin PBXBuildFile section */
9505725E21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9505725D21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift */; };
9505726021D4D922009EA422 /* CarlensLayoutAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9505725F21D4D922009EA422 /* CarlensLayoutAttributes.swift */; };
955E4FD421CBFB2800B4C3BB /* CarlensCollectionViewLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 955E4FD221CBFB2800B4C3BB /* CarlensCollectionViewLayout.h */; settings = {ATTRIBUTES = (Public, ); }; };
958D17C021D66DF00067BED6 /* CarlensCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 958D17BF21D66DF00067BED6 /* CarlensCollectionViewCell.swift */; };
9505725E21D4D8FB009EA422 /* CarLensCollectionViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9505725D21D4D8FB009EA422 /* CarLensCollectionViewLayout.swift */; };
9505726021D4D922009EA422 /* CarLensLayoutAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9505725F21D4D922009EA422 /* CarLensLayoutAttributes.swift */; };
955E4FD421CBFB2800B4C3BB /* CarLensCollectionViewLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 955E4FD221CBFB2800B4C3BB /* CarLensCollectionViewLayout.h */; settings = {ATTRIBUTES = (Public, ); }; };
958D17C021D66DF00067BED6 /* CarLensCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 958D17BF21D66DF00067BED6 /* CarLensCollectionViewCell.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
9505725D21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarlensCollectionViewLayout.swift; sourceTree = "<group>"; };
9505725F21D4D922009EA422 /* CarlensLayoutAttributes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarlensLayoutAttributes.swift; sourceTree = "<group>"; };
955E4FCF21CBFB2800B4C3BB /* CarlensCollectionViewLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CarlensCollectionViewLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; };
955E4FD221CBFB2800B4C3BB /* CarlensCollectionViewLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CarlensCollectionViewLayout.h; sourceTree = "<group>"; };
9505725D21D4D8FB009EA422 /* CarLensCollectionViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarLensCollectionViewLayout.swift; sourceTree = "<group>"; };
9505725F21D4D922009EA422 /* CarLensLayoutAttributes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarLensLayoutAttributes.swift; sourceTree = "<group>"; };
955E4FCF21CBFB2800B4C3BB /* CarLensCollectionViewLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CarLensCollectionViewLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; };
955E4FD221CBFB2800B4C3BB /* CarLensCollectionViewLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CarLensCollectionViewLayout.h; sourceTree = "<group>"; };
955E4FD321CBFB2800B4C3BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
958D17BF21D66DF00067BED6 /* CarlensCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarlensCollectionViewCell.swift; sourceTree = "<group>"; };
958D17BF21D66DF00067BED6 /* CarLensCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarLensCollectionViewCell.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -36,29 +36,29 @@
955E4FC521CBFB2800B4C3BB = {
isa = PBXGroup;
children = (
955E4FD121CBFB2800B4C3BB /* CarlensCollectionViewLayout */,
955E4FD121CBFB2800B4C3BB /* CarLensCollectionViewLayout */,
955E4FD021CBFB2800B4C3BB /* Products */,
);
sourceTree = "<group>";
};
955E4FD021CBFB2800B4C3BB /* Products */ = {
isa = PBXGroup;
children = (
955E4FCF21CBFB2800B4C3BB /* CarlensCollectionViewLayout.framework */,
955E4FCF21CBFB2800B4C3BB /* CarLensCollectionViewLayout.framework */,
);
name = Products;
sourceTree = "<group>";
};
955E4FD121CBFB2800B4C3BB /* CarlensCollectionViewLayout */ = {
955E4FD121CBFB2800B4C3BB /* CarLensCollectionViewLayout */ = {
isa = PBXGroup;
children = (
955E4FD221CBFB2800B4C3BB /* CarlensCollectionViewLayout.h */,
9505725D21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift */,
958D17BF21D66DF00067BED6 /* CarlensCollectionViewCell.swift */,
9505725F21D4D922009EA422 /* CarlensLayoutAttributes.swift */,
955E4FD221CBFB2800B4C3BB /* CarLensCollectionViewLayout.h */,
9505725D21D4D8FB009EA422 /* CarLensCollectionViewLayout.swift */,
958D17BF21D66DF00067BED6 /* CarLensCollectionViewCell.swift */,
9505725F21D4D922009EA422 /* CarLensLayoutAttributes.swift */,
955E4FD321CBFB2800B4C3BB /* Info.plist */,
);
path = CarlensCollectionViewLayout;
path = CarLensCollectionViewLayout;
sourceTree = "<group>";
};
/* End PBXGroup section */
Expand All @@ -68,16 +68,16 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
955E4FD421CBFB2800B4C3BB /* CarlensCollectionViewLayout.h in Headers */,
955E4FD421CBFB2800B4C3BB /* CarLensCollectionViewLayout.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */

/* Begin PBXNativeTarget section */
955E4FCE21CBFB2800B4C3BB /* CarlensCollectionViewLayout */ = {
955E4FCE21CBFB2800B4C3BB /* CarLensCollectionViewLayout */ = {
isa = PBXNativeTarget;
buildConfigurationList = 955E4FD721CBFB2800B4C3BB /* Build configuration list for PBXNativeTarget "CarlensCollectionViewLayout" */;
buildConfigurationList = 955E4FD721CBFB2800B4C3BB /* Build configuration list for PBXNativeTarget "CarLensCollectionViewLayout" */;
buildPhases = (
955E4FCA21CBFB2800B4C3BB /* Headers */,
955E4FCB21CBFB2800B4C3BB /* Sources */,
Expand All @@ -88,9 +88,9 @@
);
dependencies = (
);
name = CarlensCollectionViewLayout;
name = CarLensCollectionViewLayout;
productName = CarlensCollectionViewLayout;
productReference = 955E4FCF21CBFB2800B4C3BB /* CarlensCollectionViewLayout.framework */;
productReference = 955E4FCF21CBFB2800B4C3BB /* CarLensCollectionViewLayout.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
Expand All @@ -107,7 +107,7 @@
};
};
};
buildConfigurationList = 955E4FC921CBFB2800B4C3BB /* Build configuration list for PBXProject "CarlensCollectionViewLayout" */;
buildConfigurationList = 955E4FC921CBFB2800B4C3BB /* Build configuration list for PBXProject "CarLensCollectionViewLayout" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
Expand All @@ -119,7 +119,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
955E4FCE21CBFB2800B4C3BB /* CarlensCollectionViewLayout */,
955E4FCE21CBFB2800B4C3BB /* CarLensCollectionViewLayout */,
);
};
/* End PBXProject section */
Expand All @@ -139,9 +139,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9505725E21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift in Sources */,
958D17C021D66DF00067BED6 /* CarlensCollectionViewCell.swift in Sources */,
9505726021D4D922009EA422 /* CarlensLayoutAttributes.swift in Sources */,
9505725E21D4D8FB009EA422 /* CarLensCollectionViewLayout.swift in Sources */,
958D17C021D66DF00067BED6 /* CarLensCollectionViewCell.swift in Sources */,
9505726021D4D922009EA422 /* CarLensLayoutAttributes.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -287,7 +287,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = co.netguru.lib.CarlensCollectionViewLayout;
PRODUCT_BUNDLE_IDENTIFIER = co.netguru.lib.CarLensCollectionViewLayout;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
Expand All @@ -313,7 +313,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = co.netguru.lib.CarlensCollectionViewLayout;
PRODUCT_BUNDLE_IDENTIFIER = co.netguru.lib.CarLensCollectionViewLayout;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
Expand All @@ -325,7 +325,7 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
955E4FC921CBFB2800B4C3BB /* Build configuration list for PBXProject "CarlensCollectionViewLayout" */ = {
955E4FC921CBFB2800B4C3BB /* Build configuration list for PBXProject "CarLensCollectionViewLayout" */ = {
isa = XCConfigurationList;
buildConfigurations = (
955E4FD521CBFB2800B4C3BB /* Debug */,
Expand All @@ -334,7 +334,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
955E4FD721CBFB2800B4C3BB /* Build configuration list for PBXNativeTarget "CarlensCollectionViewLayout" */ = {
955E4FD721CBFB2800B4C3BB /* Build configuration list for PBXNativeTarget "CarLensCollectionViewLayout" */ = {
isa = XCConfigurationList;
buildConfigurations = (
955E4FD821CBFB2800B4C3BB /* Debug */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "955E4FCE21CBFB2800B4C3BB"
BuildableName = "CarlensCollectionViewLayout.framework"
BlueprintName = "CarlensCollectionViewLayout"
ReferencedContainer = "container:CarlensCollectionViewLayout.xcodeproj">
BuildableName = "CarLensCollectionViewLayout.framework"
BlueprintName = "CarLensCollectionViewLayout"
ReferencedContainer = "container:CarLensCollectionViewLayout.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
Expand Down Expand Up @@ -46,9 +46,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "955E4FCE21CBFB2800B4C3BB"
BuildableName = "CarlensCollectionViewLayout.framework"
BlueprintName = "CarlensCollectionViewLayout"
ReferencedContainer = "container:CarlensCollectionViewLayout.xcodeproj">
BuildableName = "CarLensCollectionViewLayout.framework"
BlueprintName = "CarLensCollectionViewLayout"
ReferencedContainer = "container:CarLensCollectionViewLayout.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
Expand All @@ -64,9 +64,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "955E4FCE21CBFB2800B4C3BB"
BuildableName = "CarlensCollectionViewLayout.framework"
BlueprintName = "CarlensCollectionViewLayout"
ReferencedContainer = "container:CarlensCollectionViewLayout.xcodeproj">
BuildableName = "CarLensCollectionViewLayout.framework"
BlueprintName = "CarLensCollectionViewLayout"
ReferencedContainer = "container:CarLensCollectionViewLayout.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
//
// CarListCollectionViewCell.swift
// CarRecognition
// CarLensCollectionViewCell.swift
// CarLensCollectionViewCell
//
// Copyright © 2018 Netguru. All rights reserved.
//


import UIKit.UICollectionView

open class CarlensCollectionViewCell: UICollectionViewCell {
open class CarLensCollectionViewCell: UICollectionViewCell {

/// Indicates if the cell is currently displayed as primary cell.
public var isCurrentlyPrimary = false
Expand Down Expand Up @@ -52,7 +54,7 @@ open class CarlensCollectionViewCell: UICollectionViewCell {
/// - SeeAlso: UICollectionViewCell
override open func apply(_ layoutAttributes: UICollectionViewLayoutAttributes) {
super.apply(layoutAttributes)
guard let attributes = layoutAttributes as? CarlensLayoutAttributes else { return }
guard let attributes = layoutAttributes as? CarLensLayoutAttributes else { return }
isCurrentlyPrimary = !(attributes.progress == 0)
animateViews(toProgress: attributes.progress)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// CarlensCollectionViewLayout.h
// CarlensCollectionViewLayout
// CarLensCollectionViewLayout.h
// CarLensCollectionViewLayout
//
// Created by Anna on 20/12/2018.
// Copyright © 2018 Netguru. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
//
// CarlensCollectionViewLayout.swift
// CarlensCollectionViewLayout
// CarLensCollectionViewLayout.swift
// CarLensCollectionViewLayout
//
// Created by Anna on 27/12/2018.
// Copyright © 2018 Netguru. All rights reserved.
//

import UIKit

public final class CarlensCollectionViewLayout: UICollectionViewFlowLayout {
public final class CarLensCollectionViewLayout: UICollectionViewFlowLayout {

private var firstSetupDone = false

Expand Down Expand Up @@ -37,7 +36,7 @@ public final class CarlensCollectionViewLayout: UICollectionViewFlowLayout {

/// SeeAlso: UICollectionViewFlowLayout
override public class var layoutAttributesClass: AnyClass {
return CarlensLayoutAttributes.self
return CarLensLayoutAttributes.self
}

/// SeeAlso: UICollectionViewFlowLayout
Expand All @@ -53,7 +52,7 @@ public final class CarlensCollectionViewLayout: UICollectionViewFlowLayout {
let ratio = (maxDistance - abs(distanceFromCenter)) / maxDistance
let normalizedRatio = min(1, max(0, ratio))

guard let attributes = attributes as? CarlensLayoutAttributes else { continue }
guard let attributes = attributes as? CarLensLayoutAttributes else { continue }
attributes.progress = Double(normalizedRatio)
}
return allAttributes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
//
// CarListLayoutAttributes.swift
// CarRecognition
// CarLensLayoutAttributes.swift
// CarLensLayoutAttributes
//
// Copyright © 2018 Netguru. All rights reserved.
//


import UIKit

final class CarlensLayoutAttributes: UICollectionViewLayoutAttributes {
final class CarLensLayoutAttributes: UICollectionViewLayoutAttributes {

/// Progress towards the center of the screen, value between 0 and 1.
var progress = 0.0

/// SeeAlso: UICollectionViewLayoutAttributes
override func copy(with zone: NSZone?) -> Any {
let attributes = super.copy(with: zone)
(attributes as? CarlensLayoutAttributes)?.progress = progress
(attributes as? CarLensLayoutAttributes)?.progress = progress
return attributes
}

/// SeeAlso: UICollectionViewLayoutAttributes
override func isEqual(_ object: Any?) -> Bool {
guard let attributes = object as? CarlensLayoutAttributes,
guard let attributes = object as? CarLensLayoutAttributes,
attributes.progress == progress else { return false }
return super.isEqual(object)
}
Expand Down

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CarlensCollectionViewLayout
# CarLensCollectionViewLayout

The beautiful animation of collection view cells.

Expand Down Expand Up @@ -34,6 +34,6 @@ The beautiful animation of collection view cells.

## Related repositories

- [Carlens iOS](https://github.com/netguru/car-recognition-ios)
- [Carlens Android](https://github.com/netguru/car-recognition-android)
- [Carlens Machine Learning](https://github.com/netguru/car-recognition-ml)
- [CarLens iOS](https://github.com/netguru/car-recognition-ios)
- [CarLens Android](https://github.com/netguru/car-recognition-android)
- [CarLens Machine Learning](https://github.com/netguru/car-recognition-ml)
4 changes: 2 additions & 2 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ trigger_map:

app:
envs:
- XCODEBUILD_PROJECT: ./CarlensCollectionViewLayout.xcodeproj
- XCODEBUILD_PROJECT: ./CarLensCollectionViewLayout.xcodeproj

# Workflow declarations

Expand All @@ -33,7 +33,7 @@ workflows:

build:
envs:
- XCODEBUILD_SCHEME: CarlensCollectionViewLayout
- XCODEBUILD_SCHEME: CarLensCollectionViewLayout
before_run:
- build-scheme
after_run:
Expand Down