Digital ACT-191 ONEAPP-7013 story: updated views with tile container and removed slot border

This commit is contained in:
Vasavi Kanamarlapudi 2024-07-18 20:28:04 +05:30
parent 304ee8ff7e
commit e89acb3c12

View File

@ -61,16 +61,10 @@ class CarouselViewController: BaseViewController<Carousel> {
var paginationInsetField = NumericField() var paginationInsetField = NumericField()
var selectedIndexField = NumericField() var selectedIndexField = NumericField()
var rows: [UIView] = [] var rows: [UIView] = []
var infoLabel = Label().with { $0.textStyle = .boldBodyMedium }
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
infoLabel.text = "Added Border To Slot Only For VQA Test." addContentTopView(view: component)
let stack = UIStackView(arrangedSubviews: [component, infoLabel]).with {
$0.axis = .vertical
$0.spacing = 25
}
addContentTopView(view: stack)
setupPicker() setupPicker()
setupModel() setupModel()
} }
@ -138,9 +132,19 @@ class CarouselViewController: BaseViewController<Carousel> {
rows.append(Button().with{ $0.use = .secondary; $0.text = "Shop"; $0.onClick = onClick}) rows.append(Button().with{ $0.use = .secondary; $0.text = "Shop"; $0.onClick = onClick})
rows.append(Button().with{ $0.use = .secondary; $0.text = "Buy"; $0.onClick = onClick}) rows.append(Button().with{ $0.use = .secondary; $0.text = "Buy"; $0.onClick = onClick})
rows.append(Button().with{ $0.use = .secondary; $0.text = "Offer"; $0.onClick = onClick}) rows.append(Button().with{ $0.use = .secondary; $0.text = "Offer"; $0.onClick = onClick})
component.views = rows component.views = rows.compactMap({ view in
return TileContainer().with { instance in
instance.aspectRatio = .none
instance.addContentView(view)
instance.color = .custom(.lightGray)
}
})
label.text = "0" label.text = "0"
component.slotAlignment = .init(vertical: Carousel.Vertical.top, horizontal: Carousel.Horizontal.left)
horizAlignmtPickerSelectorView.text = Carousel.Horizontal.left.rawValue
vertAlignmtPickerSelectorView.text = Carousel.Vertical.top.rawValue
// Callback when moving the carousel. Returns selectedGroupIndex. // Callback when moving the carousel. Returns selectedGroupIndex.
component.onChange = { [weak self] selectedGroupIndex in component.onChange = { [weak self] selectedGroupIndex in
guard let self else { return } guard let self else { return }
@ -152,7 +156,6 @@ class CarouselViewController: BaseViewController<Carousel> {
surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in
self?.component.surface = item self?.component.surface = item
self?.contentTopView.backgroundColor = item.color self?.contentTopView.backgroundColor = item.color
self?.infoLabel.surface = item
} }
paginationDisplayPickerSelectorView.onPickerDidSelect = { [weak self] item in paginationDisplayPickerSelectorView.onPickerDidSelect = { [weak self] item in