Skip to content

Commit

Permalink
VLCCloudStorageTableViewCell: Adjust Constraints for favourite button
Browse files Browse the repository at this point in the history
Clouds: Cosmetic Changes
  • Loading branch information
EshanSingh-ES authored and fkuehne committed Sep 19, 2024
1 parent f443cc4 commit 59ae02d
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 64 deletions.
2 changes: 1 addition & 1 deletion Resources/iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
<string>GoogleAuth</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.googleusercontent.apps.1014939615316-3pbavebokl0smjlr0r03uqqjha0ie3l7</string>
<string>com.googleusercontent.apps.CLIENT</string>
</array>
</dict>
</array>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* Copyright (c) 2013-2019 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne # videolan.org>
* Carola Nitz <nitz.carola # googlemail.com>
*
* Authors: Felix Paul Kühne <fkuehne # videolan.org>
* Carola Nitz <nitz.carola # googlemail.com>
* Eshan Singh <eeeshan789 # gmail.com>
* Refer to the COPYING file of the official project for license.
*****************************************************************************/

Expand Down
14 changes: 4 additions & 10 deletions Sources/Cloud/Content List/Cells/VLCCloudStorageTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* Copyright (c) 2013-2019 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Carola Nitz <nitz.carola # googlemail.com>
* Felix Paul Kühne <fkuehne # videolan.org>
*
* Authors: Carola Nitz <nitz.carola # googlemail.com>
* Felix Paul Kühne <fkuehne # videolan.org>
* Eshan Singh <eeeshan789 # gmail.com>
* Refer to the COPYING file of the official project for license.
*****************************************************************************/

Expand Down Expand Up @@ -168,7 +168,6 @@ - (void)_updatedDisplayedInformation
NSURL *url = [NSURL URLWithString:urlString];
self.isFavourite = [service isFavoriteURL:url];
self.thumbnailView.image = [UIImage imageNamed:@"folder"];

} else if ([_dropboxFile isKindOfClass:[DBFILESFileMetadata class]]) {
DBFILESFileMetadata *file = (DBFILESFileMetadata *)_dropboxFile;
self.titleLabel.text = file.name;
Expand Down Expand Up @@ -229,20 +228,15 @@ - (void)_updatedDisplayedInformation
self.folderTitleLabel.text = self.boxFile.name;
self.titleLabel.hidden = self.subtitleLabel.hidden = YES;
self.folderTitleLabel.hidden = NO;
<<<<<<< HEAD
self.downloadButton.hidden = YES;
self.downloadButton.hidden = NO;
self.isFavourable = YES;

VLCFavoriteService *service = [VLCAppCoordinator sharedInstance].favoriteService;

NSString *selectedFilePath = _boxFile.modelID;
NSString *urlString = [NSString stringWithFormat:@"file://Box/%@", selectedFilePath];
NSURL *url = [NSURL URLWithString:urlString];

self.isFavourite = [service isFavoriteURL:url];
=======
self.downloadButton.hidden = NO;
>>>>>>> 4af7124fe (Cloud Services: Support for downloadingFolders)
} else {
NSString *title = self.boxFile.name;
self.titleLabel.text = title;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TYG-PY-W9b">
<rect key="frame" x="261" y="8" width="48" height="38"/>
<rect key="frame" x="227" y="8" width="44" height="48"/>
<constraints>
<constraint firstAttribute="width" constant="48" id="7MV-yu-USF"/>
<constraint firstAttribute="height" constant="38" id="9Qh-nG-9qa"/>
<constraint firstAttribute="width" constant="44" id="7MV-yu-USF"/>
<constraint firstAttribute="height" constant="48" id="9Qh-nG-9qa"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
Expand All @@ -84,13 +84,12 @@
<constraint firstItem="23" firstAttribute="leading" secondItem="4" secondAttribute="trailing" constant="8" id="C3b-pA-uOA"/>
<constraint firstItem="23" firstAttribute="trailing" secondItem="Tip-yB-5Gh" secondAttribute="trailing" constant="-8" id="Fqx-O2-LB5"/>
<constraint firstItem="7" firstAttribute="bottom" secondItem="4" secondAttribute="bottom" constant="-2" id="KGc-0W-IIt"/>
<constraint firstItem="TYG-PY-W9b" firstAttribute="leading" secondItem="6" secondAttribute="trailing" constant="6" id="Xnl-Mi-4el"/>
<constraint firstAttribute="bottom" secondItem="4" secondAttribute="bottom" constant="8" id="acL-xO-d30"/>
<constraint firstItem="TYG-PY-W9b" firstAttribute="top" secondItem="4" secondAttribute="top" id="bOM-e0-C6q"/>
<constraint firstItem="7" firstAttribute="leading" secondItem="4" secondAttribute="trailing" constant="8" id="c7M-0S-tyB"/>
<constraint firstItem="4" firstAttribute="centerY" secondItem="Tip-yB-5Gh" secondAttribute="centerY" id="fyJ-RB-ru7"/>
<constraint firstItem="6" firstAttribute="trailing" secondItem="661-nY-3Tr" secondAttribute="leading" constant="-8" id="hp2-dT-ocj"/>
<constraint firstAttribute="trailing" secondItem="TYG-PY-W9b" secondAttribute="trailing" constant="11" id="lMx-hh-aQL"/>
<constraint firstAttribute="trailing" secondItem="TYG-PY-W9b" secondAttribute="trailing" constant="49" id="lMx-hh-aQL"/>
<constraint firstItem="4" firstAttribute="top" secondItem="Tip-yB-5Gh" secondAttribute="top" constant="8" id="mTr-4f-FSJ"/>
<constraint firstItem="6" firstAttribute="leading" secondItem="4" secondAttribute="trailing" constant="8" id="rrY-Y1-Ttv"/>
<constraint firstItem="4" firstAttribute="leading" secondItem="Tip-yB-5Gh" secondAttribute="leading" constant="8" id="scr-nK-URb"/>
Expand All @@ -105,7 +104,7 @@
<outlet property="thumbnailView" destination="4" id="9"/>
<outlet property="titleLabel" destination="6" id="10"/>
</connections>
<point key="canvasLocation" x="137.59999999999999" y="153.82308845577214"/>
<point key="canvasLocation" x="230" y="22"/>
</tableViewCell>
</objects>
<resources>
Expand Down
1 change: 0 additions & 1 deletion Sources/Cloud/Services/Box/VLCBoxController.m
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ - (void)_listOfGoodFilesAndFolders: (BOOL)isDownloadingFolder
if (isDirectory || supportedFile)
[listOfGoodFilesAndFolders addObject:boxFile];
}

}

