From 5a758724b3057056d590e88f9ec5a41b6b085616 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Mon, 10 Oct 2022 16:40:08 +1100 Subject: [PATCH] Made a few last minute tweaks and fixes Updated a couple more translations Updated the copy for the member count in communities Deleted some more unused code Fixed up another RTL issue --- Session.xcodeproj/project.pbxproj | 20 +- Session/Conversations/ConversationVC.swift | 6 + .../Settings/OWSMessageTimerView.m | 1 - .../ConversationTitleView.swift | 18 +- .../Views/MessageRequestsCell.swift | 14 +- Session/Meta/Signal-Bridging-Header.h | 1 - .../Translations/fa.lproj/Localizable.strings | 20 +- .../SignalShareExtension-Bridging-Header.h | 1 - .../Utilities/UIColor+Utilities.swift | 24 ++ .../ImageEditorPaletteView.swift | 20 +- SignalUtilitiesKit/Meta/SignalUtilitiesKit.h | 1 - SignalUtilitiesKit/Utilities/UIColor+OWS.h | 67 ------ SignalUtilitiesKit/Utilities/UIColor+OWS.m | 212 ------------------ 13 files changed, 77 insertions(+), 328 deletions(-) delete mode 100644 SignalUtilitiesKit/Utilities/UIColor+OWS.h delete mode 100644 SignalUtilitiesKit/Utilities/UIColor+OWS.m diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 5632c8aae..ebfd2189a 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -372,11 +372,9 @@ C38EF245255B6D67007E1867 /* UIFont+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = C38EF238255B6D66007E1867 /* UIFont+OWS.m */; }; C38EF246255B6D67007E1867 /* UIFont+OWS.h in Headers */ = {isa = PBXBuildFile; fileRef = C38EF239255B6D66007E1867 /* UIFont+OWS.h */; settings = {ATTRIBUTES = (Public, ); }; }; C38EF247255B6D67007E1867 /* NSAttributedString+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = C38EF23A255B6D66007E1867 /* NSAttributedString+OWS.m */; }; - C38EF249255B6D67007E1867 /* UIColor+OWS.h in Headers */ = {isa = PBXBuildFile; fileRef = C38EF23C255B6D66007E1867 /* UIColor+OWS.h */; settings = {ATTRIBUTES = (Public, ); }; }; C38EF24C255B6D67007E1867 /* NSAttributedString+OWS.h in Headers */ = {isa = PBXBuildFile; fileRef = C38EF23F255B6D67007E1867 /* NSAttributedString+OWS.h */; settings = {ATTRIBUTES = (Public, ); }; }; C38EF24D255B6D67007E1867 /* UIView+OWS.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF240255B6D67007E1867 /* UIView+OWS.swift */; }; C38EF24E255B6D67007E1867 /* Collection+OWS.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF241255B6D67007E1867 /* Collection+OWS.swift */; }; - C38EF24F255B6D67007E1867 /* UIColor+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = C38EF242255B6D67007E1867 /* UIColor+OWS.m */; }; C38EF2A5255B6D93007E1867 /* Identicon+ObjC.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF2A2255B6D93007E1867 /* Identicon+ObjC.swift */; }; C38EF2A6255B6D93007E1867 /* PlaceholderIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF2A3255B6D93007E1867 /* PlaceholderIcon.swift */; }; C38EF2A7255B6D93007E1867 /* ProfilePictureView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF2A4255B6D93007E1867 /* ProfilePictureView.swift */; }; @@ -1467,13 +1465,11 @@ C38EF238255B6D66007E1867 /* UIFont+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIFont+OWS.m"; path = "SignalUtilitiesKit/Utilities/UIFont+OWS.m"; sourceTree = SOURCE_ROOT; }; C38EF239255B6D66007E1867 /* UIFont+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIFont+OWS.h"; path = "SignalUtilitiesKit/Utilities/UIFont+OWS.h"; sourceTree = SOURCE_ROOT; }; C38EF23A255B6D66007E1867 /* NSAttributedString+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSAttributedString+OWS.m"; path = "SignalUtilitiesKit/Utilities/NSAttributedString+OWS.m"; sourceTree = SOURCE_ROOT; }; - C38EF23C255B6D66007E1867 /* UIColor+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIColor+OWS.h"; path = "SignalUtilitiesKit/Utilities/UIColor+OWS.h"; sourceTree = SOURCE_ROOT; }; C38EF23D255B6D66007E1867 /* UIView+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIView+OWS.h"; path = "SessionUtilitiesKit/General/UIView+OWS.h"; sourceTree = SOURCE_ROOT; }; C38EF23E255B6D66007E1867 /* UIView+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIView+OWS.m"; path = "SessionUtilitiesKit/General/UIView+OWS.m"; sourceTree = SOURCE_ROOT; }; C38EF23F255B6D67007E1867 /* NSAttributedString+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSAttributedString+OWS.h"; path = "SignalUtilitiesKit/Utilities/NSAttributedString+OWS.h"; sourceTree = SOURCE_ROOT; }; C38EF240255B6D67007E1867 /* UIView+OWS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIView+OWS.swift"; path = "SignalUtilitiesKit/Utilities/UIView+OWS.swift"; sourceTree = SOURCE_ROOT; }; C38EF241255B6D67007E1867 /* Collection+OWS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Collection+OWS.swift"; path = "SignalUtilitiesKit/Utilities/Collection+OWS.swift"; sourceTree = SOURCE_ROOT; }; - C38EF242255B6D67007E1867 /* UIColor+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIColor+OWS.m"; path = "SignalUtilitiesKit/Utilities/UIColor+OWS.m"; sourceTree = SOURCE_ROOT; }; C38EF281255B6D84007E1867 /* OWSAudioSession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OWSAudioSession.swift; path = SessionMessagingKit/Utilities/OWSAudioSession.swift; sourceTree = SOURCE_ROOT; }; C38EF2A2255B6D93007E1867 /* Identicon+ObjC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Identicon+ObjC.swift"; path = "SignalUtilitiesKit/Profile Pictures/Identicon+ObjC.swift"; sourceTree = SOURCE_ROOT; }; C38EF2A3255B6D93007E1867 /* PlaceholderIcon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PlaceholderIcon.swift; path = "SignalUtilitiesKit/Profile Pictures/PlaceholderIcon.swift"; sourceTree = SOURCE_ROOT; }; @@ -3290,8 +3286,6 @@ C38EF3DC255B6DF1007E1867 /* DirectionalPanGestureRecognizer.swift */, C38EF240255B6D67007E1867 /* UIView+OWS.swift */, FD71161D28D9772700B47552 /* UIViewController+OWS.swift */, - C38EF23C255B6D66007E1867 /* UIColor+OWS.h */, - C38EF242255B6D67007E1867 /* UIColor+OWS.m */, C38EF2B1255B6D9C007E1867 /* UIViewController+Utilities.swift */, C38EF307255B6DBE007E1867 /* UIGestureRecognizer+OWS.swift */, C38EF239255B6D66007E1867 /* UIFont+OWS.h */, @@ -4170,7 +4164,6 @@ C38EF32B255B6DBF007E1867 /* OWSFormat.h in Headers */, C33FDDCC255A582000E217F9 /* TSConstants.h in Headers */, C33FDDBD255A582000E217F9 /* ByteParser.h in Headers */, - C38EF249255B6D67007E1867 /* UIColor+OWS.h in Headers */, C33FDDB3255A582000E217F9 /* OWSError.h in Headers */, C38EF35E255B6DCC007E1867 /* OWSViewController.h in Headers */, C38EF246255B6D67007E1867 /* UIFont+OWS.h in Headers */, @@ -5215,7 +5208,6 @@ FD52090B28B59BB4006098F6 /* ScreenLockViewController.swift in Sources */, C38EF401255B6DF7007E1867 /* VideoPlayerView.swift in Sources */, C38EF3BD255B6DE7007E1867 /* ImageEditorTransform.swift in Sources */, - C38EF24F255B6D67007E1867 /* UIColor+OWS.m in Sources */, C33FDC9A255A582000E217F9 /* ByteParser.m in Sources */, C33FDC58255A582000E217F9 /* ReverseDispatchQueue.swift in Sources */, C33FDC78255A582000E217F9 /* TSConstants.m in Sources */, @@ -6028,7 +6020,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 379; + CURRENT_PROJECT_VERSION = 380; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -6101,7 +6093,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 379; + CURRENT_PROJECT_VERSION = 380; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -6167,7 +6159,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 379; + CURRENT_PROJECT_VERSION = 380; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -6241,7 +6233,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 379; + CURRENT_PROJECT_VERSION = 380; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -7169,7 +7161,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 379; + CURRENT_PROJECT_VERSION = 380; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -7241,7 +7233,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 379; + CURRENT_PROJECT_VERSION = 380; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", diff --git a/Session/Conversations/ConversationVC.swift b/Session/Conversations/ConversationVC.swift index 528c9ca0c..1518c5663 100644 --- a/Session/Conversations/ConversationVC.swift +++ b/Session/Conversations/ConversationVC.swift @@ -1560,6 +1560,12 @@ final class ConversationVC: BaseVC, ConversationSearchControllerDelegate, UITabl return } + // Note: If the tableView needs to layout then we should do it first without an animation + // to prevent an annoying issue where the screen jumps slightly after the scroll completes + UIView.performWithoutAnimation { + self.tableView.layoutIfNeeded() + } + let targetIndexPath: IndexPath = IndexPath( row: targetMessageIndex, section: messageSectionIndex diff --git a/Session/Conversations/Settings/OWSMessageTimerView.m b/Session/Conversations/Settings/OWSMessageTimerView.m index 0cca65533..dc71b3b06 100644 --- a/Session/Conversations/Settings/OWSMessageTimerView.m +++ b/Session/Conversations/Settings/OWSMessageTimerView.m @@ -4,7 +4,6 @@ #import "OWSMessageTimerView.h" #import "OWSMath.h" -#import "UIColor+OWS.h" #import "UIView+OWS.h" #import #import diff --git a/Session/Conversations/Views & Modals/ConversationTitleView.swift b/Session/Conversations/Views & Modals/ConversationTitleView.swift index 02eea901d..f9c1e549e 100644 --- a/Session/Conversations/Views & Modals/ConversationTitleView.swift +++ b/Session/Conversations/Views & Modals/ConversationTitleView.swift @@ -111,7 +111,7 @@ final class ConversationTitleView: UIView { ThemeManager.onThemeChange(observer: self.subtitleLabel) { [weak subtitleLabel] theme, _ in guard let textPrimary: UIColor = theme.color(for: .textPrimary) else { return } - //subtitleLabel?.attributedText = subtitle + guard Date().timeIntervalSince1970 > (mutedUntilTimestamp ?? 0) else { subtitleLabel?.attributedText = NSAttributedString( string: "\u{e067} ", @@ -140,9 +140,19 @@ final class ConversationTitleView: UIView { } guard let userCount: Int = userCount else { return } - subtitleLabel?.attributedText = NSAttributedString( - string: "\(userCount) member\(userCount == 1 ? "" : "s")" - ) + switch threadVariant { + case .contact: break + + case .closedGroup: + subtitleLabel?.attributedText = NSAttributedString( + string: "\(userCount) member\(userCount == 1 ? "" : "s")" + ) + + case .openGroup: + subtitleLabel?.attributedText = NSAttributedString( + string: "\(userCount) active member\(userCount == 1 ? "" : "s")" + ) + } } // Contact threads also have the call button to compensate for diff --git a/Session/Home/Message Requests/Views/MessageRequestsCell.swift b/Session/Home/Message Requests/Views/MessageRequestsCell.swift index fc2391f46..1299a20d8 100644 --- a/Session/Home/Message Requests/Views/MessageRequestsCell.swift +++ b/Session/Home/Message Requests/Views/MessageRequestsCell.swift @@ -94,8 +94,8 @@ class MessageRequestsCell: UITableViewCell { NSLayoutConstraint.activate([ contentView.heightAnchor.constraint(equalToConstant: 68), - iconContainerView.leftAnchor.constraint( - equalTo: contentView.leftAnchor, + iconContainerView.leadingAnchor.constraint( + equalTo: contentView.leadingAnchor, // Need 'accentLineThickness' to line up correctly with the 'ConversationCell' constant: (Values.accentLineThickness + Values.mediumSpacing) ), @@ -108,18 +108,18 @@ class MessageRequestsCell: UITableViewCell { iconImageView.widthAnchor.constraint(equalToConstant: 25), iconImageView.heightAnchor.constraint(equalToConstant: 22), - titleLabel.leftAnchor.constraint(equalTo: iconContainerView.rightAnchor, constant: Values.mediumSpacing), - titleLabel.rightAnchor.constraint(lessThanOrEqualTo: contentView.rightAnchor, constant: -Values.mediumSpacing), + titleLabel.leadingAnchor.constraint(equalTo: iconContainerView.trailingAnchor, constant: Values.mediumSpacing), + titleLabel.trailingAnchor.constraint(lessThanOrEqualTo: contentView.trailingAnchor, constant: -Values.mediumSpacing), titleLabel.centerYAnchor.constraint(equalTo: contentView.centerYAnchor), - unreadCountView.leftAnchor.constraint(equalTo: titleLabel.rightAnchor, constant: (Values.smallSpacing / 2)), + unreadCountView.leadingAnchor.constraint(equalTo: titleLabel.trailingAnchor, constant: (Values.smallSpacing / 2)), unreadCountView.centerYAnchor.constraint(equalTo: titleLabel.centerYAnchor), unreadCountView.widthAnchor.constraint(greaterThanOrEqualToConstant: FullConversationCell.unreadCountViewSize), unreadCountView.heightAnchor.constraint(equalToConstant: FullConversationCell.unreadCountViewSize), unreadCountLabel.topAnchor.constraint(equalTo: unreadCountView.topAnchor), - unreadCountLabel.leftAnchor.constraint(equalTo: unreadCountView.leftAnchor, constant: 4), - unreadCountLabel.rightAnchor.constraint(equalTo: unreadCountView.rightAnchor, constant: -4), + unreadCountLabel.leadingAnchor.constraint(equalTo: unreadCountView.leadingAnchor, constant: 4), + unreadCountLabel.trailingAnchor.constraint(equalTo: unreadCountView.trailingAnchor, constant: -4), unreadCountLabel.bottomAnchor.constraint(equalTo: unreadCountView.bottomAnchor) ]) } diff --git a/Session/Meta/Signal-Bridging-Header.h b/Session/Meta/Signal-Bridging-Header.h index 3e0316f92..26368c90c 100644 --- a/Session/Meta/Signal-Bridging-Header.h +++ b/Session/Meta/Signal-Bridging-Header.h @@ -24,7 +24,6 @@ #import #import #import -#import #import #import #import diff --git a/Session/Meta/Translations/fa.lproj/Localizable.strings b/Session/Meta/Translations/fa.lproj/Localizable.strings index a8c09035c..35dac1cb8 100644 --- a/Session/Meta/Translations/fa.lproj/Localizable.strings +++ b/Session/Meta/Translations/fa.lproj/Localizable.strings @@ -254,7 +254,7 @@ "share" = "به‌اشتراک‌گذاری"; "invalid_session_id" = "شناسه‌ی Session نامعتبر است."; "cancel" = "لغو"; -"your_session_id" = "شناسه‌ی Session شما"; +"your_session_id" = "شناسه Session شما"; "vc_landing_title_2" = "Session شما از اینجا شروع می‌شود..."; "vc_landing_register_button_title" = "شناسه‌ی Session را ایجاد کنید"; "vc_landing_restore_button_title" = "Session خود را ادامه دهید"; @@ -295,15 +295,15 @@ "vc_path_destination_row_title" = "مقصد"; "vc_path_learn_more_button_title" = "بیشتر بدانید"; "vc_create_private_chat_title" = "پیام جدید"; -"vc_create_private_chat_enter_session_id_tab_title" = "شناسه‌ی Session را وارد کنید"; +"vc_create_private_chat_enter_session_id_tab_title" = "شناسه Session را وارید کنید"; "vc_create_private_chat_scan_qr_code_tab_title" = "اسکن کد QR"; -"vc_enter_public_key_explanation" = "یک مکالمه جدید را با وارد کردن شناسه جلسه شخصی شروع کنید یا شناسه جلسه خود را با آنها به اشتراک بگذارید."; -"vc_scan_qr_code_camera_access_explanation" = "اپ Session برای اسکن کدهای QR احتیاج دارد به دوربین دسترسی داشته باشد"; +"vc_enter_public_key_explanation" = "یک مکالمه جدید را با وارد کردن شناسه Session شخصی شروع کنید یا شناسه جلسه خود را با آنها به اشتراک بگذارید."; +"vc_scan_qr_code_camera_access_explanation" = "برای اسکن کدهای Session ،QR نیاز به دسترسی به دوربین دارد"; "vc_scan_qr_code_grant_camera_access_button_title" = "اعطای دسترسی دوربین"; "vc_create_closed_group_title" = "ایجاد گروه"; "vc_create_closed_group_text_field_hint" = "وارد کردن یک نام گروه"; "vc_create_closed_group_empty_state_message" = "هنوز هیچ مخاطبی ندارید"; -"vc_create_closed_group_empty_state_button_title" = "شروع Session"; +"vc_create_closed_group_empty_state_button_title" = "شروع یک Session"; "vc_create_closed_group_group_name_missing_error" = "لطفاً یک نام گروه را وارد کنید"; "vc_create_closed_group_group_name_too_long_error" = "لطفاً یک نام گروه کوتاه‌تر را وارد کنید"; "vc_create_closed_group_too_many_group_members_error" = "یک گروه نمی‌تواند بیش از ۱۰۰ عضو داشته باشد."; @@ -334,7 +334,7 @@ "vc_link_device_scan_qr_code_explanation" = "برای دیدن کد QR خود، در دستگاه دیگرتان به «تنظیمات ← عبارت بازیابی» مراجعه کنید."; "vc_enter_recovery_phrase_title" = "عبارت بازیابی"; "vc_enter_recovery_phrase_explanation" = "برای وصل کردن دستگاهتان، عبارت بازیابی که در زمان ثبت نام به شما داده شده بود را وارد کنید."; -"vc_enter_public_key_text_field_hint" = "شناسه Session یا اسم سرویس نام Oxen را وارد کنید"; +"vc_enter_public_key_text_field_hint" = "شناسه Session یا نام ONS را وارید کنید"; "admin_group_leave_warning" = "به دلیل اینکه شما مدیر گروه هستید، این گروه برای همه اعضا ی گروه پاک میشود. این قابل بازگشت نیست."; "vc_join_open_group_suggestions_title" = "یا به یکی از این محلق شوید ..."; "vc_settings_invite_a_friend_button_title" = "دعوت از یک دوست"; @@ -483,8 +483,8 @@ "JOIN_COMMUNITY_BUTTON_TITLE" = "محلق شدن"; "PRIVACY_TITLE" = "حریم خصوصی"; "PRIVACY_SECTION_SCREEN_SECURITY" = "امنیت صفحه"; -"PRIVACY_SCREEN_SECURITY_LOCK_SESSION_TITLE" = "قفل سیسشن"; -"PRIVACY_SCREEN_SECURITY_LOCK_SESSION_DESCRIPTION" = " برای باز کردن قفل سیسشن به شناسه لمسی، شناسه صورت و یا رمز عبوری ضرورت است."; +"PRIVACY_SCREEN_SECURITY_LOCK_SESSION_TITLE" = "قفل Session"; +"PRIVACY_SCREEN_SECURITY_LOCK_SESSION_DESCRIPTION" = " برای باز کردن قفل Session به شناسه لمسی، شناسه صورت و یا رمز عبوری ضرورت است."; "PRIVACY_SCREEN_SECURITY_SCREENSHOT_NOTIFICATIONS_TITLE" = "اعلانات اسکرین‌شات."; "PRIVACY_SCREEN_SECURITY_SCREENSHOT_NOTIFICATIONS_DESCRIPTION" = "هنگامی که یک مخاطب از یک چت یک به یک اسکرین شات می‌گیرد، اعلان دریافت کنید."; "PRIVACY_SECTION_READ_RECEIPTS" = "رسیدهای خواندن"; @@ -542,7 +542,7 @@ "HELP_REPORT_BUG_TITLE" = "گزارش خرابی"; "HELP_REPORT_BUG_DESCRIPTION" = "گزارش‌های خود را صادر کنید، سپس فایل را از طریق Session's Help Desk آپلود کنید."; "HELP_REPORT_BUG_ACTION_TITLE" = "صدور گزارش‌ها"; -"HELP_TRANSLATE_TITLE" = "ترجمه سیسشن"; +"HELP_TRANSLATE_TITLE" = "ترجمه Session"; "HELP_FEEDBACK_TITLE" = "قدردان نظریات شما هستیم."; "HELP_FAQ_TITLE" = "سؤالات متداول"; "HELP_SUPPORT_TITLE" = "همایت"; @@ -576,7 +576,7 @@ "GROUP_TITLE_MEMBERS" = "اعضا"; "GROUP_TITLE_FALLBACK" = "گروه"; "DM_ERROR_DIRECT_BLINDED_ID" = "فقط از داخل یک انجمن می‌توانید به شناسه‌های نابینا پیام ارسال کنید"; -"DM_ERROR_INVALID" = "لطفاً شناسه جلسه یا نام ONS را بررسی کنید و دوباره امتحان کنید"; +"DM_ERROR_INVALID" = "لطفاً شناسه Session یا نام ONS را بررسی کنید و دوباره امتحان کنید"; "COMMUNITY_ERROR_INVALID_URL" = ""; "COMMUNITY_ERROR_GENERIC" = "نمی‌توانید محلق شوید"; "DISAPPERING_MESSAGES_TITLE" = "پیام‌ها ناپدید میشوند"; diff --git a/SessionShareExtension/Meta/SignalShareExtension-Bridging-Header.h b/SessionShareExtension/Meta/SignalShareExtension-Bridging-Header.h index dd11e0e98..b69a7ab21 100644 --- a/SessionShareExtension/Meta/SignalShareExtension-Bridging-Header.h +++ b/SessionShareExtension/Meta/SignalShareExtension-Bridging-Header.h @@ -9,7 +9,6 @@ #import #import #import -#import #import #import #import diff --git a/SessionUIKit/Utilities/UIColor+Utilities.swift b/SessionUIKit/Utilities/UIColor+Utilities.swift index 7f0f4eac5..65843d73c 100644 --- a/SessionUIKit/Utilities/UIColor+Utilities.swift +++ b/SessionUIKit/Utilities/UIColor+Utilities.swift @@ -1,6 +1,7 @@ // Copyright © 2022 Rangeproof Pty Ltd. All rights reserved. import UIKit.UIColor +import SessionUtilitiesKit public extension UIColor { func toImage() -> UIImage { @@ -12,5 +13,28 @@ public extension UIColor { rendererContext.cgContext.fill(bounds) } } + + func blend(with otherColor: UIColor, alpha: CGFloat) -> UIColor { + var r0: CGFloat = 0 + var g0: CGFloat = 0 + var b0: CGFloat = 0 + var a0: CGFloat = 0 + self.getRed(&r0, green: &g0, blue: &b0, alpha: &a0) + + var r1: CGFloat = 0 + var g1: CGFloat = 0 + var b1: CGFloat = 0 + var a1: CGFloat = 0 + self.getRed(&r1, green: &g1, blue: &b1, alpha: &a1) + + let finalAlpha: CGFloat = CGFloatClamp01(alpha) + + return UIColor( + red: CGFloatLerp(r0, r1, finalAlpha), + green: CGFloatLerp(g0, g1, finalAlpha), + blue: CGFloatLerp(b0, b1, finalAlpha), + alpha: CGFloatLerp(a0, a1, finalAlpha) + ) + } } diff --git a/SignalUtilitiesKit/Media Viewing & Editing/Image Editing/ImageEditorPaletteView.swift b/SignalUtilitiesKit/Media Viewing & Editing/Image Editing/ImageEditorPaletteView.swift index d6b96c8ed..a4b015925 100644 --- a/SignalUtilitiesKit/Media Viewing & Editing/Image Editing/ImageEditorPaletteView.swift +++ b/SignalUtilitiesKit/Media Viewing & Editing/Image Editing/ImageEditorPaletteView.swift @@ -31,20 +31,20 @@ public class ImageEditorColor: NSObject { } public class func defaultColor() -> ImageEditorColor { - return ImageEditorColor(color: UIColor(rgbHex: 0xffffff), palettePhase: 0) + return ImageEditorColor(color: .white, palettePhase: 0) } public static var gradientUIColors: [UIColor] { return [ - UIColor(rgbHex: 0xffffff), - UIColor(rgbHex: 0xff0000), - UIColor(rgbHex: 0xff00ff), - UIColor(rgbHex: 0x0000ff), - UIColor(rgbHex: 0x00ffff), - UIColor(rgbHex: 0x00ff00), - UIColor(rgbHex: 0xffff00), - UIColor(rgbHex: 0xff5500), - UIColor(rgbHex: 0x000000) + #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1), // #FFFFFF + #colorLiteral(red: 1, green: 0, blue: 0, alpha: 1), // #FF0000 + #colorLiteral(red: 1, green: 0, blue: 1, alpha: 1), // #FF00FF + #colorLiteral(red: 0, green: 0, blue: 1, alpha: 1), // #0000FF + #colorLiteral(red: 0, green: 1, blue: 1, alpha: 1), // #00FFFF + #colorLiteral(red: 0, green: 1, blue: 0, alpha: 1), // #00FF00 + #colorLiteral(red: 1, green: 1, blue: 0, alpha: 1), // #FFFF00 + #colorLiteral(red: 1, green: 0.3333333333, blue: 0, alpha: 1), // #FF5500 + #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1) // #000000 ] } diff --git a/SignalUtilitiesKit/Meta/SignalUtilitiesKit.h b/SignalUtilitiesKit/Meta/SignalUtilitiesKit.h index b6c04344d..bbaac0073 100644 --- a/SignalUtilitiesKit/Meta/SignalUtilitiesKit.h +++ b/SignalUtilitiesKit/Meta/SignalUtilitiesKit.h @@ -20,4 +20,3 @@ FOUNDATION_EXPORT const unsigned char SignalUtilitiesKitVersionString[]; #import #import #import -#import diff --git a/SignalUtilitiesKit/Utilities/UIColor+OWS.h b/SignalUtilitiesKit/Utilities/UIColor+OWS.h deleted file mode 100644 index 1fd2d698d..000000000 --- a/SignalUtilitiesKit/Utilities/UIColor+OWS.h +++ /dev/null @@ -1,67 +0,0 @@ -// -// Copyright (c) 2018 Open Whisper Systems. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface UIColor (OWS) - -#pragma mark - - -@property (class, readonly, nonatomic) UIColor *ows_systemPrimaryButtonColor; -@property (class, readonly, nonatomic) UIColor *ows_signalBrandBlueColor; -@property (class, readonly, nonatomic) UIColor *ows_materialBlueColor; -@property (class, readonly, nonatomic) UIColor *ows_destructiveRedColor; -@property (class, readonly, nonatomic) UIColor *ows_fadedBlueColor; -@property (class, readonly, nonatomic) UIColor *ows_darkThemeBackgroundColor; -@property (class, readonly, nonatomic) UIColor *ows_darkGrayColor; -@property (class, readonly, nonatomic) UIColor *ows_yellowColor; -@property (class, readonly, nonatomic) UIColor *ows_reminderYellowColor; -@property (class, readonly, nonatomic) UIColor *ows_reminderDarkYellowColor; -@property (class, readonly, nonatomic) UIColor *ows_darkIconColor; -@property (class, readonly, nonatomic) UIColor *ows_errorMessageBorderColor; -@property (class, readonly, nonatomic) UIColor *ows_infoMessageBorderColor; -@property (class, readonly, nonatomic) UIColor *ows_messageBubbleLightGrayColor; - -+ (UIColor *)colorWithRGBHex:(unsigned long)value; - -- (UIColor *)blendWithColor:(UIColor *)otherColor alpha:(CGFloat)alpha; - -#pragma mark - Color Palette - -@property (class, readonly, nonatomic) UIColor *ows_signalBlueColor; -@property (class, readonly, nonatomic) UIColor *ows_greenColor; -@property (class, readonly, nonatomic) UIColor *ows_redColor; - -#pragma mark - GreyScale - -@property (class, readonly, nonatomic) UIColor *ows_whiteColor; -@property (class, readonly, nonatomic) UIColor *ows_gray02Color; -@property (class, readonly, nonatomic) UIColor *ows_gray05Color; -@property (class, readonly, nonatomic) UIColor *ows_gray25Color; -@property (class, readonly, nonatomic) UIColor *ows_gray45Color; -@property (class, readonly, nonatomic) UIColor *ows_gray60Color; -@property (class, readonly, nonatomic) UIColor *ows_gray75Color; -@property (class, readonly, nonatomic) UIColor *ows_gray90Color; -@property (class, readonly, nonatomic) UIColor *ows_gray95Color; -@property (class, readonly, nonatomic) UIColor *ows_blackColor; - -// TODO: Remove -@property (class, readonly, nonatomic) UIColor *ows_darkSkyBlueColor; - -#pragma mark - Loki - -+ (UIColor *)lokiGreen; -+ (UIColor *)lokiDarkGreen; -+ (UIColor *)lokiDarkestGray; -+ (UIColor *)lokiDarkerGray; -+ (UIColor *)lokiDarkGray; -+ (UIColor *)lokiGray; -+ (UIColor *)lokiLightGray; -+ (UIColor *)lokiLightestGray; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SignalUtilitiesKit/Utilities/UIColor+OWS.m b/SignalUtilitiesKit/Utilities/UIColor+OWS.m deleted file mode 100644 index da53d6d1b..000000000 --- a/SignalUtilitiesKit/Utilities/UIColor+OWS.m +++ /dev/null @@ -1,212 +0,0 @@ -// -// Copyright (c) 2019 Open Whisper Systems. All rights reserved. -// - -#import "UIColor+OWS.h" -#import "OWSMath.h" -#import - -NS_ASSUME_NONNULL_BEGIN - -@implementation UIColor (OWS) - -#pragma mark - - -+ (UIColor *)ows_signalBrandBlueColor -{ - return UIColor.lokiGreen; -} - -+ (UIColor *)ows_materialBlueColor -{ - return UIColor.lokiGreen; -} - -+ (UIColor *)ows_darkIconColor -{ - return UIColor.lokiGreen; -} - -+ (UIColor *)ows_darkGrayColor -{ - return UIColor.lokiDarkGray; -} - -+ (UIColor *)ows_darkThemeBackgroundColor -{ - return UIColor.lokiDarkestGray; -} - -+ (UIColor *)ows_fadedBlueColor -{ - // blue: #B6DEF4 - return [UIColor colorWithRed:182.f / 255.f green:222.f / 255.f blue:244.f / 255.f alpha:1.f]; -} - -+ (UIColor *)ows_yellowColor -{ - // gold: #FFBB5C - return [UIColor colorWithRed:245.f / 255.f green:186.f / 255.f blue:98.f / 255.f alpha:1.f]; -} - -+ (UIColor *)ows_reminderYellowColor -{ - return [UIColor colorWithRed:252.f / 255.f green:240.f / 255.f blue:217.f / 255.f alpha:1.f]; -} - -+ (UIColor *)ows_reminderDarkYellowColor -{ - return [UIColor colorWithRGBHex:0xFCDA91]; -} - -+ (UIColor *)ows_destructiveRedColor -{ - return [UIColor colorWithRGBHex:0xF44336]; -} - -+ (UIColor *)ows_errorMessageBorderColor -{ - return [UIColor colorWithRed:195.f / 255.f green:0 blue:22.f / 255.f alpha:1.0f]; -} - -+ (UIColor *)ows_infoMessageBorderColor -{ - return [UIColor colorWithRed:239.f / 255.f green:189.f / 255.f blue:88.f / 255.f alpha:1.0f]; -} - -+ (UIColor *)ows_lightBackgroundColor -{ - return [UIColor colorWithRed:242.f / 255.f green:242.f / 255.f blue:242.f / 255.f alpha:1.f]; -} - -+ (UIColor *)ows_systemPrimaryButtonColor -{ - return UIColor.lokiGreen; -} - -+ (UIColor *)ows_messageBubbleLightGrayColor -{ - return [UIColor colorWithHue:240.0f / 360.0f saturation:0.02f brightness:0.92f alpha:1.0f]; -} - -+ (UIColor *)colorWithRGBHex:(unsigned long)value -{ - CGFloat red = ((value >> 16) & 0xff) / 255.f; - CGFloat green = ((value >> 8) & 0xff) / 255.f; - CGFloat blue = ((value >> 0) & 0xff) / 255.f; - return [UIColor colorWithRed:red green:green blue:blue alpha:1.f]; -} - -- (UIColor *)blendWithColor:(UIColor *)otherColor alpha:(CGFloat)alpha -{ - CGFloat r0, g0, b0, a0; -#ifdef DEBUG - BOOL result = -#endif - [self getRed:&r0 green:&g0 blue:&b0 alpha:&a0]; - OWSAssertDebug(result); - - CGFloat r1, g1, b1, a1; -#ifdef DEBUG - result = -#endif - [otherColor getRed:&r1 green:&g1 blue:&b1 alpha:&a1]; - OWSAssertDebug(result); - - alpha = CGFloatClamp01(alpha); - return [UIColor colorWithRed:CGFloatLerp(r0, r1, alpha) - green:CGFloatLerp(g0, g1, alpha) - blue:CGFloatLerp(b0, b1, alpha) - alpha:CGFloatLerp(a0, a1, alpha)]; -} - -#pragma mark - Color Palette - -+ (UIColor *)ows_signalBlueColor -{ - return [UIColor colorWithRGBHex:0x2090EA]; -} - -+ (UIColor *)ows_greenColor -{ - return [UIColor colorWithRGBHex:0x4caf50]; -} - -+ (UIColor *)ows_redColor -{ - return [UIColor colorWithRGBHex:0xf44336]; -} - -#pragma mark - GreyScale - -+ (UIColor *)ows_whiteColor -{ - return [UIColor colorWithRGBHex:0xFFFFFF]; -} - -+ (UIColor *)ows_gray02Color -{ - return [UIColor colorWithRGBHex:0xF8F9F9]; -} - -+ (UIColor *)ows_gray05Color -{ - return [UIColor colorWithRGBHex:0xEEEFEF]; -} - -+ (UIColor *)ows_gray25Color -{ - return [UIColor colorWithRGBHex:0xBBBDBE]; -} - -+ (UIColor *)ows_gray45Color -{ - return [UIColor colorWithRGBHex:0x898A8C]; -} - -+ (UIColor *)ows_gray60Color -{ - return [UIColor colorWithRGBHex:0x636467]; -} - -+ (UIColor *)ows_gray75Color -{ - return [UIColor colorWithRGBHex:0x3D3E44]; -} - -+ (UIColor *)ows_gray90Color -{ - return [UIColor colorWithRGBHex:0x17191D]; -} - -+ (UIColor *)ows_gray95Color -{ - return [UIColor colorWithRGBHex:0x0F1012]; -} - -+ (UIColor *)ows_blackColor -{ - return [UIColor colorWithRGBHex:0x000000]; -} - -// TODO: Remove -+ (UIColor *)ows_darkSkyBlueColor -{ - // HEX 0xc2090EA - return [UIColor colorWithRed:32.f / 255.f green:144.f / 255.f blue:234.f / 255.f alpha:1.f]; -} - -#pragma mark - Loki - -+ (UIColor *)lokiGreen { return [UIColor colorWithRGBHex:0x78BE20]; } -+ (UIColor *)lokiDarkGreen { return [UIColor colorWithRGBHex:0x419B41]; } -+ (UIColor *)lokiDarkestGray { return [UIColor colorWithRGBHex:0x0A0A0A]; } -+ (UIColor *)lokiDarkerGray { return [UIColor colorWithRGBHex:0x252525]; } -+ (UIColor *)lokiDarkGray { return [UIColor colorWithRGBHex:0x313131]; } -+ (UIColor *)lokiGray { return [UIColor colorWithRGBHex:0x363636]; } -+ (UIColor *)lokiLightGray { return [UIColor colorWithRGBHex:0x414141]; } -+ (UIColor *)lokiLightestGray { return [UIColor colorWithRGBHex:0x818181]; } - -@end - -NS_ASSUME_NONNULL_END