Commit 798ba7cf authored by Felix Paul Kühne's avatar Felix Paul Kühne

Recreate grid view cell based upon a nib file (refs #8580 and #8590)

this solves some drawing issues, is a lot nicer to look at and edit and adds support for the linear progress indicator

http://cl.ly/image/2E1T1R3U1x2f
parent d928420a
......@@ -18,7 +18,7 @@
7D6B07C31716C9B8003280C4 /* NSIndexSet+AQIndexesOutsideSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D6B07B71716C9B8003280C4 /* NSIndexSet+AQIndexesOutsideSet.m */; };
7D6B07C41716C9B8003280C4 /* NSIndexSet+AQIsSetContiguous.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D6B07B91716C9B8003280C4 /* NSIndexSet+AQIsSetContiguous.m */; };
7D6B07C51716C9B8003280C4 /* UIColor+AQGridView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D6B07BB1716C9B8003280C4 /* UIColor+AQGridView.m */; };
7D6B07F71716D45C003280C4 /* VLCPlaylistGridViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D6B07F61716D45B003280C4 /* VLCPlaylistGridViewCell.m */; };
7D6B07F71716D45C003280C4 /* VLCPlaylistGridView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D6B07F61716D45B003280C4 /* VLCPlaylistGridView.m */; };
7D94FCDF16DE7D1000F2623B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D94FCDE16DE7D1000F2623B /* UIKit.framework */; };
7D94FCE116DE7D1000F2623B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D94FCE016DE7D1000F2623B /* Foundation.framework */; };
7D94FCE316DE7D1000F2623B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D94FCE216DE7D1000F2623B /* CoreGraphics.framework */; };
......@@ -40,6 +40,7 @@
7DBC3B451711FC6C00DCF688 /* VLCAboutViewController~iphone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7DBC3B431711FC6C00DCF688 /* VLCAboutViewController~iphone.xib */; };
7DBC3B49171204ED00DCF688 /* About Contents.txt in Resources */ = {isa = PBXBuildFile; fileRef = 7DBC3B48171204EC00DCF688 /* About Contents.txt */; };
7DC87AEE17412A1F009DC250 /* VLCLinearProgressIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DC87AED17412A1F009DC250 /* VLCLinearProgressIndicator.m */; };
7DC87AF217413EE3009DC250 /* VLCPlaylistGridView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7DC87AF117413EE3009DC250 /* VLCPlaylistGridView.xib */; };
7DDD0429172D98E5005A7B10 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7DDD0428172D98E5005A7B10 /* CFNetwork.framework */; };
7DE480D1173FEA30003613E0 /* VLCCircularProgressIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DE480D0173FEA30003613E0 /* VLCCircularProgressIndicator.m */; };
A7924696170F0BA90036AAF2 /* libMediaLibraryKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A7924695170F0BA90036AAF2 /* libMediaLibraryKit.a */; };
......@@ -94,8 +95,8 @@
7D6B07B91716C9B8003280C4 /* NSIndexSet+AQIsSetContiguous.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSIndexSet+AQIsSetContiguous.m"; path = "ImportedSources/AQGridView/Classes/NSIndexSet+AQIsSetContiguous.m"; sourceTree = SOURCE_ROOT; };
7D6B07BA1716C9B8003280C4 /* UIColor+AQGridView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIColor+AQGridView.h"; path = "ImportedSources/AQGridView/Classes/UIColor+AQGridView.h"; sourceTree = SOURCE_ROOT; };
7D6B07BB1716C9B8003280C4 /* UIColor+AQGridView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIColor+AQGridView.m"; path = "ImportedSources/AQGridView/Classes/UIColor+AQGridView.m"; sourceTree = SOURCE_ROOT; };
7D6B07F51716D45B003280C4 /* VLCPlaylistGridViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCPlaylistGridViewCell.h; sourceTree = "<group>"; };
7D6B07F61716D45B003280C4 /* VLCPlaylistGridViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCPlaylistGridViewCell.m; sourceTree = "<group>"; };
7D6B07F51716D45B003280C4 /* VLCPlaylistGridView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCPlaylistGridView.h; sourceTree = "<group>"; };
7D6B07F61716D45B003280C4 /* VLCPlaylistGridView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCPlaylistGridView.m; sourceTree = "<group>"; };
7D94FCDB16DE7D1000F2623B /* AspenProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AspenProject.app; sourceTree = BUILT_PRODUCTS_DIR; };
7D94FCDE16DE7D1000F2623B /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
7D94FCE016DE7D1000F2623B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
......@@ -129,6 +130,7 @@
7DC87AED17412A1F009DC250 /* VLCLinearProgressIndicator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCLinearProgressIndicator.m; sourceTree = "<group>"; };
7DC87AEF17413634009DC250 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; };
7DC87AF017413A17009DC250 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
7DC87AF117413EE3009DC250 /* VLCPlaylistGridView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VLCPlaylistGridView.xib; sourceTree = "<group>"; };
7DDD0428172D98E5005A7B10 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
7DE480CF173FEA30003613E0 /* VLCCircularProgressIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCCircularProgressIndicator.h; sourceTree = "<group>"; };
7DE480D0173FEA30003613E0 /* VLCCircularProgressIndicator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCCircularProgressIndicator.m; sourceTree = "<group>"; };
......@@ -279,8 +281,8 @@
7D94FCFA16DE7D1100F2623B /* VLCMovieViewController.m */,
7DA62099170A0CE500643D11 /* VLCPlaylistTableViewCell.h */,
7DA6209A170A0CE500643D11 /* VLCPlaylistTableViewCell.m */,
7D6B07F51716D45B003280C4 /* VLCPlaylistGridViewCell.h */,
7D6B07F61716D45B003280C4 /* VLCPlaylistGridViewCell.m */,
7D6B07F51716D45B003280C4 /* VLCPlaylistGridView.h */,
7D6B07F61716D45B003280C4 /* VLCPlaylistGridView.m */,
A7DA16CF171083DF00D6FED9 /* VLCExternalDisplayController.h */,
A7DA16D0171083DF00D6FED9 /* VLCExternalDisplayController.m */,
7DE480CF173FEA30003613E0 /* VLCCircularProgressIndicator.h */,
......@@ -313,6 +315,7 @@
A79246BD170F114E0036AAF2 /* VLCMovieViewController~iphone.xib */,
A79246BE170F114E0036AAF2 /* VLCPlaylistTableViewCell.xib */,
A79246C0170F114E0036AAF2 /* VLCPlaylistViewController~iphone.xib */,
7DC87AF117413EE3009DC250 /* VLCPlaylistGridView.xib */,
7D33D41517182615008AF0E0 /* VLCMovieViewController~ipad.xib */,
A79246BC170F114E0036AAF2 /* VLCPlaylistViewController~ipad.xib */,
);
......@@ -448,6 +451,7 @@
7D9529531732EFCA006F5B40 /* VLCAboutViewController~ipad.xib in Resources */,
7DA8B0FB173318E80029698C /* SourceCodePro-Regular.ttf in Resources */,
7DA8B0FC173318E80029698C /* SourceSansPro-Regular.ttf in Resources */,
7DC87AF217413EE3009DC250 /* VLCPlaylistGridView.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -476,7 +480,7 @@
7D6B07C31716C9B8003280C4 /* NSIndexSet+AQIndexesOutsideSet.m in Sources */,
7D6B07C41716C9B8003280C4 /* NSIndexSet+AQIsSetContiguous.m in Sources */,
7D6B07C51716C9B8003280C4 /* UIColor+AQGridView.m in Sources */,
7D6B07F71716D45C003280C4 /* VLCPlaylistGridViewCell.m in Sources */,
7D6B07F71716D45C003280C4 /* VLCPlaylistGridView.m in Sources */,
7DE480D1173FEA30003613E0 /* VLCCircularProgressIndicator.m in Sources */,
7DC87AEE17412A1F009DC250 /* VLCLinearProgressIndicator.m in Sources */,
);
......
......@@ -6,19 +6,17 @@
// Copyright (c) 2013 VideoLAN. All rights reserved.
//
#import "AQGridViewCell.h"
#import "VLCLinearProgressIndicator.h"
@interface VLCPlaylistGridViewCell : AQGridViewCell
{
UILabel *_titleLabel;
UILabel *_subtitleLabel;
UIImageView *_thumbnailView;
}
@interface VLCPlaylistGridView : UIView
@property (nonatomic, strong) IBOutlet UILabel *titleLabel;
@property (nonatomic, strong) IBOutlet UILabel *subtitleLabel;
@property (nonatomic, strong) IBOutlet UIImageView *thumbnailView;
@property (nonatomic, strong) IBOutlet VLCLinearProgressIndicator *progressView;
@property (nonatomic, copy) UIImage *thumbnail;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *subtitle;
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier;
@end
//
// VLCGridViewCell.m
// AspenProject
//
// Created by Felix Paul Kühne on 11.04.13.
// Copyright (c) 2013 VideoLAN. All rights reserved.
//
#import "VLCPlaylistGridView.h"
@interface VLCPlaylistGridView (Hack)
@property (nonatomic, retain) NSString * reuseIdentifier;
@end
@implementation VLCPlaylistGridView
- (UIImage *)thumbnail
{
return _thumbnailView.image;
}
- (void)setThumbnail:(UIImage *)newThumb
{
self.thumbnailView.image = newThumb;
[self setNeedsDisplay];
}
- (NSString *)title
{
return _titleLabel.text;
}
- (void)setTitle:(NSString *)newTitle
{
self.titleLabel.text = newTitle;
[self setNeedsDisplay];
}
- (NSString *)subtitle
{
return @"";
}
- (void)setSubtitle:(NSString *)newSubtitle
{
self.subtitleLabel.text = newSubtitle;
[self setNeedsDisplay];
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1296</int>
<string key="IBDocument.SystemVersion">12E40</string>
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
<string key="IBDocument.AppKitVersion">1187.39</string>
<string key="IBDocument.HIToolboxVersion">626.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">2083</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
<string>IBUIImageView</string>
<string>IBUILabel</string>
<string>IBUIView</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBProxyObject" id="975951072">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBUIView" id="93090196">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIView" id="470328177">
<reference key="NSNextResponder" ref="93090196"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{52, 8}, {281, 160}}</string>
<reference key="NSSuperview" ref="93090196"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="978623485"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBUIImageView" id="978623485">
<reference key="NSNextResponder" ref="93090196"/>
<int key="NSvFlags">274</int>
<string key="NSFrame">{{54, 10}, {277, 156}}</string>
<reference key="NSSuperview" ref="93090196"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="863064291"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
<object class="IBUILabel" id="276503826">
<reference key="NSNextResponder" ref="93090196"/>
<int key="NSvFlags">264</int>
<string key="NSFrame">{{20, 182}, {344, 21}}</string>
<reference key="NSSuperview" ref="93090196"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="610797449"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">Label</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace" id="585223183">
<int key="NSID">2</int>
</object>
</object>
<nil key="IBUIHighlightedColor"/>
<object class="NSColor" key="IBUIShadowColor" id="398609642">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
<string key="IBUIColorCocoaTouchKeyPath">darkTextColor</string>
</object>
<int key="IBUIBaselineAdjustment">0</int>
<int key="IBUITextAlignment">1</int>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">2</int>
<double key="pointSize">20</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">20</double>
<int key="NSfFlags">16</int>
</object>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUILabel" id="610797449">
<reference key="NSNextResponder" ref="93090196"/>
<int key="NSvFlags">264</int>
<string key="NSFrame">{{20, 203}, {344, 28}}</string>
<reference key="NSSuperview" ref="93090196"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<string key="IBUIText">Subtitle</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<reference key="NSCustomColorSpace" ref="585223183"/>
</object>
<nil key="IBUIHighlightedColor"/>
<reference key="IBUIShadowColor" ref="398609642"/>
<int key="IBUIBaselineAdjustment">0</int>
<int key="IBUITextAlignment">1</int>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">1</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUIView" id="863064291">
<reference key="NSNextResponder" ref="93090196"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{54, 154}, {277, 12}}</string>
<reference key="NSSuperview" ref="93090196"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="276503826"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
</array>
<string key="NSFrameSize">{384, 243}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="470328177"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
<bool key="IBUIAutoresizesSubviews">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">4</int>
<int key="IBUITag">1</int>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">subtitleLabel</string>
<reference key="source" ref="93090196"/>
<reference key="destination" ref="610797449"/>
</object>
<int key="connectionID">14</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">thumbnailView</string>
<reference key="source" ref="93090196"/>
<reference key="destination" ref="978623485"/>
</object>
<int key="connectionID">15</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">titleLabel</string>
<reference key="source" ref="93090196"/>
<reference key="destination" ref="276503826"/>
</object>
<int key="connectionID">16</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">progressView</string>
<reference key="source" ref="93090196"/>
<reference key="destination" ref="863064291"/>
</object>
<int key="connectionID">18</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="975951072"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="93090196"/>
<array class="NSMutableArray" key="children">
<reference ref="978623485"/>
<reference ref="276503826"/>
<reference ref="610797449"/>
<reference ref="863064291"/>
<reference ref="470328177"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">9</int>
<reference key="object" ref="276503826"/>
<reference key="parent" ref="93090196"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="610797449"/>
<reference key="parent" ref="93090196"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">13</int>
<reference key="object" ref="978623485"/>
<reference key="parent" ref="93090196"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">17</int>
<reference key="object" ref="863064291"/>
<reference key="parent" ref="93090196"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="470328177"/>
<reference key="parent" ref="93090196"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="12.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="13.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="17.CustomClassName">VLCLinearProgressIndicator</string>
<string key="17.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="19.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="3.CustomClassName">VLCPlaylistGridView</string>
<string key="3.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="9.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">19</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">VLCLinearProgressIndicator</string>
<string key="superclassName">UIProgressView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/VLCLinearProgressIndicator.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">VLCPlaylistGridView</string>
<string key="superclassName">UIView</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="progressView">VLCLinearProgressIndicator</string>
<string key="subtitleLabel">UILabel</string>
<string key="thumbnailView">UIImageView</string>
<string key="titleLabel">UILabel</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="progressView">
<string key="name">progressView</string>
<string key="candidateClassName">VLCLinearProgressIndicator</string>
</object>
<object class="IBToOneOutletInfo" key="subtitleLabel">
<string key="name">subtitleLabel</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo" key="thumbnailView">
<string key="name">thumbnailView</string>
<string key="candidateClassName">UIImageView</string>
</object>
<object class="IBToOneOutletInfo" key="titleLabel">
<string key="name">titleLabel</string>
<string key="candidateClassName">UILabel</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/VLCPlaylistGridView.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
<real value="1296" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">2083</string>
</data>
</archive>
//
// VLCGridViewCell.m
// AspenProject
//
// Created by Felix Paul Kühne on 11.04.13.
// Copyright (c) 2013 VideoLAN. All rights reserved.
//
#import "VLCPlaylistGridViewCell.h"
@interface VLCPlaylistGridViewCell (Hack)
@property (nonatomic, retain) NSString * reuseIdentifier;
@end
@implementation VLCPlaylistGridViewCell
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier];
if (self == nil)
return nil;
_thumbnailView = [[UIImageView alloc] initWithFrame:CGRectZero];
_titleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
_titleLabel.highlightedTextColor = [UIColor whiteColor];
_titleLabel.textColor = [UIColor colorWithWhite:.95 alpha:1.];
_titleLabel.font = [UIFont boldSystemFontOfSize:12.];
_titleLabel.adjustsFontSizeToFitWidth = YES;
_titleLabel.minimumFontSize = 10.;
_subtitleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
_subtitleLabel.highlightedTextColor = [UIColor whiteColor];
_subtitleLabel.textColor = [UIColor colorWithWhite:.95 alpha:1.];
_subtitleLabel.font = [UIFont systemFontOfSize:9.];
_subtitleLabel.adjustsFontSizeToFitWidth = YES;
_subtitleLabel.minimumFontSize = 8.;
self.backgroundColor = [UIColor colorWithWhite:0. alpha:1.];
self.contentView.backgroundColor = self.backgroundColor;
_thumbnailView.backgroundColor = self.backgroundColor;
_titleLabel.backgroundColor = self.backgroundColor;
_subtitleLabel.backgroundColor = self.backgroundColor;
[self.contentView addSubview:_thumbnailView];
[self.contentView addSubview:_titleLabel];
[self.contentView addSubview:_subtitleLabel];
return self;
}
- (UIImage *)thumbnail
{
return _thumbnailView.image;
}
- (void)setThumbnail:(UIImage *)newThumb
{
_thumbnailView.image = newThumb;
[self setNeedsLayout];
}
- (NSString *)title
{
return _titleLabel.text;
}
- (void)setTitle:(NSString *)newTitle
{
_titleLabel.text = newTitle;
[self setNeedsLayout];
}
- (NSString *)subtitle
{
return @"";
}
- (void)setSubtitle:(NSString *)newSubtitle
{
_subtitleLabel.text = newSubtitle;
[self setNeedsLayout];
}
- (void)layoutSubviews
{
[super layoutSubviews];
CGSize imageSize = _thumbnailView.image.size;
CGRect bounds = CGRectInset(self.contentView.bounds, 10., 10.);
[_titleLabel sizeToFit];
CGRect frame = _titleLabel.frame;
frame.size.width = MIN(frame.size.width, bounds.size.width);
frame.origin.y = CGRectGetMaxY(bounds) - frame.size.height - 15.;
frame.origin.x = floorf((bounds.size.width - frame.size.width) * 0.5);
_titleLabel.frame = frame;
[_subtitleLabel sizeToFit];
frame = _subtitleLabel.frame;
frame.size.width = MIN(frame.size.width, bounds.size.width);
frame.origin.y = CGRectGetMaxY(bounds) - frame.size.height;