Commit 05285cbf authored by Carola Nitz's avatar Carola Nitz

MediaSubcategoryViewcontroller: remove image in swipable bar

remove unnecessary code in ButtonBarView, remove the ButtonBarPagerTabStripSettings
and other enums in BaseButtonBarPagerTabStripViewController.swift
parent aeef84bd
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14092" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14081.1"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="2CI-9N-dP3" userLabel="Icon Label Cell" customClass="IconLabelCell" customModule="VLC_iOS" customModuleProvider="target">
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="2CI-9N-dP3" userLabel="Icon Label Cell" customClass="LabelCell" customModule="VLC_iOS" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="74" height="70"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="74" height="70"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Tkn-VR-o25">
<rect key="frame" x="20" y="10" width="35" height="35"/>
<constraints>
<constraint firstAttribute="width" constant="35" id="EUF-rI-9Y8"/>
<constraint firstAttribute="height" constant="35" id="RoA-LT-AHV"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rwk-fy-4KB">
<rect key="frame" x="0.0" y="45" width="74" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="kWi-HY-P6M"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</view>
<constraints>
<constraint firstItem="rwk-fy-4KB" firstAttribute="top" secondItem="Tkn-VR-o25" secondAttribute="bottom" id="A8G-Sk-d4C"/>
<constraint firstItem="Tkn-VR-o25" firstAttribute="top" secondItem="2CI-9N-dP3" secondAttribute="top" constant="10" id="DaW-j3-w2g"/>
<constraint firstItem="rwk-fy-4KB" firstAttribute="leading" secondItem="2CI-9N-dP3" secondAttribute="leading" id="HFm-qh-fCk"/>
<constraint firstAttribute="bottom" secondItem="rwk-fy-4KB" secondAttribute="bottom" constant="5" id="Q0g-pb-bbf"/>
<constraint firstAttribute="trailing" secondItem="rwk-fy-4KB" secondAttribute="trailing" id="YuE-x9-9EY"/>
<constraint firstItem="Tkn-VR-o25" firstAttribute="centerX" secondItem="2CI-9N-dP3" secondAttribute="centerX" id="wav-eA-a2N"/>
</constraints>
<size key="customSize" width="74" height="50"/>
<connections>
<outlet property="iconImage" destination="Tkn-VR-o25" id="7DO-mm-BJX"/>
<outlet property="iconLabel" destination="rwk-fy-4KB" id="76s-nG-weE"/>
</connections>
<point key="canvasLocation" x="317" y="376"/>
......
......@@ -51,9 +51,7 @@
"CONTINUE_PLAYBACK" = "Continue playback?";
"CONTINUE_PLAYBACK_LONG" = "Would you like to continue playback of \"%@\" where you left off?";
"BUTTON_ALL" = "Select All";
"BUTTON_BACK" = "Back";
"BUTTON_EDIT" = "Edit";
"BUTTON_DONE" = "Done";
"BUTTON_CANCEL" = "Cancel";
"BUTTON_SAVE" = "Save";
......@@ -108,7 +106,6 @@
"LIBRARY_SINGLE_EPISODE" = "%i Episode, %i unread";
"LIBRARY_TRACK_N" = "Track %i";
"LIBRARY_MINUTES_LEFT" = "%@m left";
"RENAME_MEDIA_TO" = "Enter new name for %@";
"SHARING_ACTION_SHEET_TITLE_CHOOSE_FILE" = "Choose a file to open:";
......@@ -286,10 +283,6 @@
// Insert %@ where play-pause-glyph should be placed
"DELETE_ITEM_HINT" = "Press %@ to Delete"; /* Insert %@ where play-pause-glyph should be placed */
"DELETE_INVALID_MESSAGE" = "The selection can't be deleted";
"DELETE_INVALID_TITLE" = "Invalid Selection";
"DELETE_MESSAGE" = "Confirm the deletion of the selected files";
"DELETE_TITLE" = "Delete Selected Files";
//Drag and Drop
"THIS_FILE" = "This file";
......@@ -310,11 +303,12 @@
"FOLDER_EMPTY" = "FOLDER_EMPTY";
/* New strings */
"albums" = "albums";
"artists" = "artists";
"genres" = "genres";
"movies" = "movies";
"playlists" = "playlists";
"songs" = "songs";
"videos" = "videos";
"episodes" = "episodes";
"ALBUMS" = "Albums";
"ARTISTS" = "Artists";
"AUDIO_PLAYLISTS" = "Playlists";
"EPISODES" = "Episodes";
"GENRES" = "Genres";
"MOVIES" = "Movies";
"SONGS" = "Songs";
"VIDEOS" = "Videos";
"VIDEO_PLAYLISTS" = "Playlists";
......@@ -9,9 +9,8 @@
import Foundation
class IconLabelCell: UICollectionViewCell {
class LabelCell: UICollectionViewCell {
@IBOutlet weak var iconImage: UIImageView!
@IBOutlet weak var iconLabel: UILabel!
}
......@@ -21,38 +20,14 @@ public enum SwipeDirection {
case none
}
public struct ButtonBarPagerTabStripSettings {
public struct Style {
public var buttonBarBackgroundColor: UIColor?
public var buttonBarMinimumInteritemSpacing: CGFloat?
public var buttonBarMinimumLineSpacing: CGFloat?
public var selectedBarBackgroundColor = UIColor.black
public var selectedBarHeight: CGFloat = 5
public var selectedBarVerticalAlignment: SelectedBarVerticalAlignment = .bottom
public var buttonBarItemFont = UIFont.systemFont(ofSize: 18)
public var buttonBarItemLeftRightMargin: CGFloat = 8
public var buttonBarItemTitleColor: UIColor?
public var buttonBarItemsShouldFillAvailableWidth = true
// only used if button bar is created programaticaly and not using storyboards or nib files
public var buttonBarHeight: CGFloat?
}
public var style = Style()
}
public struct IndicatorInfo {
public var title: String?
public var image: UIImage?
public var accessibilityLabel: String?
public init(title: String?, image: UIImage?) {
public init(title: String) {
self.title = title
self.accessibilityLabel = title
self.image = image
}
}
......@@ -60,36 +35,21 @@ public struct IndicatorInfo {
public enum ButtonBarItemSpec<CellType: UICollectionViewCell> {
case nibFile(nibName: String, bundle: Bundle?, width:((IndicatorInfo)-> CGFloat))
case cellClass(width:((IndicatorInfo)-> CGFloat))
public var weight: ((IndicatorInfo) -> CGFloat) {
switch self {
case .cellClass(let widthCallback):
return widthCallback
case .nibFile(_, _, let widthCallback):
return widthCallback
}
}
}
public enum PagerScroll {
case no
case yes
case scrollOnlyIfOutOfScreen
}
public enum SelectedBarAlignment {
case left
case center
case right
case progressive
}
public enum SelectedBarVerticalAlignment {
case top
case middle
case bottom
}
open class ButtonBarView: UICollectionView {
open lazy var selectedBar: UIView = { [unowned self] in
......@@ -103,8 +63,7 @@ open class ButtonBarView: UICollectionView {
updateSelectedBarYPosition()
}
}
var selectedBarVerticalAlignment: SelectedBarVerticalAlignment = .bottom
var selectedBarAlignment: SelectedBarAlignment = .center
var selectedIndex = 0
required public init?(coder aDecoder: NSCoder) {
......@@ -190,24 +149,7 @@ open class ButtonBarView: UICollectionView {
}
private func contentOffsetForCell(withFrame cellFrame: CGRect, andIndex index: Int) -> CGFloat {
let sectionInset = (collectionViewLayout as! UICollectionViewFlowLayout).sectionInset // swiftlint:disable:this force_cast
var alignmentOffset: CGFloat = 0.0
switch selectedBarAlignment {
case .left:
alignmentOffset = sectionInset.left
case .right:
alignmentOffset = frame.size.width - sectionInset.right - cellFrame.size.width
case .center:
alignmentOffset = (frame.size.width - cellFrame.size.width) * 0.5
case .progressive:
let cellHalfWidth = cellFrame.size.width * 0.5
let leftAlignmentOffset = sectionInset.left + cellHalfWidth
let rightAlignmentOffset = frame.size.width - sectionInset.right - cellHalfWidth
let numberOfItems = dataSource!.collectionView(self, numberOfItemsInSection: 0)
let progress = index / (numberOfItems - 1)
alignmentOffset = leftAlignmentOffset + (rightAlignmentOffset - leftAlignmentOffset) * CGFloat(progress) - cellHalfWidth
}
let alignmentOffset = (frame.size.width - cellFrame.size.width) * 0.5
var contentOffset = cellFrame.origin.x - alignmentOffset
contentOffset = max(0, contentOffset)
......@@ -217,16 +159,7 @@ open class ButtonBarView: UICollectionView {
private func updateSelectedBarYPosition() {
var selectedBarFrame = selectedBar.frame
switch selectedBarVerticalAlignment {
case .top:
selectedBarFrame.origin.y = 0
case .middle:
selectedBarFrame.origin.y = (frame.size.height - selectedBarHeight) / 2
case .bottom:
selectedBarFrame.origin.y = frame.size.height - selectedBarHeight
}
selectedBarFrame.origin.y = frame.size.height - selectedBarHeight
selectedBarFrame.size.height = selectedBarHeight
selectedBar.frame = selectedBarFrame
}
......@@ -239,9 +172,7 @@ open class ButtonBarView: UICollectionView {
open class BaseButtonBarPagerTabStripViewController<ButtonBarCellType: UICollectionViewCell>: PagerTabStripViewController, PagerTabStripDataSource, PagerTabStripIsProgressiveDelegate, UICollectionViewDelegate, UICollectionViewDataSource {
public var settings = ButtonBarPagerTabStripSettings()
public var buttonBarItemSpec: ButtonBarItemSpec<ButtonBarCellType>!
public var changeCurrentIndex: ((_ oldCell: ButtonBarCellType?, _ newCell: ButtonBarCellType?, _ animated: Bool) -> Void)?
public var changeCurrentIndexProgressive: ((_ oldCell: ButtonBarCellType?, _ newCell: ButtonBarCellType?, _ progressPercentage: CGFloat, _ changeCurrentIndex: Bool, _ animated: Bool) -> Void)?
@IBOutlet public weak var buttonBarView: ButtonBarView!
......@@ -268,27 +199,29 @@ open class BaseButtonBarPagerTabStripViewController<ButtonBarCellType: UICollect
let buttonBarViewAux = buttonBarView ?? {
let flowLayout = UICollectionViewFlowLayout()
flowLayout.scrollDirection = .horizontal
let buttonBarHeight = settings.style.buttonBarHeight ?? 44
let yPos: CGFloat;
if #available(iOS 11.0, *) {
yPos = navigationController!.navigationBar.safeAreaInsets.top + navigationController!.navigationBar.frame.height
} else {
yPos = navigationController!.navigationBar.frame.maxY
}
let buttonBar = ButtonBarView(frame: CGRect(x: 0, y: yPos, width: view.frame.size.width, height: buttonBarHeight), collectionViewLayout: flowLayout)
// let buttonBarHeight:CGFloat = 34.0
// let yPos: CGFloat;
// if #available(iOS 11.0, *) {
// yPos = navigationController!.navigationBar.safeAreaInsets.top + navigationController!.navigationBar.frame.height
// } else {
// yPos = navigationController!.navigationBar.frame.maxY
// }
let buttonBar = ButtonBarView(frame: .zero, collectionViewLayout: flowLayout)
buttonBar.backgroundColor = .orange
buttonBar.selectedBar.backgroundColor = .black
buttonBar.autoresizingMask = .flexibleWidth
var newContainerViewFrame = containerView.frame
newContainerViewFrame.origin.y = buttonBar.frame.maxY
newContainerViewFrame.size.height = containerView.frame.size.height - (buttonBar.frame.maxY - containerView.frame.origin.y)
containerView.frame = newContainerViewFrame
// var newContainerViewFrame = containerView.frame
// newContainerViewFrame.origin.y = buttonBar.frame.maxY
// newContainerViewFrame.size.height = containerView.frame.size.height - (buttonBar.frame.maxY - containerView.frame.origin.y)
// containerView.frame = newContainerViewFrame
return buttonBar
}()
buttonBarView = buttonBarViewAux
if buttonBarView.superview == nil {
buttonBarView.translates
view.addSubview(buttonBarView)
NSlAyou
}
if buttonBarView.delegate == nil {
buttonBarView.delegate = self
......@@ -299,19 +232,16 @@ open class BaseButtonBarPagerTabStripViewController<ButtonBarCellType: UICollect
buttonBarView.scrollsToTop = false
let flowLayout = buttonBarView.collectionViewLayout as! UICollectionViewFlowLayout // swiftlint:disable:this force_cast
flowLayout.scrollDirection = .horizontal
flowLayout.minimumInteritemSpacing = settings.style.buttonBarMinimumInteritemSpacing ?? flowLayout.minimumInteritemSpacing
flowLayout.minimumLineSpacing = settings.style.buttonBarMinimumLineSpacing ?? flowLayout.minimumLineSpacing
buttonBarView.showsHorizontalScrollIndicator = false
buttonBarView.backgroundColor = settings.style.buttonBarBackgroundColor ?? buttonBarView.backgroundColor
buttonBarView.selectedBar.backgroundColor = settings.style.selectedBarBackgroundColor
buttonBarView.backgroundColor = .white
buttonBarView.selectedBar.backgroundColor = PresentationTheme.current.colors.orangeUI
buttonBarView.selectedBarHeight = settings.style.selectedBarHeight
buttonBarView.selectedBarHeight = 4.0
// register button bar item cell
switch buttonBarItemSpec! {
case .nibFile(let nibName, let bundle, _):
buttonBarView.register(UINib(nibName: nibName, bundle: bundle), forCellWithReuseIdentifier:"Cell")
case .cellClass:
buttonBarView.register(ButtonBarCellType.self, forCellWithReuseIdentifier:"Cell")
}
}
......@@ -354,19 +284,17 @@ open class BaseButtonBarPagerTabStripViewController<ButtonBarCellType: UICollect
open override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
let yPos: CGFloat;
if #available(iOS 11.0, *) {
yPos = navigationController!.navigationBar.safeAreaInsets.top + navigationController!.navigationBar.frame.height
} else {
yPos = navigationController!.navigationBar.frame.maxY
}
if let buttonBarView = buttonBarView {
buttonBarView.frame = CGRect(x: 0, y: yPos, width: view.frame.size.width, height: buttonBarView.frame.height)
var newContainerViewFrame = containerView.frame
newContainerViewFrame.origin.y = buttonBarView.frame.maxY
newContainerViewFrame.size.height = containerView.frame.size.height - (buttonBarView.frame.maxY - containerView.frame.origin.y)
containerView.frame = newContainerViewFrame
}
}
open override func updateContent() {
super.updateContent()
// let yPos: CGFloat;
// if #available(iOS 11.0, *) {
// yPos = navigationController!.navigationBar.safeAreaInsets.top + navigationController!.navigationBar.frame.height
// } else {
// yPos = navigationController!.navigationBar.frame.maxY
// }
buttonBarView.frame = CGRect(x: CGFloat(0), y: 150
- buttonBarView.frame.height, width: view.frame.width, height: buttonBarView.frame.height)
}
// MARK: - Public Methods
......@@ -404,12 +332,6 @@ open class BaseButtonBarPagerTabStripViewController<ButtonBarCellType: UICollect
open func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int) {
guard shouldUpdateButtonBarView else { return }
buttonBarView.moveTo(index: toIndex, animated: true, swipeDirection: toIndex < fromIndex ? .right : .left, pagerScroll: .yes)
if let changeCurrentIndex = changeCurrentIndex {
let oldCell = buttonBarView.cellForItem(at: IndexPath(item: currentIndex != fromIndex ? fromIndex : toIndex, section: 0)) as? ButtonBarCellType
let newCell = buttonBarView.cellForItem(at: IndexPath(item: currentIndex, section: 0)) as? ButtonBarCellType
changeCurrentIndex(oldCell, newCell, true)
}
}
open func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int, withProgressPercentage progressPercentage: CGFloat, indexWasChanged: Bool) {
......@@ -492,10 +414,6 @@ open class BaseButtonBarPagerTabStripViewController<ButtonBarCellType: UICollect
let childController = viewController as! IndicatorInfoProvider // swiftlint:disable:this force_cast
let indicatorInfo = childController.indicatorInfo(for: self)
switch buttonBarItemSpec! {
case .cellClass(let widthCallback):
let width = widthCallback(indicatorInfo)
minimumCellWidths.append(width)
collectionViewContentWidth += width
case .nibFile(_, _, let widthCallback):
let width = widthCallback(indicatorInfo)
minimumCellWidths.append(width)
......@@ -508,7 +426,7 @@ open class BaseButtonBarPagerTabStripViewController<ButtonBarCellType: UICollect
let collectionViewAvailableVisibleWidth = buttonBarView.frame.size.width - flowLayout.sectionInset.left - flowLayout.sectionInset.right
if !settings.style.buttonBarItemsShouldFillAvailableWidth || collectionViewAvailableVisibleWidth < collectionViewContentWidth {
if collectionViewAvailableVisibleWidth < collectionViewContentWidth {
return minimumCellWidths
} else {
let stretchedCellWidthIfAllEqual = (collectionViewAvailableVisibleWidth - cellSpacingTotal) / CGFloat(numberOfCells)
......@@ -535,12 +453,7 @@ public protocol IndicatorInfoProvider {
}
public protocol PagerTabStripDelegate: class {
func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int)
}
public protocol PagerTabStripIsProgressiveDelegate: PagerTabStripDelegate {
public protocol PagerTabStripIsProgressiveDelegate: class {
func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int, withProgressPercentage progressPercentage: CGFloat, indexWasChanged: Bool)
}
......@@ -556,7 +469,7 @@ open class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
@IBOutlet weak public var containerView: UIScrollView!
open weak var delegate: PagerTabStripDelegate?
open weak var delegate: PagerTabStripIsProgressiveDelegate?
open weak var datasource: PagerTabStripDataSource?
open private(set) var viewControllers = [UIViewController]()
......@@ -685,12 +598,7 @@ open class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
}
// MARK: - Helpers
public enum PagerTabStripError: Error {
case viewControllerOutOfBounds
}
open func updateIfNeeded() {
if isViewLoaded && !lastSize.equalTo(containerView.bounds.size) {
updateContent()
......@@ -709,6 +617,10 @@ open class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
return (CGFloat(index) * containerView.bounds.width) + ((containerView.bounds.width - view.bounds.width) * 0.5)
}
public enum PagerTabStripError: Error {
case viewControllerOutOfBounds
}
open func offsetForChild(viewController: UIViewController) throws -> CGFloat {
guard let index = viewControllers.index(of: viewController) else {
throw PagerTabStripError.viewControllerOutOfBounds
......@@ -782,8 +694,6 @@ open class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
let (fromIndex, toIndex, scrollPercentage) = progressiveIndicatorData(virtualPage)
progressiveDelegate.updateIndicator(for: self, fromIndex: fromIndex, toIndex: toIndex, withProgressPercentage: scrollPercentage, indexWasChanged: changeCurrentIndex)
} else {
delegate?.updateIndicator(for: self, fromIndex: min(oldCurrentIndex, pagerViewControllers.count - 1), toIndex: newCurrentIndex)
}
}
......
......@@ -34,14 +34,14 @@ class VLCAudioSubcategoryViewController: VLCMediaSubcategoryViewController
}
}
class VLCMediaSubcategoryViewController: BaseButtonBarPagerTabStripViewController<IconLabelCell> {
class VLCMediaSubcategoryViewController: BaseButtonBarPagerTabStripViewController<LabelCell> {
internal var services: Services
init(services: Services) {
self.services = services
super.init(nibName: nil, bundle: nil)
buttonBarItemSpec = ButtonBarItemSpec.nibFile(nibName: "IconLabelCell", bundle: Bundle.main, width: { _ in
buttonBarItemSpec = ButtonBarItemSpec.nibFile(nibName: "LabelCell", bundle: Bundle.main, width: { _ in
return 70.0
})
}
......@@ -51,18 +51,10 @@ class VLCMediaSubcategoryViewController: BaseButtonBarPagerTabStripViewControlle
}
override func viewDidLoad() {
// change selected bar color
settings.style.buttonBarBackgroundColor = .white
settings.style.selectedBarBackgroundColor = PresentationTheme.current.colors.orangeUI
settings.style.selectedBarHeight = 4.0
settings.style.buttonBarItemTitleColor = .black
settings.style.buttonBarItemsShouldFillAvailableWidth = true
changeCurrentIndexProgressive = { (oldCell: IconLabelCell?, newCell: IconLabelCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) in
changeCurrentIndexProgressive = { (oldCell: LabelCell?, newCell: LabelCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) in
guard changeCurrentIndex == true else { return }
oldCell?.iconImage.tintColor = PresentationTheme.current.colors.cellDetailTextColor
oldCell?.iconLabel.textColor = PresentationTheme.current.colors.cellDetailTextColor
newCell?.iconImage.tintColor = PresentationTheme.current.colors.orangeUI
newCell?.iconLabel.textColor = PresentationTheme.current.colors.orangeUI
}
if #available(iOS 11.0, *) {
......@@ -77,9 +69,8 @@ class VLCMediaSubcategoryViewController: BaseButtonBarPagerTabStripViewControlle
fatalError("this should only be used as subclass")
}
override func configure(cell: IconLabelCell, for indicatorInfo: IndicatorInfo) {
cell.iconImage.image = indicatorInfo.image?.withRenderingMode(.alwaysTemplate)
cell.iconLabel.text = indicatorInfo.title?.trimmingCharacters(in: .whitespacesAndNewlines)
override func configure(cell: LabelCell, for indicatorInfo: IndicatorInfo) {
cell.iconLabel.text = indicatorInfo.title
}
override func updateIndicator(for viewController: PagerTabStripViewController, fromIndex: Int, toIndex: Int, withProgressPercentage progressPercentage: CGFloat, indexWasChanged: Bool) {
......
......@@ -92,23 +92,23 @@ struct VLCMediaType {
case .unknown:
preconditionFailure("No")
case .movies:
return IndicatorInfo(title: NSLocalizedString("movies", comment: ""), image: UIImage(named: "TVShowsIcon"))
return IndicatorInfo(title: NSLocalizedString("MOVIES", comment: ""))
case .episodes:
return IndicatorInfo(title: NSLocalizedString("episodes", comment: ""), image: UIImage(named: "episodes"))
return IndicatorInfo(title: NSLocalizedString("EPISODES", comment: ""))
case .artists:
return IndicatorInfo(title: NSLocalizedString("artists", comment: ""), image: UIImage(named: "artists"))
return IndicatorInfo(title: NSLocalizedString("ARTISTS", comment: ""))
case .albums:
return IndicatorInfo(title: NSLocalizedString("albums", comment: ""), image: UIImage(named: "MusicAlbums"))
return IndicatorInfo(title: NSLocalizedString("ALBUMS", comment: ""))
case .tracks:
return IndicatorInfo(title: NSLocalizedString("songs", comment: ""), image: UIImage(named: "songs"))
return IndicatorInfo(title: NSLocalizedString("SONGS", comment: ""))
case .genres:
return IndicatorInfo(title: NSLocalizedString("genres", comment: ""), image: UIImage(named: "genres"))
return IndicatorInfo(title: NSLocalizedString("GENRES", comment: ""))
case .audioPlaylists:
return IndicatorInfo(title: NSLocalizedString("playlists", comment: ""), image: UIImage(named: "playlists"))
return IndicatorInfo(title: NSLocalizedString("AUDIO_PLAYLISTS", comment: ""))
case .videoPlaylists:
return IndicatorInfo(title: NSLocalizedString("playlists", comment: ""), image: UIImage(named: "playlists"))
return IndicatorInfo(title: NSLocalizedString("VIDEO_PLAYLISTS", comment: ""))
case .allVideos:
return IndicatorInfo(title: NSLocalizedString("videos", comment: ""), image: UIImage(named: "videos"))
return IndicatorInfo(title: NSLocalizedString("VIDEOS", comment: ""))
}
}
......
......@@ -53,7 +53,7 @@
41EB91DD1F7BFF8500821AA5 /* VLCMetadata.m in Sources */ = {isa = PBXBuildFile; fileRef = 41EB91DC1F7BFF8400821AA5 /* VLCMetadata.m */; };
41EB91DE1F7BFF8500821AA5 /* VLCMetadata.m in Sources */ = {isa = PBXBuildFile; fileRef = 41EB91DC1F7BFF8400821AA5 /* VLCMetadata.m */; };
41EB94B4209B46E9002F4C30 /* ButtonCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 41EB94B3209B46E9002F4C30 /* ButtonCell.xib */; };
41EB94B6209B4869002F4C30 /* IconLabelCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 41EB94B5209B4869002F4C30 /* IconLabelCell.xib */; };
41EB94B6209B4869002F4C30 /* LabelCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 41EB94B5209B4869002F4C30 /* LabelCell.xib */; };
41F5C0781F41ED55005EB9CB /* VLCLibrarySearchDisplayDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 41F5C0771F41ED55005EB9CB /* VLCLibrarySearchDisplayDataSource.m */; };
41F9BC7C1F4F20E400268461 /* VLCTrackSelectorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 41F9BC7B1F4F20E400268461 /* VLCTrackSelectorView.m */; };
41FCD2F820B565B600660AAB /* VLCAlertViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41FCD2F720B565B500660AAB /* VLCAlertViewController.swift */; };
......@@ -584,7 +584,7 @@
41EB91DB1F7BFF8400821AA5 /* VLCMetadata.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCMetadata.h; sourceTree = "<group>"; };
41EB91DC1F7BFF8400821AA5 /* VLCMetadata.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCMetadata.m; sourceTree = "<group>"; };
41EB94B3209B46E9002F4C30 /* ButtonCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ButtonCell.xib; sourceTree = "<group>"; };
41EB94B5209B4869002F4C30 /* IconLabelCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = IconLabelCell.xib; sourceTree = "<group>"; };
41EB94B5209B4869002F4C30 /* LabelCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LabelCell.xib; sourceTree = "<group>"; };
41F5C0761F41ED55005EB9CB /* VLCLibrarySearchDisplayDataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = VLCLibrarySearchDisplayDataSource.h; path = Sources/VLCLibrarySearchDisplayDataSource.h; sourceTree = SOURCE_ROOT; };
41F5C0771F41ED55005EB9CB /* VLCLibrarySearchDisplayDataSource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = VLCLibrarySearchDisplayDataSource.m; path = Sources/VLCLibrarySearchDisplayDataSource.m; sourceTree = SOURCE_ROOT; };
41F9BC7A1F4F20E400268461 /* VLCTrackSelectorView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = VLCTrackSelectorView.h; path = Sources/VLCTrackSelectorView.h; sourceTree = SOURCE_ROOT; };
......@@ -1552,7 +1552,7 @@
4170152B209A1D3600802E44 /* MediaSubcategoryViewController.swift */,
41701545209B36E800802E44 /* BaseButtonBarPagerTabStripViewController.swift */,
41EB94B3209B46E9002F4C30 /* ButtonCell.xib */,
41EB94B5209B4869002F4C30 /* IconLabelCell.xib */,
41EB94B5209B4869002F4C30 /* LabelCell.xib */,
);
name = "Everything Playlist";
sourceTree = "<group>";
......@@ -2778,7 +2778,7 @@
7D32B384185E293D006CA474 /* Raleway.woff in Resources */,
7D9870691A3E03D5009CF27D /* papasscode_marker@2x.png in Resources */,
7D5DD5C717590ABF001421E3 /* About Contents.html in Resources */,
41EB94B6209B4869002F4C30 /* IconLabelCell.xib in Resources */,
41EB94B6209B4869002F4C30 /* LabelCell.xib in Resources */,
7DBBF19B183AB4300009A339 /* VLCCloudStorageTableViewCell~iphone.xib in Resources */,
7D92897B1877467E009108FD /* VLCFirstStepsFourthPageViewController~iphone.xib in Resources */,
7D1516461868D7E0004B18F3 /* VLCFirstStepsSixthPageViewController~iphone.xib in Resources */,
......
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