Commit 0aaa3527 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Dropbox: improve folder item rendering

parent ead3a5ac
......@@ -11,6 +11,7 @@
@interface VLCDropboxTableViewCell : UITableViewCell
@property (nonatomic, strong) IBOutlet UILabel *titleLabel;
@property (nonatomic, strong) IBOutlet UILabel *folderTitleLabel;
@property (nonatomic, strong) IBOutlet UILabel *subtitleLabel;
@property (nonatomic, strong) IBOutlet UIImageView *thumbnailView;
......
......@@ -44,8 +44,15 @@
- (void)_updatedDisplayedInformation
{
self.titleLabel.text = self.fileMetadata.filename;
self.subtitleLabel.text = (self.fileMetadata.totalBytes > 0) ? self.fileMetadata.humanReadableSize : @"";
if (self.fileMetadata.isDirectory) {
self.folderTitleLabel.text = self.fileMetadata.filename;
self.titleLabel.text = @"";
self.subtitleLabel.text = @"";
} else {
self.titleLabel.text = self.fileMetadata.filename;
self.subtitleLabel.text = (self.fileMetadata.totalBytes > 0) ? self.fileMetadata.humanReadableSize : @"";
self.folderTitleLabel.text = @"";
}
self.thumbnailView.image = [UIImage imageNamed:self.fileMetadata.icon];
if (!self.thumbnailView.image)
......
......@@ -57,15 +57,15 @@
<string key="NSFrame">{{83, 21}, {232, 21}}</string>
<reference key="NSSuperview" ref="162418872"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<reference key="NSNextKeyView" ref="1019407525"/>
<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">IBCocoaTouchFramework</string>
<string key="IBUIText">Title 1</string>
<object class="NSColor" key="IBUITextColor">
<string key="IBUIText">File Title</string>
<object class="NSColor" key="IBUITextColor" id="176165725">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
......@@ -74,21 +74,42 @@
<bytes key="NSWhite">MQA</bytes>
</object>
<int key="IBUILineBreakMode">0</int>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<object class="IBUIFontDescription" key="IBUIFontDescription" id="123705061">
<int key="type">1</int>
<double key="pointSize">17</double>
</object>
<object class="NSFont" key="IBUIFont">
<object class="NSFont" key="IBUIFont" id="458645332">
<string key="NSName">Helvetica</string>
<double key="NSSize">17</double>
<int key="NSfFlags">16</int>
</object>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUILabel" id="1019407525">
<reference key="NSNextResponder" ref="162418872"/>
<int key="NSvFlags">290</int>
<string key="NSFrame">{{83, 29}, {232, 21}}</string>
<reference key="NSSuperview" ref="162418872"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="625431089"/>
<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">IBCocoaTouchFramework</string>
<string key="IBUIText">Folder Title</string>
<reference key="IBUITextColor" ref="176165725"/>
<reference key="IBUIHighlightedColor" ref="654385816"/>
<int key="IBUILineBreakMode">0</int>
<reference key="IBUIFontDescription" ref="123705061"/>
<reference key="IBUIFont" ref="458645332"/>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUILabel" id="625431089">
<reference key="NSNextResponder" ref="162418872"/>
<int key="NSvFlags">290</int>
<string key="NSFrame">{{83, 43}, {232, 15}}</string>
<string key="NSFrame">{{83, 44}, {232, 15}}</string>
<reference key="NSSuperview" ref="162418872"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
......@@ -174,6 +195,14 @@
</object>
<int key="connectionID">10</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">folderTitleLabel</string>
<reference key="source" ref="962619467"/>
<reference key="destination" ref="1019407525"/>
</object>
<int key="connectionID">24</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
......@@ -201,6 +230,7 @@
<reference ref="784253519"/>
<reference ref="207506414"/>
<reference ref="625431089"/>
<reference ref="1019407525"/>
</array>
<reference key="parent" ref="0"/>
</object>
......@@ -219,12 +249,18 @@
<reference key="object" ref="625431089"/>
<reference key="parent" ref="962619467"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">23</int>
<reference key="object" ref="1019407525"/>
<reference key="parent" ref="962619467"/>
</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="23.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="3.CustomClassName">VLCDropboxTableViewCell</string>
<string key="3.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
......@@ -235,7 +271,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">22</int>
<int key="maxID">24</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
......@@ -243,11 +279,16 @@
<string key="className">VLCDropboxTableViewCell</string>
<string key="superclassName">UITableViewCell</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="folderTitleLabel">UILabel</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="folderTitleLabel">
<string key="name">folderTitleLabel</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo" key="subtitleLabel">
<string key="name">subtitleLabel</string>
<string key="candidateClassName">UILabel</string>
......
......@@ -57,15 +57,15 @@
<string key="NSFrame">{{45, 8}, {270, 18}}</string>
<reference key="NSSuperview" ref="162418872"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<reference key="NSNextKeyView" ref="816829197"/>
<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">IBCocoaTouchFramework</string>
<string key="IBUIText">Title 1</string>
<object class="NSColor" key="IBUITextColor">
<string key="IBUIText">File Title</string>
<object class="NSColor" key="IBUITextColor" id="77889393">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
......@@ -74,17 +74,38 @@
<bytes key="NSWhite">MQA</bytes>
</object>
<int key="IBUILineBreakMode">0</int>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<object class="IBUIFontDescription" key="IBUIFontDescription" id="868609050">
<int key="type">1</int>
<double key="pointSize">14</double>
</object>
<object class="NSFont" key="IBUIFont">
<object class="NSFont" key="IBUIFont" id="7653884">
<string key="NSName">Helvetica</string>
<double key="NSSize">14</double>
<int key="NSfFlags">16</int>
</object>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUILabel" id="816829197">
<reference key="NSNextResponder" ref="162418872"/>
<int key="NSvFlags">290</int>
<string key="NSFrame">{{45, 15}, {270, 18}}</string>
<reference key="NSSuperview" ref="162418872"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="625431089"/>
<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">IBCocoaTouchFramework</string>
<string key="IBUIText">Folder Title</string>
<reference key="IBUITextColor" ref="77889393"/>
<reference key="IBUIHighlightedColor" ref="654385816"/>
<int key="IBUILineBreakMode">0</int>
<reference key="IBUIFontDescription" ref="868609050"/>
<reference key="IBUIFont" ref="7653884"/>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUILabel" id="625431089">
<reference key="NSNextResponder" ref="162418872"/>
<int key="NSvFlags">266</int>
......@@ -174,6 +195,14 @@
</object>
<int key="connectionID">10</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">folderTitleLabel</string>
<reference key="source" ref="962619467"/>
<reference key="destination" ref="816829197"/>
</object>
<int key="connectionID">24</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
......@@ -201,6 +230,7 @@
<reference ref="207506414"/>
<reference ref="784253519"/>
<reference ref="625431089"/>
<reference ref="816829197"/>
</array>
<reference key="parent" ref="0"/>
</object>
......@@ -219,12 +249,18 @@
<reference key="object" ref="625431089"/>
<reference key="parent" ref="962619467"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">23</int>
<reference key="object" ref="816829197"/>
<reference key="parent" ref="962619467"/>
</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="23.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="3.CustomClassName">VLCDropboxTableViewCell</string>
<string key="3.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
......@@ -235,7 +271,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">22</int>
<int key="maxID">24</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
......@@ -243,11 +279,16 @@
<string key="className">VLCDropboxTableViewCell</string>
<string key="superclassName">UITableViewCell</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="folderTitleLabel">UILabel</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="folderTitleLabel">
<string key="name">folderTitleLabel</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo" key="subtitleLabel">
<string key="name">subtitleLabel</string>
<string key="candidateClassName">UILabel</string>
......
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