Commit f5180096 authored by Mike JS. Choi's avatar Mike JS. Choi Committed by Carola Nitz

UI: Create VLCSettingsSheetCell

parent 0bcf87a3
......@@ -11,7 +11,9 @@
class VLCActionSheetCell: UICollectionViewCell {
static let identifier = "VLCActionSheetCell"
@objc static var identifier: String {
return String(describing: self)
}
let icon: UIImageView = {
let icon = UIImageView()
......@@ -25,6 +27,7 @@ class VLCActionSheetCell: UICollectionViewCell {
name.textColor = PresentationTheme.current.colors.cellTextColor
name.font = UIFont.systemFont(ofSize: 15)
name.translatesAutoresizingMaskIntoConstraints = false
name.setContentHuggingPriority(.defaultLow, for: .horizontal)
return name
}()
......@@ -63,9 +66,6 @@ class VLCActionSheetCell: UICollectionViewCell {
icon.heightAnchor.constraint(equalToConstant: 25),
icon.widthAnchor.constraint(equalTo: icon.heightAnchor),
name.trailingAnchor.constraint(equalTo: stackView.trailingAnchor),
name.centerYAnchor.constraint(equalTo: stackView.centerYAnchor),
stackView.leadingAnchor.constraint(equalTo: guide.leadingAnchor, constant: 20),
stackView.trailingAnchor.constraint(equalTo: guide.trailingAnchor, constant: -20),
stackView.heightAnchor.constraint(equalTo: heightAnchor),
......
/*****************************************************************************
* VLCSettingSheetCell.swift
* VLC for iOS
*****************************************************************************
* Copyright © 2018 VLC authors and VideoLAN
* $Id$
*
* Authors: Mike JS. Choi <mkchoi212 # icloud.com>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
class VLCSettingsSheetCell: VLCActionSheetCell {
override var isSelected: Bool {
didSet {
let colors = PresentationTheme.current.colors
name.textColor = isSelected ? colors.orangeUI : colors.cellTextColor
tintColor = isSelected ? colors.orangeUI : colors.cellDetailTextColor
checkmark.isHidden = !isSelected
}
}
let checkmark: UILabel = {
let checkmark = UILabel()
checkmark.text = "✓"
checkmark.font = UIFont.systemFont(ofSize: 18)
checkmark.textColor = PresentationTheme.current.colors.orangeUI
checkmark.translatesAutoresizingMaskIntoConstraints = false
checkmark.isHidden = true
return checkmark
}()
override init(frame: CGRect) {
super.init(frame: frame)
setupViews()
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func setupViews() {
stackView.removeArrangedSubview(icon)
stackView.addArrangedSubview(checkmark)
}
}
......@@ -264,6 +264,7 @@
9BADAF45185FBD9D00108BD8 /* VLCFrostedGlasView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BADAF44185FBD9D00108BD8 /* VLCFrostedGlasView.m */; };
9BE4D1CE183D76950006346C /* VLCCloudStorageTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D3784B0183A990F009EE944 /* VLCCloudStorageTableViewCell.m */; };
A79246C8170F11DF0036AAF2 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A79246C6170F11DF0036AAF2 /* Localizable.strings */; };
CA9734B521083EDA00BBE7C7 /* VLCSettingsSheetCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA9734B421083ED900BBE7C7 /* VLCSettingsSheetCell.swift */; };
CAA0B0ED2072651000B9274E /* VLCTestMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAF76D8F20709C4100E2AD7B /* VLCTestMenu.swift */; };
CAA0B0F02072651A00B9274E /* XCUIElement+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAF76D9320709C9500E2AD7B /* XCUIElement+Helpers.swift */; };
CAA0B0F52072686E00B9274E /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A79246C6170F11DF0036AAF2 /* Localizable.strings */; };
......@@ -1001,6 +1002,7 @@
AC40202FFE42CEDCEB37E50D /* Pods-VLC-tvOS.distribution.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-VLC-tvOS.distribution.xcconfig"; path = "Pods/Target Support Files/Pods-VLC-tvOS/Pods-VLC-tvOS.distribution.xcconfig"; sourceTree = "<group>"; };
C6872E7B396534F3DAF4E48F /* Pods-VLC-iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-VLC-iOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-VLC-iOS/Pods-VLC-iOS.release.xcconfig"; sourceTree = "<group>"; };
CA6FB8222074601900FC9BF2 /* VLC-iOSUITest-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "VLC-iOSUITest-Bridging-Header.h"; sourceTree = "<group>"; };
CA9734B421083ED900BBE7C7 /* VLCSettingsSheetCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = VLCSettingsSheetCell.swift; path = Sources/VLCSettingsSheetCell.swift; sourceTree = "<group>"; };
CAA0B0F620726A0E00B9274E /* TestHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestHelper.swift; sourceTree = "<group>"; };
CABCBAFE20EB15EA0040E2F5 /* VLCSettingsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = VLCSettingsTableViewCell.swift; path = Sources/VLCSettingsTableViewCell.swift; sourceTree = "<group>"; };
CABCBB0020EB38580040E2F5 /* IASKSettingsTableViewController+Protected.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "IASKSettingsTableViewController+Protected.h"; path = "Sources/IASKSettingsTableViewController+Protected.h"; sourceTree = "<group>"; };
......@@ -1585,6 +1587,7 @@
7D3784A3183A98F5009EE944 /* VLCAboutViewController.m */,
7D3784A4183A98F5009EE944 /* VLCSettingsController.h */,
7D3784A5183A98F5009EE944 /* VLCSettingsController.m */,
CA9734B421083ED900BBE7C7 /* VLCSettingsSheetCell.swift */,
CABCBB0020EB38580040E2F5 /* IASKSettingsTableViewController+Protected.h */,
CABCBAFE20EB15EA0040E2F5 /* VLCSettingsTableViewCell.swift */,
7D37849F183A98EB009EE944 /* VLCBugreporter.h */,
......@@ -3404,6 +3407,7 @@
DD3EAC041BE153B4003668DA /* VLCNetworkImageView.m in Sources */,
E0C04F951A25B4410080331A /* VLCDocumentPickerController.m in Sources */,
DDF908E01CF4E04A00108B70 /* VLCNetworkLoginDataSourceSavedLogins.m in Sources */,
CA9734B521083EDA00BBE7C7 /* VLCSettingsSheetCell.swift in Sources */,
DD3EFF351BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserNetService.m in Sources */,
413EC987201A329D00BF412F /* SortOption.swift in Sources */,
41B93C011A53833B00102E8B /* VLCProgressView.m in Sources */,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment