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";
......@@ -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