Skip to content

Commit 5e7e18e

Browse files
committed
Refactored BottomSheet disclosureIndicator
Previously the disclosureIndicator had to be shown if you want a selection state on tapping a button in the bottom sheet. This change extracts the disclosure indicator logic from isActionable Now the user can see the cell being tap with a selection state despite not having a disclosure indicator. Not all cells actionable cells display more information so not all need to display a disclosure indicator.
1 parent 8f563cc commit 5e7e18e

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

WooCommerce/Classes/ViewRelated/Orders/Order Creation/FlowCoordinator/BottomSheetOrderType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ final class OrderTypeBottomSheetListSelectorCommand: BottomSheetListSelectorComm
7878
imageTintColor: .gray(.shade20),
7979
numberOfLinesForTitle: 0,
8080
numberOfLinesForText: 0,
81-
isActionable: false)
81+
isActionable: true)
8282
cell.updateUI(viewModel: viewModel)
8383
}
8484

WooCommerce/Classes/ViewRelated/Products/Edit Product/Cells/ImageAndTitleAndTextTableViewCell.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ final class ImageAndTitleAndTextTableViewCell: UITableViewCell {
6868
let numberOfLinesForText: Int
6969
let isActionable: Bool
7070
let isSelected: Bool
71+
let showsDisclosureIndicator: Bool
7172
let showsSeparator: Bool
7273

7374
init(title: String?,
@@ -80,6 +81,7 @@ final class ImageAndTitleAndTextTableViewCell: UITableViewCell {
8081
numberOfLinesForText: Int = 1,
8182
isSelected: Bool = false,
8283
isActionable: Bool = true,
84+
showsDisclosureIndicator: Bool = false,
8385
showsSeparator: Bool = true) {
8486
self.title = title
8587
self.titleFontStyle = titleFontStyle
@@ -91,6 +93,7 @@ final class ImageAndTitleAndTextTableViewCell: UITableViewCell {
9193
self.numberOfLinesForText = numberOfLinesForText
9294
self.isSelected = isSelected
9395
self.isActionable = isActionable
96+
self.showsDisclosureIndicator = showsDisclosureIndicator
9497
self.showsSeparator = showsSeparator
9598
}
9699
}
@@ -157,7 +160,7 @@ extension ImageAndTitleAndTextTableViewCell {
157160
descriptionLabel.numberOfLines = viewModel.numberOfLinesForText
158161
contentImageView.image = viewModel.image
159162
contentImageStackView.isHidden = viewModel.image == nil
160-
accessoryType = viewModel.isActionable ? .disclosureIndicator : (viewModel.isSelected ? .checkmark : .none)
163+
accessoryType = viewModel.showsDisclosureIndicator ? .disclosureIndicator : .none
161164
selectionStyle = viewModel.isActionable ? .default: .none
162165
accessoryView = nil
163166

WooCommerce/Classes/ViewRelated/Products/Edit Product/Downloadable Files/File List/BottomSheetListSelector/DownloadableFileBottomSheetListSelectorCommand.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ final class DownloadableFileBottomSheetListSelectorCommand: BottomSheetListSelec
2626
textTintColor: .text,
2727
image: model.image,
2828
imageTintColor: .gray(.shade20),
29-
numberOfLinesForText: 0)
29+
numberOfLinesForText: 0,
30+
showsDisclosureIndicator: true)
3031
cell.updateUI(viewModel: viewModel)
3132
}
3233

0 commit comments

Comments
 (0)