if (isDownloadingFolder) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Cloud/Services/Dropbox/VLCDropboxController.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- (BOOL)restoreFromSharedCredentials;

- (void)downloadFileToDocumentFolder:(DBFILESMetadata *)file;
-(void)downloadFolderFiles:(DBFILESFolderMetadata *)folder;
- (void)downloadFolderFiles:(DBFILESFolderMetadata *)folder;
- (void)streamFile:(DBFILESMetadata *)file currentNavigationController:(UINavigationController *)navigationController;

- (void)reset;
Expand Down
4 changes: 2 additions & 2 deletions Sources/Cloud/Services/Dropbox/VLCDropboxController.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne # videolan.org>
* Jean-Baptiste Kempf <jb # videolan.org>
* Eshan Singh <[email protected]>
* Jean-Baptiste Kempf <jb # videolan.org>
* Eshan Singh <[email protected]>
* Refer to the COPYING file of the official project for license.
*****************************************************************************/

Expand Down
35 changes: 18 additions & 17 deletions Sources/Cloud/Services/Dropbox/VLCDropboxTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Carola Nitz <nitz.carola # googlemail.com>
* Fabio Ritrovato <sephiroth87 # videolan.org>
* Tamas Timar <ttimar.vlc # gmail.com>
*
* Eshan Singh <eeeshan789 # gmail.com>
* Refer to the COPYING file of the official project for license.
*****************************************************************************/

Expand Down Expand Up @@ -157,30 +157,31 @@ - (void)sessionWasUpdated:(NSNotification *)aNotification

