Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions iOSClient/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
if isUiTestingEnabled {
deleteAllAccounts()
}
UINavigationBar.appearance().tintColor = NCBrandColor.shared.customer
UIToolbar.appearance().tintColor = NCBrandColor.shared.customer
let utilityFileSystem = NCUtilityFileSystem()
let utility = NCUtility()

Expand Down
2 changes: 1 addition & 1 deletion iOSClient/Main/NCMainTabBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class NCMainTabBar: UITabBar {
// Media
if let item = items?[3] {
item.title = NSLocalizedString("_media_", comment: "")
item.image = UIImage(named: "media")?.image(color: NCBrandColor.shared.brandElement, size: 25)
item.image = UIImage(named: "mediaSelected")?.image(color: NCBrandColor.shared.brandElement, size: 25)
item.selectedImage = item.image
}

Expand Down
5 changes: 3 additions & 2 deletions iOSClient/Main/NCPickerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ class customPhotoPickerViewController: TLPhotosPickerViewController {
override func makeUI() {
super.makeUI()

self.customNavItem.leftBarButtonItem?.tintColor = .systemBlue
self.customNavItem.rightBarButtonItem?.tintColor = .systemBlue
self.customNavItem.leftBarButtonItem?.tintColor = NCBrandColor.shared.customer
self.customNavItem.rightBarButtonItem?.tintColor = NCBrandColor.shared.customer
self.albumPopView.tintColor = NCBrandColor.shared.customer
}
}

Expand Down
35 changes: 12 additions & 23 deletions iOSClient/Media/NCMedia+Command.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,35 @@ extension NCMedia {

func setSelectcancelButton() {
selectOcId.removeAll()
tabBarSelect.selectCount = selectOcId.count
tabBarSelect?.selectCount = selectOcId.count
if let visibleCells = self.collectionView?.indexPathsForVisibleItems.compactMap({ self.collectionView?.cellForItem(at: $0) }) {
for case let cell as NCGridMediaCell in visibleCells {
cell.selected(false)
}
}
if isEditMode {
activityIndicatorTrailing.constant = 150
selectOrCancelButton.setTitle( NSLocalizedString("_cancel_", comment: ""), for: .normal)
selectOrCancelButtonTrailing.constant = 10
selectOrCancelButton.isHidden = false
menuButton.isHidden = true
tabBarSelect.show()
tabBarSelect?.show()
} else {
activityIndicatorTrailing.constant = 150
selectOrCancelButton.setTitle( NSLocalizedString("_select_", comment: ""), for: .normal)
selectOrCancelButtonTrailing.constant = 50
selectOrCancelButton.isHidden = false
menuButton.isHidden = false
tabBarSelect.hide()
tabBarSelect?.hide()
}
}

func setTitleDate(_ offset: CGFloat = 10) {
titleDate?.text = ""
mediaCommandView?.title.text = ""
if let metadata = metadatas?.first {
let contentOffsetY = collectionView.contentOffset.y
let top = insetsTop + view.safeAreaInsets.top + offset
if insetsTop + view.safeAreaInsets.top + contentOffsetY < 10 {
titleDate?.text = utility.getTitleFromDate(metadata.date as Date)
mediaCommandView?.title.text = utility.getTitleFromDate(metadata.date as Date)
return
}
let point = CGPoint(x: offset, y: top + contentOffsetY)
if let indexPath = collectionView.indexPathForItem(at: point) {
let cell = self.collectionView(collectionView, cellForItemAt: indexPath) as? NCGridMediaCell
if let date = cell?.date {
self.titleDate?.text = utility.getTitleFromDate(date)
if let date = cell?.fileDate {
mediaCommandView?.title.text = utility.getTitleFromDate(date)
}
} else {
if offset < 20 {
Expand All @@ -65,16 +57,12 @@ extension NCMedia {

func setColor() {
if isTop {
titleDate?.textColor = .label
mediaCommandView?.title?.textColor = .label
activityIndicator.color = .label
selectOrCancelButton.setTitleColor(.label, for: .normal)
menuButton.setImage(UIImage(systemName: "ellipsis")?.withTintColor(.label, renderingMode: .alwaysOriginal), for: .normal)
gradientView.isHidden = true
} else {
titleDate?.textColor = .white
mediaCommandView?.title?.textColor = .white
activityIndicator.color = .white
selectOrCancelButton.setTitleColor(.white, for: .normal)
menuButton.setImage(UIImage(systemName: "ellipsis")?.withTintColor(.white, renderingMode: .alwaysOriginal), for: .normal)
gradientView.isHidden = false
}
}
Expand All @@ -85,7 +73,8 @@ extension NCMedia {
let layoutTitle = (layout == NCGlobal.shared.mediaLayoutRatio) ? NSLocalizedString("_media_square_", comment: "") : NSLocalizedString("_media_ratio_", comment: "")
let layoutImage = (layout == NCGlobal.shared.mediaLayoutRatio) ? UIImage(systemName: "square.grid.3x3") : UIImage(systemName: "rectangle.grid.3x2")

if UIDevice.current.userInterfaceIdiom == .phone, UIDevice.current.orientation.isLandscape {
if UIDevice.current.userInterfaceIdiom == .phone,
(UIDevice.current.orientation == .landscapeLeft || UIDevice.current.orientation == .landscapeRight) {
columnCount += 2
}

Expand Down Expand Up @@ -176,7 +165,7 @@ extension NCMedia {
self.present(alert, animated: true)
}

menuButton.menu = UIMenu(title: "", children: [zoomViewMediaFolder, playFile, playURL])
// menuButton.menu = UIMenu(title: "", children: [zoomViewMediaFolder, playFile, playURL])
}
}

Expand Down
6 changes: 3 additions & 3 deletions iOSClient/Media/NCMedia.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="EFX-fO-Oip">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="EFX-fO-Oip">
<device id="retina5_9" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -51,7 +51,7 @@
<rect key="frame" x="255" y="70" width="20" height="20"/>
<color key="color" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</activityIndicatorView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Enx-va-Bud">
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Enx-va-Bud">
<rect key="frame" x="235" y="65" width="90" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="90" id="N4t-Eb-vDt"/>
Expand Down
Loading