removed new adobe method calling

This commit is contained in:
Damodaram 2020-06-16 20:53:21 +05:30
parent 0e0de7a0fa
commit c5b4b5dfbf
3 changed files with 10 additions and 18 deletions

View File

@ -18,7 +18,7 @@ public protocol CarouselPageControlProtocol {
open class Carousel: View { open class Carousel: View {
public let collectionView: CollectionView = { public let collectionView: CollectionView = {
let layout = UICollectionViewFlowLayout() let layout = UICollectionViewFlowLayout()
layout.scrollDirection = .horizontal layout.scrollDirection = .horizontal
@ -26,7 +26,7 @@ open class Carousel: View {
layout.minimumLineSpacing = 0 layout.minimumLineSpacing = 0
return CollectionView(frame: .zero, collectionViewLayout: layout) return CollectionView(frame: .zero, collectionViewLayout: layout)
}() }()
/// The current index of the collection view. Includes dummy cells when looping. /// The current index of the collection view. Includes dummy cells when looping.
public var currentIndex = 0 public var currentIndex = 0
@ -85,7 +85,7 @@ open class Carousel: View {
open func layoutCollection() { open func layoutCollection() {
collectionView.collectionViewLayout.invalidateLayout() collectionView.collectionViewLayout.invalidateLayout()
showPeaking(false) showPeaking(false)
// Go to current cell. layoutIfNeeded is needed otherwise cellForItem returns nil for peaking logic. The dispatch is a sad way to ensure the collection view is ready to be scrolled. // Go to current cell. layoutIfNeeded is needed otherwise cellForItem returns nil for peaking logic. The dispatch is a sad way to ensure the collection view is ready to be scrolled.
guard let model = model as? CarouselModel, guard let model = model as? CarouselModel,
(model.paging == true || model.loop == true) else { return } (model.paging == true || model.loop == true) else { return }
@ -145,19 +145,19 @@ open class Carousel: View {
collectionView.layer.borderWidth = (carouselModel.border ?? false) ? 1 : 0 collectionView.layer.borderWidth = (carouselModel.border ?? false) ? 1 : 0
backgroundColor = .white backgroundColor = .white
(collectionView.collectionViewLayout as? UICollectionViewFlowLayout)?.minimumLineSpacing = carouselModel.spacing ?? 0 (collectionView.collectionViewLayout as? UICollectionViewFlowLayout)?.minimumLineSpacing = carouselModel.spacing ?? 0
itemWidthPercent = carouselModel.itemWidthPercent / 100.0 itemWidthPercent = carouselModel.itemWidthPercent / 100.0
if let alignment = carouselModel.itemAlignment { if let alignment = carouselModel.itemAlignment {
itemAlignment = alignment itemAlignment = alignment
} }
if let height = carouselModel.height { if let height = carouselModel.height {
collectionViewHeight?.constant = height collectionViewHeight?.constant = height
} }
registerCells(with: carouselModel, delegateObject: delegateObject) registerCells(with: carouselModel, delegateObject: delegateObject)
prepareMolecules(with: carouselModel) prepareMolecules(with: carouselModel)
setupPagingMolecule(carouselModel.pagingMolecule, delegateObject: delegateObject) setupPagingMolecule(carouselModel.pagingMolecule, delegateObject: delegateObject)
pageIndex = carouselModel.index pageIndex = carouselModel.index
@ -185,7 +185,7 @@ open class Carousel: View {
if carouselModel?.loop ?? false && newMolecules.count > 1 { if carouselModel?.loop ?? false && newMolecules.count > 1 {
// Sets up the row data with buffer cells on each side (for illusion of endless scroll... also has one more buffer cell on each side in case we can peek that cell). // Sets up the row data with buffer cells on each side (for illusion of endless scroll... also has one more buffer cell on each side in case we can peek that cell).
loop = true loop = true
molecules?.insert(contentsOf: newMolecules.suffix(2), at: 0) molecules?.insert(contentsOf: newMolecules.suffix(2), at: 0)
molecules?.append(contentsOf: newMolecules.prefix(2)) molecules?.append(contentsOf: newMolecules.prefix(2))
} }
@ -306,8 +306,7 @@ open class Carousel: View {
let viewcontrollerObject = delegateObject?.moleculeDelegate as? MVMCoreViewControllerProtocol else { return } let viewcontrollerObject = delegateObject?.moleculeDelegate as? MVMCoreViewControllerProtocol else { return }
analyticsData[KeyAdobeTrackerPageType] = viewcontrollerObject.loadObject??.pageType analyticsData[KeyAdobeTrackerPageType] = viewcontrollerObject.loadObject??.pageType
analyticsData["ClassName"] = String(describing: type(of: viewcontrollerObject)) analyticsData["ClassName"] = String(describing: type(of: viewcontrollerObject))
MVMCoreUILoggingHandler.shared()?.trackAdobeAnalytics(analyticsData) MVMCoreUILoggingHandler.shared()?.defaultLogAction(forController: viewcontrollerObject, actionInformation: itemModel.toJSON(), additionalData: nil)
} }
} }
@ -386,7 +385,7 @@ extension Carousel: UIScrollViewDelegate {
} }
open func scrollViewDidScroll(_ scrollView: UIScrollView) { open func scrollViewDidScroll(_ scrollView: UIScrollView) {
// Adjust for looping // Adjust for looping
if let model = model as? CarouselModel, if let model = model as? CarouselModel,
model.loop == true { model.loop == true {
@ -455,7 +454,7 @@ extension Carousel: UIScrollViewDelegate {
} else { } else {
targetContentOffset.pointee = scrollView.contentOffset targetContentOffset.pointee = scrollView.contentOffset
} }
// Cap the index. // Cap the index.
let lastCellIndex = collectionView(collectionView, numberOfItemsInSection: 0) - 1 let lastCellIndex = collectionView(collectionView, numberOfItemsInSection: 0) - 1
goTo(min(max(cellToSwipeTo, 0), lastCellIndex), animated: true) goTo(min(max(cellToSwipeTo, 0), lastCellIndex), animated: true)

View File

@ -20,9 +20,6 @@ NS_ASSUME_NONNULL_BEGIN
- (void)defaultLogActionForController:(nonnull id <MVMCoreViewControllerProtocol>)controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData; - (void)defaultLogActionForController:(nonnull id <MVMCoreViewControllerProtocol>)controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData;
- (nullable NSDictionary *)defaultGetActionTrackDataDictionaryForController:(nonnull id <MVMCoreViewControllerProtocol>)controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData; - (nullable NSDictionary *)defaultGetActionTrackDataDictionaryForController:(nonnull id <MVMCoreViewControllerProtocol>)controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData;
- (void)trackAdobeAnalytics:(nullable NSDictionary *)analyticsData;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@ -19,9 +19,5 @@
- (nullable NSDictionary *)defaultGetActionTrackDataDictionaryForController:(nonnull id <MVMCoreViewControllerProtocol>)controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData { - (nullable NSDictionary *)defaultGetActionTrackDataDictionaryForController:(nonnull id <MVMCoreViewControllerProtocol>)controller actionInformation:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData {
return nil; return nil;
} }
- (void)trackAnalyticsAction:(nullable NSDictionary *)analyticsData{
}
@end @end