@@ -177,91 +177,85 @@ import RealmSwift
177177
178178 // MARK: -
179179
180- func getImageFile( ) -> UIImage {
181- return utility. loadImage ( named: " doc " , colors: [ NCBrandColor . shared. iconImageColor2] )
180+ struct images {
181+ static var file = UIImage ( )
182+
183+ static var shared = UIImage ( )
184+ static var canShare = UIImage ( )
185+ static var shareByLink = UIImage ( )
186+ static var sharedWithMe = UIImage ( )
187+
188+ static var favorite = UIImage ( )
189+ static var livePhoto = UIImage ( )
190+ static var offlineFlag = UIImage ( )
191+ static var local = UIImage ( )
192+
193+ static var folderEncrypted = UIImage ( )
194+ static var folderSharedWithMe = UIImage ( )
195+ static var folderPublic = UIImage ( )
196+ static var folderGroup = UIImage ( )
197+ static var folderExternal = UIImage ( )
198+ static var folderAutomaticUpload = UIImage ( )
199+ static var folder = UIImage ( )
200+
201+ static var checkedYes = UIImage ( )
202+ static var checkedNo = UIImage ( )
203+
204+ static var buttonMore = UIImage ( )
205+ static var buttonStop = UIImage ( )
206+ static var buttonMoreLock = UIImage ( )
207+
208+ static var iconContacts = UIImage ( )
209+ static var iconTalk = UIImage ( )
210+ static var iconCalendar = UIImage ( )
211+ static var iconDeck = UIImage ( )
212+ static var iconMail = UIImage ( )
213+ static var iconConfirm = UIImage ( )
214+ static var iconPages = UIImage ( )
215+ static var iconFile = UIImage ( )
182216 }
183217
184- func getImageShared( account: String ) -> UIImage {
185- return UIImage ( named: " share " ) !. image ( color: NCBrandColor . shared. getElement ( account: account) )
186- }
218+ func createImagesCache( ) {
219+ let utility = NCUtility ( )
187220
188- func getImageCanShare( ) -> UIImage {
189- return UIImage ( named: " share " ) !. imageColor ( . systemGray)
190- }
221+ images. file = utility. loadImage ( named: " doc " , colors: [ NCBrandColor . shared. iconImageColor2] )
191222
192- func getImageShareByLink( ) -> UIImage {
193- return utility. loadImage ( named: " link " , colors: [ NCBrandColor . shared. iconImageColor] )
194- }
223+ images. shared = UIImage ( named: " share " ) !. image ( color: . systemGray, size: 50 )
224+ images. canShare = UIImage ( named: " share " ) !. image ( color: . systemGray, size: 50 )
225+ images. shareByLink = UIImage ( named: " sharebylink " ) !. image ( color: . systemGray, size: 50 )
226+ images. sharedWithMe = UIImage . init ( named: " cloudUpload " ) !. image ( color: NCBrandColor . shared. nmcIconSharedWithMe, size: 50 )
227+
228+ images. favorite = utility. loadImage ( named: " star.fill " , colors: [ NCBrandColor . shared. yellowFavorite] )
229+ images. livePhoto = utility. loadImage ( named: " livephoto " , colors: [ . label] )
230+ images. offlineFlag = UIImage ( named: " offlineFlag " ) !
231+ images. local = utility. loadImage ( named: " checkmark.circle.fill " , colors: [ . systemGreen] )
195232
196- func getImageFavorite( ) -> UIImage {
197- return utility. loadImage ( named: " star.fill " , colors: [ NCBrandColor . shared. yellowFavorite] )
198- }
233+ images. checkedYes = UIImage ( named: " checkedYes " ) !
234+ images. checkedNo = UIImage ( named: " local " ) !
199235
200- func getImageOfflineFlag( ) -> UIImage {
201- return utility. loadImage ( named: " arrow.down.circle.fill " , colors: [ . systemGreen] )
202- }
203-
204- func getImageLocal( ) -> UIImage {
205- return utility. loadImage ( named: " checkmark.circle.fill " , colors: [ . systemGreen] )
206- }
207-
208- func getImageCheckedYes( ) -> UIImage {
209- return utility. loadImage ( named: " checkmark.circle.fill " , colors: [ NCBrandColor . shared. iconImageColor2] )
210- }
211-
212- func getImageCheckedNo( ) -> UIImage {
213- return utility. loadImage ( named: " circle " , colors: [ NCBrandColor . shared. iconImageColor] )
214- }
215-
216- func getImageButtonMore( ) -> UIImage {
217- return UIImage ( named: " more " ) !. imageColor ( . systemGray)
218- }
219-
220- func getImageButtonStop( ) -> UIImage {
221- return utility. loadImage ( named: " stop.circle " , colors: [ NCBrandColor . shared. iconImageColor] )
222- }
223-
224- func getImageButtonMoreLock( ) -> UIImage {
225- return utility. loadImage ( named: " lock.fill " , colors: [ NCBrandColor . shared. iconImageColor] )
226- }
227-
228- func getFolder( account: String ) -> UIImage {
229- return UIImage ( named: " folder " ) !. image ( color: NCBrandColor . shared. getElement ( account: account) )
230- }
231-
232- func getAddFolder( ) -> UIImage {
233- return UIImage ( named: " addFolder " ) !
234- }
235-
236- func getAddFolderInfo( ) -> UIImage {
237- return UIImage ( named: " addFolderInfo " ) !. imageColor ( NCBrandColor . shared. iconImageColor)
238- }
239-
240- func getFolderEncrypted( account: String ) -> UIImage {
241- return UIImage ( named: " folderEncrypted " ) !. image ( color: NCBrandColor . shared. getElement ( account: account) )
242- }
243-
244- func getEncryptedFolder( ) -> UIImage {
245- return UIImage ( named: " encryptedfolder " ) !. imageColor ( NCBrandColor . shared. iconImageColor)
246- }
247-
248- func getFolderSharedWithMe( account: String ) -> UIImage {
249- return UIImage ( named: " folder_shared_with_me " ) !. image ( color: NCBrandColor . shared. getElement ( account: account) )
250- }
251-
252- func getFolderPublic( account: String ) -> UIImage {
253- return UIImage ( named: " folder_public " ) !. image ( color: NCBrandColor . shared. getElement ( account: account) )
254- }
255-
256- func getFolderGroup( account: String ) -> UIImage {
257- return UIImage ( named: " folder_group " ) !. image ( color: NCBrandColor . shared. getElement ( account: account) )
258- }
236+ images. buttonMore = utility. loadImage ( named: " ellipsis " , colors: [ NCBrandColor . shared. iconImageColor] )
237+ images. buttonStop = utility. loadImage ( named: " stop.circle " , colors: [ NCBrandColor . shared. iconImageColor] )
238+ images. buttonMoreLock = utility. loadImage ( named: " lock.fill " , colors: [ NCBrandColor . shared. iconImageColor] )
259239
260- func getFolderExternal( account: String ) -> UIImage {
261- return UIImage ( named: " folder_external " ) !. image ( color: NCBrandColor . shared. getElement ( account: account) )
240+ createImagesBrandCache ( )
262241 }
263242
264- func getFolderAutomaticUpload( account: String ) -> UIImage {
265- return UIImage ( named: " folderAutomaticUpload " ) !. image ( color: NCBrandColor . shared. getElement ( account: account) )
243+ func createImagesBrandCache( ) {
244+
245+ images. folderEncrypted = UIImage ( named: " folderEncrypted " ) !
246+ images. folderSharedWithMe = UIImage ( named: " folder_shared_with_me " ) !
247+ images. folderPublic = UIImage ( named: " folder_public " ) !
248+ images. folderGroup = UIImage ( named: " folder_group " ) !
249+ images. folderExternal = UIImage ( named: " folder_external " ) !
250+ images. folderAutomaticUpload = UIImage ( named: " folderAutomaticUpload " ) !
251+ images. folder = UIImage ( named: " folder " ) !
252+ images. iconContacts = utility. loadImage ( named: " person.crop.rectangle.stack " , colors: [ NCBrandColor . shared. iconImageColor] )
253+ images. iconTalk = UIImage ( named: " talk-template " ) !. image ( color: brandElement)
254+ images. iconCalendar = utility. loadImage ( named: " calendar " , colors: [ NCBrandColor . shared. iconImageColor] )
255+ images. iconDeck = utility. loadImage ( named: " square.stack.fill " , colors: [ NCBrandColor . shared. iconImageColor] )
256+ images. iconMail = utility. loadImage ( named: " mail " , colors: [ NCBrandColor . shared. iconImageColor] )
257+ images. iconConfirm = utility. loadImage ( named: " arrow.right " , colors: [ NCBrandColor . shared. iconImageColor] )
258+ images. iconPages = utility. loadImage ( named: " doc.richtext " , colors: [ NCBrandColor . shared. iconImageColor] )
259+ images. iconFile = utility. loadImage ( named: " doc " , colors: [ NCBrandColor . shared. iconImageColor] )
266260 }
267261}
0 commit comments