Skip to content
Open
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
40 changes: 40 additions & 0 deletions Nextcloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@
AFCE353527E4ED5900FEA6C2 /* DateFormatter+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353427E4ED5900FEA6C2 /* DateFormatter+Extension.swift */; };
AFCE353727E4ED7B00FEA6C2 /* NCShareCells.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353627E4ED7B00FEA6C2 /* NCShareCells.swift */; };
AFCE353927E5DE0500FEA6C2 /* Shareable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353827E5DE0400FEA6C2 /* Shareable.swift */; };
AFCE353927E5DE0500FEA6C2 /* NCShare+Helper.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353827E5DE0400FEA6C2 /* NCShare+Helper.swift */; };
B543154E2DA6913C00981E7E /* AudioUploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B543154D2DA6913C00981E7E /* AudioUploadTests.swift */; };
B54315552DA6929700981E7E /* NCCreateFormUploadVoiceNote.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54315522DA6929700981E7E /* NCCreateFormUploadVoiceNote.swift */; };
B543155A2DA6929700981E7E /* NCCreateFormUploadVoiceNote.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B54315512DA6929700981E7E /* NCCreateFormUploadVoiceNote.storyboard */; };
B543155B2DA6929700981E7E /* NCCreateFormUploadVoiceNote.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54315522DA6929700981E7E /* NCCreateFormUploadVoiceNote.swift */; };
B543155C2DA6929700981E7E /* FolderPathCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B543154F2DA6929700981E7E /* FolderPathCustomCell.swift */; };
B543155D2DA6929700981E7E /* TextTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54315532DA6929700981E7E /* TextTableViewCell.swift */; };
B543155E2DA6929700981E7E /* TextTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B54315542DA6929700981E7E /* TextTableViewCell.xib */; };
B543155F2DA6929700981E7E /* FolderPathCustomCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B54315502DA6929700981E7E /* FolderPathCustomCell.xib */; };
B54315602DA6929700981E7E /* NCCreateFormUploadVoiceNote.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B54315512DA6929700981E7E /* NCCreateFormUploadVoiceNote.storyboard */; };
C04E2F232A17BB4D001BAD85 /* FilesIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04E2F222A17BB4D001BAD85 /* FilesIntegrationTests.swift */; };
D575039F27146F93008DC9DC /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A0D1342591FBC5008F8A13 /* String+Extension.swift */; };
D5B6AA7827200C7200D49C24 /* NCActivityTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */; };
F310B1EF2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = F310B1EE2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift */; };
F321DA8A2B71205A00DDA0E6 /* NCTrashSelectTabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = F321DA892B71205A00DDA0E6 /* NCTrashSelectTabBar.swift */; };
Expand Down Expand Up @@ -1221,6 +1233,14 @@
AFCE353427E4ED5900FEA6C2 /* DateFormatter+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DateFormatter+Extension.swift"; sourceTree = "<group>"; };
AFCE353627E4ED7B00FEA6C2 /* NCShareCells.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShareCells.swift; sourceTree = "<group>"; };
AFCE353827E5DE0400FEA6C2 /* Shareable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Shareable.swift; sourceTree = "<group>"; };
AFCE353827E5DE0400FEA6C2 /* NCShare+Helper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCShare+Helper.swift"; sourceTree = "<group>"; };
B543154D2DA6913C00981E7E /* AudioUploadTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioUploadTests.swift; sourceTree = "<group>"; };
B543154F2DA6929700981E7E /* FolderPathCustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FolderPathCustomCell.swift; sourceTree = "<group>"; };
B54315502DA6929700981E7E /* FolderPathCustomCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FolderPathCustomCell.xib; sourceTree = "<group>"; };
B54315512DA6929700981E7E /* NCCreateFormUploadVoiceNote.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCCreateFormUploadVoiceNote.storyboard; sourceTree = "<group>"; };
B54315522DA6929700981E7E /* NCCreateFormUploadVoiceNote.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCreateFormUploadVoiceNote.swift; sourceTree = "<group>"; };
B54315532DA6929700981E7E /* TextTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextTableViewCell.swift; sourceTree = "<group>"; };
B54315542DA6929700981E7E /* TextTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TextTableViewCell.xib; sourceTree = "<group>"; };
C0046CDA2A17B98400D87C9D /* NextcloudUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NextcloudUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
C04E2F202A17BB4D001BAD85 /* NextcloudIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NextcloudIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCActivityTableViewCell.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2024,6 +2044,8 @@
isa = PBXGroup;
children = (
AA52EB452D42AC5A0089C348 /* Placeholder.swift */,
B543154D2DA6913C00981E7E /* AudioUploadTests.swift */,
AF8ED1FB2757821000B8DBC4 /* NextcloudUnitTests.swift */,
);
path = NextcloudUnitTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -3103,6 +3125,12 @@
F7DFB7E9219C5A0500680748 /* Create */ = {
isa = PBXGroup;
children = (
B543154F2DA6929700981E7E /* FolderPathCustomCell.swift */,
B54315502DA6929700981E7E /* FolderPathCustomCell.xib */,
B54315512DA6929700981E7E /* NCCreateFormUploadVoiceNote.storyboard */,
B54315522DA6929700981E7E /* NCCreateFormUploadVoiceNote.swift */,
B54315532DA6929700981E7E /* TextTableViewCell.swift */,
B54315542DA6929700981E7E /* TextTableViewCell.xib */,
F7FA7FFD2C0F4F3B0072FC60 /* Upload Assets */,
F7A509242C26BD5D00326106 /* NCCreate.swift */,
F704B5E22430AA6F00632F5F /* NCCreateFormUploadConflict.storyboard */,
Expand Down Expand Up @@ -3869,6 +3897,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B543155A2DA6929700981E7E /* NCCreateFormUploadVoiceNote.storyboard in Resources */,
F714803B262EBE3900693E51 /* MainInterface.storyboard in Resources */,
F7148054262ED51000693E51 /* NCListCell.xib in Resources */,
F7E4022C2BA85D1D007E5609 /* PrivacyInfo.xcprivacy in Resources */,
Expand Down Expand Up @@ -3960,6 +3989,10 @@
F70753F72542A9C000972D44 /* NCViewerMediaPage.storyboard in Resources */,
F7F4F10627ECDBDB008676F9 /* Inconsolata-Medium.ttf in Resources */,
F7AC934A296193050002BC0F /* Reasons to use Nextcloud.pdf in Resources */,
B543155E2DA6929700981E7E /* TextTableViewCell.xib in Resources */,
B543155F2DA6929700981E7E /* FolderPathCustomCell.xib in Resources */,
B54315602DA6929700981E7E /* NCCreateFormUploadVoiceNote.storyboard in Resources */,
F7A60F87292D215000FCE1F2 /* NCShareAccounts.storyboard in Resources */,
F761856A29E98543006EB3B0 /* NCIntro.storyboard in Resources */,
F719D9E0288D37A300762E33 /* NCColorPicker.storyboard in Resources */,
AA517B802D660EFE00F8D37C /* Localizable.stringsdict in Resources */,
Expand Down Expand Up @@ -4083,6 +4116,7 @@
files = (
AA52EB472D42AC9E0089C348 /* Placeholder.swift in Sources */,
F372087D2BAB4C0F006B5430 /* TestConstants.swift in Sources */,
B543154E2DA6913C00981E7E /* AudioUploadTests.swift in Sources */,
F78E2D6C29AF02DB0024D4F3 /* Database.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -4264,6 +4298,9 @@
F73EF7E22B02266D0087E6E9 /* NCManageDatabase+Trash.swift in Sources */,
F77DD6AB2C5CC093009448FB /* NCSession.swift in Sources */,
F76D364728A4F8BF00214537 /* NCActivityIndicator.swift in Sources */,
F73EF7CA2B0225610087E6E9 /* NCManageDatabase+PhotoLibrary.swift in Sources */,
B54315552DA6929700981E7E /* NCCreateFormUploadVoiceNote.swift in Sources */,
F7BFFD2A2C8854200029A201 /* NCHud.swift in Sources */,
F749B654297B0F2400087535 /* NCManageDatabase+Avatar.swift in Sources */,
AF22B208277B4E4C00DAB0CC /* NCCreateFormUploadConflictCell.swift in Sources */,
F73EF7C22B02250B0087E6E9 /* NCManageDatabase+GPS.swift in Sources */,
Expand Down Expand Up @@ -4539,6 +4576,9 @@
F3C587AE2D47E4FE004532DB /* PHAssetCollectionThumbnailLoader.swift in Sources */,
F78F74362163781100C2ADAD /* NCTrash.swift in Sources */,
F39298972A3B12CB00509762 /* BaseNCMoreCell.swift in Sources */,
B543155B2DA6929700981E7E /* NCCreateFormUploadVoiceNote.swift in Sources */,
B543155C2DA6929700981E7E /* FolderPathCustomCell.swift in Sources */,
B543155D2DA6929700981E7E /* TextTableViewCell.swift in Sources */,
AF2D7C7C2742556F00ADF566 /* NCShareLinkCell.swift in Sources */,
F7E41316294A19B300839300 /* UIView+Extension.swift in Sources */,
F7C30E00291BD2610017149B /* NCNetworkingE2EERename.swift in Sources */,
Expand Down
52 changes: 52 additions & 0 deletions Tests/NextcloudUnitTests/AudioUploadTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//
// AudioUploadTests.swift
// NextcloudTests
//
// Created by A200020526 on 13/06/23.
// Copyright © 2023 Marino Faggiana. All rights reserved.
//

import XCTest
@testable import Nextcloud

final class AudioUploadTests: XCTestCase {
var viewController:NCAudioRecorderViewController?

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
// Step 1. Create an instance of UIStoryboard
let viewController = UIStoryboard(name: "NCAudioRecorderViewController", bundle: nil).instantiateInitialViewController() as? NCAudioRecorderViewController
// Step 3. Make the viewDidLoad() execute.
viewController?.loadViewIfNeeded()
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
viewController = nil
}

func testExample() throws {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
// Any test you write for XCTest can be annotated as throws and async.
// Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
// Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
}

func testPerformanceExample() throws {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}

func testAudioMeterUpdateAfterDb(){
viewController?.audioMeterDidUpdate(0.5)
XCTAssertNotNil(!(viewController?.durationLabel.text?.isEmpty ?? false))
}

func testStartRecorder(){
viewController?.startStop()
XCTAssertEqual(viewController?.recording.state, nil, "Test start audio recorder")
}
}
8 changes: 4 additions & 4 deletions iOSClient/AudioRecorder/NCAudioRecorderViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ class NCAudioRecorderViewController: UIViewController, NCAudioRecorderDelegate {

view.backgroundColor = .clear
contentContainerView.backgroundColor = UIColor.lightGray
voiceRecordHUD.fillColor = UIColor.green

voiceRecordHUD.fillColor = NCBrandColor.shared.progressColorGreen60
Task {
self.fileName = await NCNetworking.shared.createFileName(fileNameBase: NSLocalizedString("_untitled_", comment: "") + ".m4a", account: self.session.account, serverUrl: controller.currentServerUrl())
self.fileName = NCUtilityFileSystem().createFileNameDate(NSLocalizedString("_voice_memo_filename_", comment: ""), ext: "m4a")
recording = NCAudioRecorder(to: self.fileName)
recording.delegate = self
do {
Expand Down Expand Up @@ -124,7 +124,7 @@ class NCAudioRecorderViewController: UIViewController, NCAudioRecorderDelegate {
}

voiceRecordHUD.update(CGFloat(rate))
voiceRecordHUD.fillColor = UIColor.green
voiceRecordHUD.fillColor = NCBrandColor.shared.progressColorGreen60

let formatter = DateComponentsFormatter()
formatter.allowedUnits = [.second]
Expand Down
34 changes: 34 additions & 0 deletions iOSClient/Main/Create/FolderPathCustomCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// FolderPathCustomCell.swift
// Nextcloud
//
// Created by A200073704 on 04/05/23.
// Copyright © 2023 Marino Faggiana. All rights reserved.
//

import UIKit
import XLForm

class FolderPathCustomCell: XLFormButtonCell{

@IBOutlet weak var photoLabel: UILabel!
@IBOutlet weak var folderImage: UIImageView!
@IBOutlet weak var bottomLineView: UIView!

override func awakeFromNib() {
super.awakeFromNib()
}

override func configure() {
super.configure()
}

override func update() {
super.update()
if (rowDescriptor.tag == "PhotoButtonDestinationFolder"){
bottomLineView.isHidden = true
}else{
bottomLineView.isHidden = false
}
}
}
75 changes: 75 additions & 0 deletions iOSClient/Main/Create/FolderPathCustomCell.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23727" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23721"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<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"/>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" shouldIndentWhileEditing="NO" reuseIdentifier="folderCustomCell" id="gCq-ql-kOy" customClass="FolderPathCustomCell" customModule="Nextcloud" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="gCq-ql-kOy" id="ZCa-fn-Xv4">
<rect key="frame" x="0.0" y="0.0" width="414" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GB7-Lu-frs">
<rect key="frame" x="20" y="11.5" width="333" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="l63-AG-MTN">
<rect key="frame" x="373" y="9.5" width="25" height="25"/>
<constraints>
<constraint firstAttribute="width" constant="25" id="a67-iQ-0bc"/>
<constraint firstAttribute="height" constant="25" id="dIj-dS-LsQ"/>
</constraints>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hsG-y9-Vyh" userLabel="bottomline">
<rect key="frame" x="0.0" y="43" width="414" height="1"/>
<color key="backgroundColor" systemColor="separatorColor"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="okE-Xs-OPB"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cs4-ud-88f" userLabel="topline">
<rect key="frame" x="0.0" y="0.0" width="414" height="1"/>
<color key="backgroundColor" systemColor="separatorColor"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="ZW0-np-clD"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstItem="GB7-Lu-frs" firstAttribute="leading" secondItem="ZCa-fn-Xv4" secondAttribute="leading" constant="20" id="1CX-lB-x8B"/>
<constraint firstItem="l63-AG-MTN" firstAttribute="centerY" secondItem="ZCa-fn-Xv4" secondAttribute="centerY" id="5Fe-g5-NmK"/>
<constraint firstItem="hsG-y9-Vyh" firstAttribute="leading" secondItem="ZCa-fn-Xv4" secondAttribute="leading" id="CsC-Wc-ghc"/>
<constraint firstItem="cs4-ud-88f" firstAttribute="top" secondItem="ZCa-fn-Xv4" secondAttribute="top" id="TOq-Jy-guz"/>
<constraint firstItem="GB7-Lu-frs" firstAttribute="centerY" secondItem="ZCa-fn-Xv4" secondAttribute="centerY" id="Yg4-B7-Ylv"/>
<constraint firstAttribute="trailing" secondItem="hsG-y9-Vyh" secondAttribute="trailing" id="abc-ys-XbX"/>
<constraint firstAttribute="trailing" secondItem="l63-AG-MTN" secondAttribute="trailing" constant="16" id="kod-W1-FAt"/>
<constraint firstAttribute="bottom" secondItem="hsG-y9-Vyh" secondAttribute="bottom" id="n3N-38-KYt"/>
<constraint firstItem="cs4-ud-88f" firstAttribute="leading" secondItem="ZCa-fn-Xv4" secondAttribute="leading" id="xBD-wU-ksp"/>
<constraint firstItem="l63-AG-MTN" firstAttribute="leading" secondItem="GB7-Lu-frs" secondAttribute="trailing" constant="20" id="yHG-zK-3Sj"/>
<constraint firstAttribute="trailing" secondItem="cs4-ud-88f" secondAttribute="trailing" id="yaU-4w-s5Y"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="bottomLineView" destination="hsG-y9-Vyh" id="ei7-ki-fst"/>
<outlet property="folderImage" destination="l63-AG-MTN" id="viQ-ea-JwI"/>
<outlet property="photoLabel" destination="GB7-Lu-frs" id="GjI-eQ-w8z"/>
</connections>
<point key="canvasLocation" x="71.014492753623188" y="107.8125"/>
</tableViewCell>
</objects>
<resources>
<systemColor name="separatorColor">
<color red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.28999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
Loading