完善账号切换展示、首页菜单图标与有线传输设置 chip。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-15 14:59:31 +08:00
parent 5eef31b8da
commit ce6de76055
18 changed files with 321 additions and 130 deletions

View File

@ -40,10 +40,9 @@ final class WiredCameraTransferViewController: BaseViewController {
private let refreshButton = UIButton(type: .system)
private let helpLabel = UILabel()
private let chipsStack = UIStackView()
private let retouchButton = UIButton(type: .system)
private let formatButton = UIButton(type: .system)
private let modeButton = UIButton(type: .system)
private let modeChevronView = UIImageView()
private let retouchButton = WiredTransferSettingChipButton()
private let formatButton = WiredTransferSettingChipButton()
private let modeButton = WiredTransferSettingChipButton(showsChevron: true)
private let settingsStatsDivider = UIView()
private let statsCard = UIStackView()
private let firstStatsDivider = UIView()
@ -160,19 +159,10 @@ final class WiredCameraTransferViewController: BaseViewController {
chipsStack.spacing = 6
chipsStack.distribution = .fillEqually
[retouchButton, formatButton, modeButton].forEach {
configureChipButton($0)
chipsStack.addArrangedSubview($0)
}
retouchButton.isUserInteractionEnabled = false
formatButton.isUserInteractionEnabled = false
modeButton.setConfigurationContentInsets(
NSDirectionalEdgeInsets(top: 6, leading: 10, bottom: 6, trailing: 32)
)
modeChevronView.image = UIImage(systemName: "chevron.down")?
.withConfiguration(UIImage.SymbolConfiguration(pointSize: 13, weight: .semibold))
modeChevronView.tintColor = AppColor.textTertiary
modeChevronView.contentMode = .scaleAspectFit
modeChevronView.isUserInteractionEnabled = false
settingsStatsDivider.backgroundColor = AppColor.border
statsCard.axis = .horizontal
@ -269,7 +259,6 @@ final class WiredCameraTransferViewController: BaseViewController {
view.addSubview(emptyLabel)
view.addSubview(bottomBar)
bottomBar.addSubview(bottomButtonsStack)
modeButton.addSubview(modeChevronView)
bottomButtonsStack.addArrangedSubview(batchButton)
bottomButtonsStack.addArrangedSubview(specifyButton)
bottomButtonsStack.addArrangedSubview(albumImportButton)
@ -318,11 +307,6 @@ final class WiredCameraTransferViewController: BaseViewController {
make.leading.trailing.equalToSuperview().inset(14)
make.height.equalTo(34)
}
modeChevronView.snp.makeConstraints { make in
make.trailing.equalToSuperview().offset(-10)
make.centerY.equalToSuperview()
make.size.equalTo(16)
}
settingsStatsDivider.snp.makeConstraints { make in
make.top.equalTo(chipsStack.snp.bottom).offset(12)
make.leading.trailing.equalToSuperview()
@ -431,9 +415,9 @@ final class WiredCameraTransferViewController: BaseViewController {
statusLabel.backgroundColor = (isFailed ? AppColor.danger : AppColor.primary).withAlphaComponent(0.10)
refreshButton.setTitle(viewModel.actionButtonText, for: .normal)
retouchButton.setTitle(viewModel.retouchOption, for: .normal)
formatButton.setTitle("JPG", for: .normal)
modeButton.setTitle(viewModel.transferModeOption, for: .normal)
retouchButton.apply(title: viewModel.retouchOption)
formatButton.apply(title: "JPG")
modeButton.apply(title: viewModel.transferModeOption)
helpLabel.attributedText = helpText(viewModel.sonyMTPHint)
rebuildStats()
@ -642,19 +626,6 @@ final class WiredCameraTransferViewController: BaseViewController {
statsCard.bringSubviewToFront(secondStatsDivider)
}
private func configureChipButton(_ button: UIButton) {
button.titleLabel?.font = .systemFont(ofSize: 11)
button.setTitleColor(AppColor.textTertiary, for: .normal)
button.backgroundColor = AppColor.pageBackground
button.layer.cornerRadius = 8
button.layer.borderWidth = 1
button.layer.borderColor = AppColor.border.cgColor
button.contentHorizontalAlignment = .leading
button.setConfigurationContentInsets(
NSDirectionalEdgeInsets(top: 6, leading: 10, bottom: 6, trailing: 10)
)
}
private func makeStatButton(title: String, count: Int, selected: Bool, danger: Bool) -> UIButton {
var config = UIButton.Configuration.plain()
config.title = "\(count)"