- (void)triggerDownloadForCell:(VLCCloudStorageTableViewCell *)cell
{

if ([_mediaList[[self.tableView indexPathForCell:cell].row] isKindOfClass:[DBFILESFolderMetadata class]]) {
_folder = _mediaList[[self.tableView indexPathForCell:cell].row];
} else {
_selectedFile = _mediaList[[self.tableView indexPathForCell:cell].row];
}

/* selected item is a proper file, ask the user if s/he wants to download it */
NSArray<VLCAlertButton *> *buttonsAction = @[[[VLCAlertButton alloc] initWithTitle: NSLocalizedString(@"BUTTON_CANCEL", nil)
style: UIAlertActionStyleCancel
action: ^(UIAlertAction *action) {
self->_selectedFile = nil;
}],
[[VLCAlertButton alloc] initWithTitle: NSLocalizedString(@"BUTTON_DOWNLOAD", nil)
action: ^(UIAlertAction *action) {
if (!(self->_folder == NULL)) {
[self->_dropboxController downloadFolderFiles:self->_folder];
self->_folder = nil;
} else {
[self->_dropboxController downloadFileToDocumentFolder:self->_selectedFile];
self->_selectedFile = nil;
}
}]
NSArray<VLCAlertButton *> *buttonsAction = @[
[[VLCAlertButton alloc] initWithTitle:NSLocalizedString(@"BUTTON_CANCEL", nil)
style:UIAlertActionStyleCancel
action:^(UIAlertAction *action) {
self->_selectedFile = nil;
}],
[[VLCAlertButton alloc] initWithTitle:NSLocalizedString(@"BUTTON_DOWNLOAD", nil)
action:^(UIAlertAction *action) {
if (self->_folder == NULL) {
[self->_dropboxController downloadFileToDocumentFolder:self->_selectedFile];
self->_selectedFile = nil;
} else {
[self->_dropboxController downloadFolderFiles:self->_folder];
self->_folder = nil;
}
}]
];

[VLCAlertViewController alertViewManagerWithTitle:NSLocalizedString(@"DROPBOX_DOWNLOAD", nil)
errorMessage:[NSString stringWithFormat:NSLocalizedString(@"DROPBOX_DL_LONG", nil), _selectedFile.name, [[UIDevice currentDevice] model]]
viewController:self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* Copyright (c) 2013 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Carola Nitz <nitz.carola # googlemail.com>
* Felix Paul Kühne <fkuehne # videolan.org>
*
* Authors: Carola Nitz <nitz.carola # googlemail.com>
* Felix Paul Kühne <fkuehne # videolan.org>
* Eshan Singh <eeeshan789 # gmail.com>
* Refer to the COPYING file of the official project for license.
*****************************************************************************/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Authors: Carola Nitz <nitz.carola # googlemail.com>
* Felix Paul Kühne <fkuehne # videolan.org>
* Soomin Lee <TheHungryBu # gmail.com>
*
* Eshan Singh <eeeshan789 # gmail.com>
* Refer to the COPYING file of the official project for license.
*****************************************************************************/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* Copyright (c) 2013-2015 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Carola Nitz <nitz.carola # googlemail.com>
* Felix Paul Kühne <fkuehne # videolan.org>
* Soomin Lee <TheHungryBu # gmail.com>
*
* Authors: Carola Nitz <nitz.carola # googlemail.com>
* Felix Paul Kühne <fkuehne # videolan.org>
* Soomin Lee <TheHungryBu # gmail.com>
* Eshan Singh <eeeshan789 # gmail.com>
* Refer to the COPYING file of the official project for license.
*****************************************************************************/

Expand Down Expand Up @@ -140,27 +140,30 @@ - (void)triggerDownloadForCell:(VLCCloudStorageTableViewCell *)cell
_selectedFile = _googleDriveController.currentListFiles[[self.tableView indexPathForCell:cell].row];

/* selected item is a proper file, ask the user if s/he wants to download it */
NSArray<VLCAlertButton *> *buttonsAction = @[[[VLCAlertButton alloc] initWithTitle: NSLocalizedString(@"BUTTON_CANCEL", nil)
style: UIAlertActionStyleCancel
action: ^(UIAlertAction *action) {
self->_selectedFile = nil;
}],
[[VLCAlertButton alloc] initWithTitle: NSLocalizedString(@"BUTTON_DOWNLOAD", nil)
action: ^(UIAlertAction *action) {
if ([self->_selectedFile.mimeType isEqualToString:@"application/vnd.google-apps.folder"]){
NSLog(@"Iden: %@", self->_selectedFile.identifier);
[self->_googleDriveController downloadFileToDocumentFolder:self->_selectedFile: self.currentPath];
} else {
[self->_googleDriveController downloadFileToDocumentFolder:self->_selectedFile: @""];
}
self->_selectedFile = nil;
}]
NSArray<VLCAlertButton *> *buttonsAction = @[
[[VLCAlertButton alloc] initWithTitle:NSLocalizedString(@"BUTTON_CANCEL", nil)
style:UIAlertActionStyleCancel
action:^(UIAlertAction *action) {
self->_selectedFile = nil;
}],
[[VLCAlertButton alloc] initWithTitle:NSLocalizedString(@"BUTTON_DOWNLOAD", nil)
action:^(UIAlertAction *action) {
if ([self->_selectedFile.mimeType isEqualToString:@"application/vnd.google-apps.folder"]) {
NSLog(@"Iden: %@", self->_selectedFile.identifier);
[self->_googleDriveController downloadFileToDocumentFolder:self->_selectedFile :self.currentPath];
} else {
[self->_googleDriveController downloadFileToDocumentFolder:self->_selectedFile :@""];
}
self->_selectedFile = nil;
}]
];

[VLCAlertViewController alertViewManagerWithTitle:NSLocalizedString(@"DROPBOX_DOWNLOAD", nil)
errorMessage:[NSString stringWithFormat:NSLocalizedString(@"DROPBOX_DL_LONG", nil), _selectedFile.name, [[UIDevice currentDevice] model]]
viewController:self
buttonsAction:buttonsAction];
}

#pragma mark - login dialog

- (void)setAuthorizerAndUpdate
Expand Down

0 comments on commit 59ae02d

Please sign in to comment.