Merge branch 'release/0.7.4'

This commit is contained in:
CMK 2021-06-24 10:25:44 +08:00
commit e364e9edf1
35 changed files with 823 additions and 759 deletions

View File

@ -121,9 +121,8 @@
"user_replied_to": "Replied to %s", "user_replied_to": "Replied to %s",
"show_post": "Show Post", "show_post": "Show Post",
"show_user_profile": "Show user profile", "show_user_profile": "Show user profile",
"content_warning": "content warning", "content_warning": "Content Warning",
"content_warning_text": "cw: %s", "media_content_warning": "Tap anywhere to reveal",
"media_content_warning": "Tap to reveal that may be sensitive",
"poll": { "poll": {
"vote": "Vote", "vote": "Vote",
"vote_count": { "vote_count": {

View File

@ -192,6 +192,7 @@
DB040ED126538E3D00BEE9D8 /* Trie.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB040ED026538E3C00BEE9D8 /* Trie.swift */; }; DB040ED126538E3D00BEE9D8 /* Trie.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB040ED026538E3C00BEE9D8 /* Trie.swift */; };
DB084B5725CBC56C00F898ED /* Status.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB084B5625CBC56C00F898ED /* Status.swift */; }; DB084B5725CBC56C00F898ED /* Status.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB084B5625CBC56C00F898ED /* Status.swift */; };
DB0AC6FC25CD02E600D75117 /* APIService+Instance.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB0AC6FB25CD02E600D75117 /* APIService+Instance.swift */; }; DB0AC6FC25CD02E600D75117 /* APIService+Instance.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB0AC6FB25CD02E600D75117 /* APIService+Instance.swift */; };
DB0E2D2E26833FF700865C3C /* NukeFLAnimatedImagePlugin in Frameworks */ = {isa = PBXBuildFile; productRef = DB0E2D2D26833FF700865C3C /* NukeFLAnimatedImagePlugin */; };
DB0F8150264D1E2500F2A12B /* PickServerLoaderTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB0F814F264D1E2500F2A12B /* PickServerLoaderTableViewCell.swift */; }; DB0F8150264D1E2500F2A12B /* PickServerLoaderTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB0F814F264D1E2500F2A12B /* PickServerLoaderTableViewCell.swift */; };
DB118A8225E4B6E600FAB162 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DB118A8125E4B6E600FAB162 /* Preview Assets.xcassets */; }; DB118A8225E4B6E600FAB162 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DB118A8125E4B6E600FAB162 /* Preview Assets.xcassets */; };
DB118A8C25E4BFB500FAB162 /* HighlightDimmableButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB118A8B25E4BFB500FAB162 /* HighlightDimmableButton.swift */; }; DB118A8C25E4BFB500FAB162 /* HighlightDimmableButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB118A8B25E4BFB500FAB162 /* HighlightDimmableButton.swift */; };
@ -489,6 +490,7 @@
DBE54ABF2636C889004E7C0B /* UserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB6D1B23263684C600ACB481 /* UserDefaults.swift */; }; DBE54ABF2636C889004E7C0B /* UserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB6D1B23263684C600ACB481 /* UserDefaults.swift */; };
DBE54AC62636C89F004E7C0B /* NotificationPreference.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBE54AC52636C89F004E7C0B /* NotificationPreference.swift */; }; DBE54AC62636C89F004E7C0B /* NotificationPreference.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBE54AC52636C89F004E7C0B /* NotificationPreference.swift */; };
DBE54ACC2636C8FD004E7C0B /* NotificationPreference.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBE54AC52636C89F004E7C0B /* NotificationPreference.swift */; }; DBE54ACC2636C8FD004E7C0B /* NotificationPreference.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBE54AC52636C89F004E7C0B /* NotificationPreference.swift */; };
DBF7A0FC26830C33004176A2 /* FPSIndicator in Frameworks */ = {isa = PBXBuildFile; productRef = DBF7A0FB26830C33004176A2 /* FPSIndicator */; };
DBF8AE16263293E400C9C23C /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBF8AE15263293E400C9C23C /* NotificationService.swift */; }; DBF8AE16263293E400C9C23C /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBF8AE15263293E400C9C23C /* NotificationService.swift */; };
DBF8AE1A263293E400C9C23C /* NotificationService.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = DBF8AE13263293E400C9C23C /* NotificationService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; DBF8AE1A263293E400C9C23C /* NotificationService.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = DBF8AE13263293E400C9C23C /* NotificationService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
DBF96326262EC0A6001D8D25 /* AuthenticationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBF96325262EC0A6001D8D25 /* AuthenticationServices.framework */; }; DBF96326262EC0A6001D8D25 /* AuthenticationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBF96325262EC0A6001D8D25 /* AuthenticationServices.framework */; };
@ -1126,6 +1128,7 @@
DB5086B825CC0D6400C2C187 /* Kingfisher in Frameworks */, DB5086B825CC0D6400C2C187 /* Kingfisher in Frameworks */,
DBF96326262EC0A6001D8D25 /* AuthenticationServices.framework in Frameworks */, DBF96326262EC0A6001D8D25 /* AuthenticationServices.framework in Frameworks */,
DBAC6483267D0B21007FE9FD /* DifferenceKit in Frameworks */, DBAC6483267D0B21007FE9FD /* DifferenceKit in Frameworks */,
DB0E2D2E26833FF700865C3C /* NukeFLAnimatedImagePlugin in Frameworks */,
2D61336925C18A4F00CAE157 /* AlamofireNetworkActivityIndicator in Frameworks */, 2D61336925C18A4F00CAE157 /* AlamofireNetworkActivityIndicator in Frameworks */,
DBAC64A1267E6D02007FE9FD /* Fuzi in Frameworks */, DBAC64A1267E6D02007FE9FD /* Fuzi in Frameworks */,
DB3D0FF325BAA61700EAA174 /* AlamofireImage in Frameworks */, DB3D0FF325BAA61700EAA174 /* AlamofireImage in Frameworks */,
@ -1133,6 +1136,7 @@
2D5981BA25E4D7F8000FB903 /* ThirdPartyMailer in Frameworks */, 2D5981BA25E4D7F8000FB903 /* ThirdPartyMailer in Frameworks */,
87FFDA5D898A5C42ADCB35E7 /* Pods_Mastodon.framework in Frameworks */, 87FFDA5D898A5C42ADCB35E7 /* Pods_Mastodon.framework in Frameworks */,
DB6804C82637CE2F00430867 /* AppShared.framework in Frameworks */, DB6804C82637CE2F00430867 /* AppShared.framework in Frameworks */,
DBF7A0FC26830C33004176A2 /* FPSIndicator in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -2644,6 +2648,8 @@
DBAC6482267D0B21007FE9FD /* DifferenceKit */, DBAC6482267D0B21007FE9FD /* DifferenceKit */,
DBAC649D267DFE43007FE9FD /* DiffableDataSources */, DBAC649D267DFE43007FE9FD /* DiffableDataSources */,
DBAC64A0267E6D02007FE9FD /* Fuzi */, DBAC64A0267E6D02007FE9FD /* Fuzi */,
DBF7A0FB26830C33004176A2 /* FPSIndicator */,
DB0E2D2D26833FF700865C3C /* NukeFLAnimatedImagePlugin */,
); );
productName = Mastodon; productName = Mastodon;
productReference = DB427DD225BAA00100D1B89D /* Mastodon.app */; productReference = DB427DD225BAA00100D1B89D /* Mastodon.app */;
@ -2835,6 +2841,8 @@
DBAC6481267D0B21007FE9FD /* XCRemoteSwiftPackageReference "DifferenceKit" */, DBAC6481267D0B21007FE9FD /* XCRemoteSwiftPackageReference "DifferenceKit" */,
DBAC649C267DFE43007FE9FD /* XCRemoteSwiftPackageReference "DiffableDataSources" */, DBAC649C267DFE43007FE9FD /* XCRemoteSwiftPackageReference "DiffableDataSources" */,
DBAC649F267E6D01007FE9FD /* XCRemoteSwiftPackageReference "Fuzi" */, DBAC649F267E6D01007FE9FD /* XCRemoteSwiftPackageReference "Fuzi" */,
DBF7A0FA26830C33004176A2 /* XCRemoteSwiftPackageReference "FPSIndicator" */,
DB0E2D2C26833FF600865C3C /* XCRemoteSwiftPackageReference "Nuke-FLAnimatedImage-Plugin" */,
); );
productRefGroup = DB427DD325BAA00100D1B89D /* Products */; productRefGroup = DB427DD325BAA00100D1B89D /* Products */;
projectDirPath = ""; projectDirPath = "";
@ -3788,7 +3796,7 @@
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements; CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 18; CURRENT_PROJECT_VERSION = 20;
DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets"; DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets";
DEVELOPMENT_TEAM = 5Z4GVSS33P; DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = Mastodon/Info.plist; INFOPLIST_FILE = Mastodon/Info.plist;
@ -3796,7 +3804,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 0.7.2; MARKETING_VERSION = 0.7.4;
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -3815,7 +3823,7 @@
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements; CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 18; CURRENT_PROJECT_VERSION = 20;
DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets"; DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets";
DEVELOPMENT_TEAM = 5Z4GVSS33P; DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = Mastodon/Info.plist; INFOPLIST_FILE = Mastodon/Info.plist;
@ -3823,7 +3831,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 0.7.2; MARKETING_VERSION = 0.7.4;
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -4143,7 +4151,7 @@
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements; CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 18; CURRENT_PROJECT_VERSION = 20;
DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets"; DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets";
DEVELOPMENT_TEAM = 5Z4GVSS33P; DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = Mastodon/Info.plist; INFOPLIST_FILE = Mastodon/Info.plist;
@ -4151,7 +4159,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 0.7.2; MARKETING_VERSION = 0.7.4;
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -4257,7 +4265,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements; CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 18; CURRENT_PROJECT_VERSION = 20;
DEVELOPMENT_TEAM = 5Z4GVSS33P; DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = NotificationService/Info.plist; INFOPLIST_FILE = NotificationService/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
@ -4265,7 +4273,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@executable_path/../../Frameworks", "@executable_path/../../Frameworks",
); );
MARKETING_VERSION = 0.7.2; MARKETING_VERSION = 0.7.4;
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
@ -4376,7 +4384,7 @@
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements; CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 18; CURRENT_PROJECT_VERSION = 20;
DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets"; DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets";
DEVELOPMENT_TEAM = 5Z4GVSS33P; DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = Mastodon/Info.plist; INFOPLIST_FILE = Mastodon/Info.plist;
@ -4384,7 +4392,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 0.7.2; MARKETING_VERSION = 0.7.4;
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -4490,7 +4498,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements; CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 18; CURRENT_PROJECT_VERSION = 20;
DEVELOPMENT_TEAM = 5Z4GVSS33P; DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = NotificationService/Info.plist; INFOPLIST_FILE = NotificationService/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
@ -4498,7 +4506,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@executable_path/../../Frameworks", "@executable_path/../../Frameworks",
); );
MARKETING_VERSION = 0.7.2; MARKETING_VERSION = 0.7.4;
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
@ -4544,7 +4552,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements; CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 18; CURRENT_PROJECT_VERSION = 20;
DEVELOPMENT_TEAM = 5Z4GVSS33P; DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = NotificationService/Info.plist; INFOPLIST_FILE = NotificationService/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
@ -4552,7 +4560,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@executable_path/../../Frameworks", "@executable_path/../../Frameworks",
); );
MARKETING_VERSION = 0.7.2; MARKETING_VERSION = 0.7.4;
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
@ -4567,7 +4575,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements; CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 18; CURRENT_PROJECT_VERSION = 20;
DEVELOPMENT_TEAM = 5Z4GVSS33P; DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = NotificationService/Info.plist; INFOPLIST_FILE = NotificationService/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
@ -4575,7 +4583,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@executable_path/../../Frameworks", "@executable_path/../../Frameworks",
); );
MARKETING_VERSION = 0.7.2; MARKETING_VERSION = 0.7.4;
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
@ -4718,6 +4726,14 @@
minimumVersion = 0.1.1; minimumVersion = 0.1.1;
}; };
}; };
DB0E2D2C26833FF600865C3C /* XCRemoteSwiftPackageReference "Nuke-FLAnimatedImage-Plugin" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/kean/Nuke-FLAnimatedImage-Plugin.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 8.0.0;
};
};
DB3D0FF125BAA61700EAA174 /* XCRemoteSwiftPackageReference "AlamofireImage" */ = { DB3D0FF125BAA61700EAA174 /* XCRemoteSwiftPackageReference "AlamofireImage" */ = {
isa = XCRemoteSwiftPackageReference; isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Alamofire/AlamofireImage.git"; repositoryURL = "https://github.com/Alamofire/AlamofireImage.git";
@ -4798,6 +4814,14 @@
minimumVersion = 2.11.0; minimumVersion = 2.11.0;
}; };
}; };
DBF7A0FA26830C33004176A2 /* XCRemoteSwiftPackageReference "FPSIndicator" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/MainasuK/FPSIndicator.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */ /* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */ /* Begin XCSwiftPackageProductDependency section */
@ -4835,6 +4859,11 @@
package = DB0140BB25C40D7500F9F3CF /* XCRemoteSwiftPackageReference "CommonOSLog" */; package = DB0140BB25C40D7500F9F3CF /* XCRemoteSwiftPackageReference "CommonOSLog" */;
productName = CommonOSLog; productName = CommonOSLog;
}; };
DB0E2D2D26833FF700865C3C /* NukeFLAnimatedImagePlugin */ = {
isa = XCSwiftPackageProductDependency;
package = DB0E2D2C26833FF600865C3C /* XCRemoteSwiftPackageReference "Nuke-FLAnimatedImage-Plugin" */;
productName = NukeFLAnimatedImagePlugin;
};
DB3D0FF225BAA61700EAA174 /* AlamofireImage */ = { DB3D0FF225BAA61700EAA174 /* AlamofireImage */ = {
isa = XCSwiftPackageProductDependency; isa = XCSwiftPackageProductDependency;
package = DB3D0FF125BAA61700EAA174 /* XCRemoteSwiftPackageReference "AlamofireImage" */; package = DB3D0FF125BAA61700EAA174 /* XCRemoteSwiftPackageReference "AlamofireImage" */;
@ -4890,6 +4919,11 @@
package = DBB525062611EAC0002F1F29 /* XCRemoteSwiftPackageReference "Tabman" */; package = DBB525062611EAC0002F1F29 /* XCRemoteSwiftPackageReference "Tabman" */;
productName = Tabman; productName = Tabman;
}; };
DBF7A0FB26830C33004176A2 /* FPSIndicator */ = {
isa = XCSwiftPackageProductDependency;
package = DBF7A0FA26830C33004176A2 /* XCRemoteSwiftPackageReference "FPSIndicator" */;
productName = FPSIndicator;
};
/* End XCSwiftPackageProductDependency section */ /* End XCSwiftPackageProductDependency section */
/* Begin XCVersionGroup section */ /* Begin XCVersionGroup section */

View File

@ -7,7 +7,7 @@
<key>AppShared.xcscheme_^#shared#^_</key> <key>AppShared.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>14</integer> <integer>26</integer>
</dict> </dict>
<key>CoreDataStack.xcscheme_^#shared#^_</key> <key>CoreDataStack.xcscheme_^#shared#^_</key>
<dict> <dict>
@ -17,7 +17,7 @@
<key>Mastodon - ASDK.xcscheme_^#shared#^_</key> <key>Mastodon - ASDK.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>3</integer> <integer>1</integer>
</dict> </dict>
<key>Mastodon - RTL.xcscheme_^#shared#^_</key> <key>Mastodon - RTL.xcscheme_^#shared#^_</key>
<dict> <dict>
@ -32,12 +32,12 @@
<key>Mastodon.xcscheme_^#shared#^_</key> <key>Mastodon.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>2</integer> <integer>0</integer>
</dict> </dict>
<key>NotificationService.xcscheme_^#shared#^_</key> <key>NotificationService.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>22</integer> <integer>2</integer>
</dict> </dict>
</dict> </dict>
<key>SuppressBuildableAutocreation</key> <key>SuppressBuildableAutocreation</key>

View File

@ -64,6 +64,24 @@
"version": "1.2.0" "version": "1.2.0"
} }
}, },
{
"package": "FLAnimatedImage",
"repositoryURL": "https://github.com/Flipboard/FLAnimatedImage",
"state": {
"branch": null,
"revision": "e7f9fd4681ae41bf6f3056db08af4f401d61da52",
"version": "1.0.16"
}
},
{
"package": "FPSIndicator",
"repositoryURL": "https://github.com/MainasuK/FPSIndicator.git",
"state": {
"branch": null,
"revision": "b2a002d689c400485f2ba41f9e71e15f7b99764a",
"version": "1.0.1"
}
},
{ {
"package": "Fuzi", "package": "Fuzi",
"repositoryURL": "https://github.com/cezheng/Fuzi.git", "repositoryURL": "https://github.com/cezheng/Fuzi.git",
@ -100,6 +118,15 @@
"version": "10.3.0" "version": "10.3.0"
} }
}, },
{
"package": "NukeFLAnimatedImagePlugin",
"repositoryURL": "https://github.com/kean/Nuke-FLAnimatedImage-Plugin.git",
"state": {
"branch": null,
"revision": "b59c346a7d536336db3b0f12c72c6e53ee709e16",
"version": "8.0.0"
}
},
{ {
"package": "Pageboy", "package": "Pageboy",
"repositoryURL": "https://github.com/uias/Pageboy", "repositoryURL": "https://github.com/uias/Pageboy",

View File

@ -42,7 +42,13 @@ extension Item {
class StatusAttribute { class StatusAttribute {
var isSeparatorLineHidden: Bool var isSeparatorLineHidden: Bool
/// is media loaded or not
let isImageLoaded = CurrentValueSubject<Bool, Never>(false) let isImageLoaded = CurrentValueSubject<Bool, Never>(false)
/// flag for current sensitive content reveal state
///
/// - true: displaying sensitive content
/// - false: displaying content warning overlay
let isRevealing = CurrentValueSubject<Bool, Never>(false) let isRevealing = CurrentValueSubject<Bool, Never>(false)
init(isSeparatorLineHidden: Bool = false) { init(isSeparatorLineHidden: Bool = false) {

View File

@ -52,9 +52,9 @@ extension NotificationSection {
let frame = CGRect(x: 0, y: 0, width: tableView.readableContentGuide.layoutFrame.width - NotificationStatusTableViewCell.statusPadding.left - NotificationStatusTableViewCell.statusPadding.right, height: tableView.readableContentGuide.layoutFrame.height) let frame = CGRect(x: 0, y: 0, width: tableView.readableContentGuide.layoutFrame.width - NotificationStatusTableViewCell.statusPadding.left - NotificationStatusTableViewCell.statusPadding.right, height: tableView.readableContentGuide.layoutFrame.height)
StatusSection.configure( StatusSection.configure(
cell: cell, cell: cell,
tableView: tableView,
dependency: dependency, dependency: dependency,
readableLayoutFrame: frame, readableLayoutFrame: frame,
timestampUpdatePublisher: timestampUpdatePublisher,
status: status, status: status,
requestUserID: requestUserID, requestUserID: requestUserID,
statusItemAttribute: attribute statusItemAttribute: attribute

View File

@ -41,9 +41,9 @@ extension ReportSection {
let status = managedObjectContext.object(with: objectID) as! Status let status = managedObjectContext.object(with: objectID) as! Status
StatusSection.configure( StatusSection.configure(
cell: cell, cell: cell,
tableView: tableView,
dependency: dependency, dependency: dependency,
readableLayoutFrame: tableView.readableContentGuide.layoutFrame, readableLayoutFrame: tableView.readableContentGuide.layoutFrame,
timestampUpdatePublisher: timestampUpdatePublisher,
status: status, status: status,
requestUserID: requestUserID, requestUserID: requestUserID,
statusItemAttribute: attribute statusItemAttribute: attribute

File diff suppressed because it is too large Load Diff

View File

@ -29,9 +29,6 @@ extension ActiveLabel {
hashtagColor = Asset.Colors.brandBlue.color hashtagColor = Asset.Colors.brandBlue.color
URLColor = Asset.Colors.brandBlue.color URLColor = Asset.Colors.brandBlue.color
emojiPlaceholderColor = .systemFill emojiPlaceholderColor = .systemFill
#if DEBUG
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
#endif
accessibilityContainerType = .semanticGroup accessibilityContainerType = .semanticGroup

View File

@ -22,7 +22,7 @@ extension UIView {
} }
// MARK: - Convinience view appearance modification method // MARK: - Convenience view appearance modification method
extension UIView { extension UIView {
@discardableResult @discardableResult
func applyCornerRadius(radius: CGFloat) -> Self { func applyCornerRadius(radius: CGFloat) -> Self {

View File

@ -58,6 +58,9 @@ internal enum Asset {
internal static let disabled = ColorAsset(name: "Colors/Button/disabled") internal static let disabled = ColorAsset(name: "Colors/Button/disabled")
internal static let inactive = ColorAsset(name: "Colors/Button/inactive") internal static let inactive = ColorAsset(name: "Colors/Button/inactive")
} }
internal enum ContentWarningOverlay {
internal static let background = ColorAsset(name: "Colors/ContentWarningOverlay/background")
}
internal enum Icon { internal enum Icon {
internal static let plus = ColorAsset(name: "Colors/Icon/plus") internal static let plus = ColorAsset(name: "Colors/Icon/plus")
} }

View File

@ -254,13 +254,9 @@ internal enum L10n {
} }
} }
internal enum Status { internal enum Status {
/// content warning /// Content Warning
internal static let contentWarning = L10n.tr("Localizable", "Common.Controls.Status.ContentWarning") internal static let contentWarning = L10n.tr("Localizable", "Common.Controls.Status.ContentWarning")
/// cw: %@ /// Tap anywhere to reveal
internal static func contentWarningText(_ p1: Any) -> String {
return L10n.tr("Localizable", "Common.Controls.Status.ContentWarningText", String(describing: p1))
}
/// Tap to reveal that may be sensitive
internal static let mediaContentWarning = L10n.tr("Localizable", "Common.Controls.Status.MediaContentWarning") internal static let mediaContentWarning = L10n.tr("Localizable", "Common.Controls.Status.MediaContentWarning")
/// Show Post /// Show Post
internal static let showPost = L10n.tr("Localizable", "Common.Controls.Status.ShowPost") internal static let showPost = L10n.tr("Localizable", "Common.Controls.Status.ShowPost")

View File

@ -7,7 +7,8 @@
import UIKit import UIKit
import AlamofireImage import AlamofireImage
import Kingfisher import FLAnimatedImage
import Nuke
protocol AvatarConfigurableView { protocol AvatarConfigurableView {
static var configurableAvatarImageSize: CGSize { get } static var configurableAvatarImageSize: CGSize { get }
@ -32,12 +33,6 @@ extension AvatarConfigurableView {
return placeholderImage return placeholderImage
}() }()
// cancel previous task
configurableAvatarImageView?.af.cancelImageRequest()
configurableAvatarImageView?.kf.cancelDownloadTask()
configurableAvatarButton?.af.cancelImageRequest(for: .normal)
configurableAvatarButton?.kf.cancelImageDownloadTask()
// reset layer attributes // reset layer attributes
configurableAvatarImageView?.layer.masksToBounds = false configurableAvatarImageView?.layer.masksToBounds = false
configurableAvatarImageView?.layer.cornerRadius = 0 configurableAvatarImageView?.layer.cornerRadius = 0
@ -55,85 +50,50 @@ extension AvatarConfigurableView {
avatarConfigurableView(self, didFinishConfiguration: configuration) avatarConfigurableView(self, didFinishConfiguration: configuration)
} }
let filter = ScaledToSizeWithRoundedCornersFilter( guard let imageDisplayingView: ImageDisplayingView = configurableAvatarImageView ?? configurableAvatarButton?.imageView else {
size: Self.configurableAvatarImageSize,
radius: configuration.keepImageCorner ? 0 : Self.configurableAvatarImageCornerRadius
)
// set placeholder if no asset
guard let avatarImageURL = configuration.avatarImageURL else {
configurableAvatarImageView?.image = placeholderImage
configurableAvatarImageView?.layer.masksToBounds = true
configurableAvatarImageView?.layer.cornerRadius = Self.configurableAvatarImageCornerRadius
configurableAvatarImageView?.layer.cornerCurve = Self.configurableAvatarImageCornerRadius < Self.configurableAvatarImageSize.width * 0.5 ? .continuous :.circular
configurableAvatarButton?.setImage(placeholderImage, for: .normal)
configurableAvatarButton?.layer.masksToBounds = true
configurableAvatarButton?.layer.cornerRadius = Self.configurableAvatarImageCornerRadius
configurableAvatarButton?.layer.cornerCurve = Self.configurableAvatarImageCornerRadius < Self.configurableAvatarImageSize.width * 0.5 ? .continuous :.circular
return return
} }
if let avatarImageView = configurableAvatarImageView { // set corner radius (due to GIF won't crop)
// set avatar (GIF using Kingfisher) imageDisplayingView.layer.masksToBounds = true
switch avatarImageURL.pathExtension { imageDisplayingView.layer.cornerRadius = Self.configurableAvatarImageCornerRadius
case "gif": imageDisplayingView.layer.cornerCurve = Self.configurableAvatarImageCornerRadius < Self.configurableAvatarImageSize.width * 0.5 ? .continuous :.circular
avatarImageView.kf.setImage(
with: avatarImageURL,
placeholder: placeholderImage,
options: [
.transition(.fade(0.2))
]
)
avatarImageView.layer.masksToBounds = true
avatarImageView.layer.cornerRadius = Self.configurableAvatarImageCornerRadius
avatarImageView.layer.cornerCurve = Self.configurableAvatarImageCornerRadius < Self.configurableAvatarImageSize.width * 0.5 ? .continuous :.circular
default: // set border
avatarImageView.af.setImage( configureLayerBorder(view: imageDisplayingView, configuration: configuration)
withURL: avatarImageURL,
placeholderImage: placeholderImage,
filter: filter,
imageTransition: .crossDissolve(0.3),
runImageTransitionIfCached: false,
completion: nil
)
if Self.configurableAvatarImageCornerRadius > 0, configuration.keepImageCorner {
configurableAvatarImageView?.layer.masksToBounds = true // set image
configurableAvatarImageView?.layer.cornerRadius = Self.configurableAvatarImageCornerRadius let url = configuration.avatarImageURL
configurableAvatarImageView?.layer.cornerCurve = Self.configurableAvatarImageCornerRadius < Self.configurableAvatarImageSize.width * 0.5 ? .continuous :.circular let processors: [ImageProcessing] = [
} ImageProcessors.Resize(
size: Self.configurableAvatarImageSize,
unit: .points,
contentMode: .aspectFill,
crop: false
),
ImageProcessors.RoundedCorners(
radius: Self.configurableAvatarImageCornerRadius
)
]
let request = ImageRequest(url: url, processors: processors)
let options = ImageLoadingOptions(
placeholder: placeholderImage,
transition: .fadeIn(duration: 0.2)
)
Nuke.loadImage(
with: request,
options: options,
into: imageDisplayingView
) { result in
switch result {
case .failure:
break
case .success:
break
} }
configureLayerBorder(view: avatarImageView, configuration: configuration)
}
if let avatarButton = configurableAvatarButton {
switch avatarImageURL.pathExtension {
case "gif":
avatarButton.kf.setImage(
with: avatarImageURL,
for: .normal,
placeholder: placeholderImage,
options: [
.transition(.fade(0.2))
]
)
avatarButton.layer.masksToBounds = true
avatarButton.layer.cornerRadius = Self.configurableAvatarImageCornerRadius
avatarButton.layer.cornerCurve = Self.configurableAvatarImageCornerRadius < Self.configurableAvatarImageSize.width * 0.5 ? .continuous : .circular
default:
avatarButton.af.setImage(
for: .normal,
url: avatarImageURL,
placeholderImage: placeholderImage,
filter: filter,
completion: nil
)
}
configureLayerBorder(view: avatarButton, configuration: configuration)
} }
} }

View File

@ -20,7 +20,7 @@ extension StatusTableViewCellDelegate where Self: StatusProvider {
StatusProviderFacade.coordinateToStatusAuthorProfileScene(for: .secondary, provider: self, cell: cell) StatusProviderFacade.coordinateToStatusAuthorProfileScene(for: .secondary, provider: self, cell: cell)
} }
func statusTableViewCell(_ cell: StatusTableViewCell, statusView: StatusView, avatarButtonDidPressed button: UIButton) { func statusTableViewCell(_ cell: StatusTableViewCell, statusView: StatusView, avatarImageViewDidPressed imageView: UIImageView) {
StatusProviderFacade.coordinateToStatusAuthorProfileScene(for: .primary, provider: self, cell: cell) StatusProviderFacade.coordinateToStatusAuthorProfileScene(for: .primary, provider: self, cell: cell)
} }

View File

@ -66,6 +66,7 @@ extension StatusTableViewCellDelegate where Self: StatusProvider {
.store(in: &disposeBag) .store(in: &disposeBag)
status(for: cell, indexPath: indexPath) status(for: cell, indexPath: indexPath)
.receive(on: RunLoop.main)
.sink { [weak self] status in .sink { [weak self] status in
guard let self = self else { return } guard let self = self else { return }
let status = status?.reblog ?? status let status = status?.reblog ?? status

View File

@ -541,8 +541,9 @@ extension StatusProviderFacade {
.compactMap { [weak dependency] status -> AnyPublisher<Status?, Never>? in .compactMap { [weak dependency] status -> AnyPublisher<Status?, Never>? in
guard let dependency = dependency else { return nil } guard let dependency = dependency else { return nil }
guard let _status = status else { return nil } guard let _status = status else { return nil }
return dependency.context.managedObjectContext.performChanges { let managedObjectContext = dependency.context.backgroundManagedObjectContext
guard let status = dependency.context.managedObjectContext.object(with: _status.objectID) as? Status else { return } return managedObjectContext.performChanges {
guard let status = managedObjectContext.object(with: _status.objectID) as? Status else { return }
let appStartUpTimestamp = dependency.context.documentStore.appStartUpTimestamp let appStartUpTimestamp = dependency.context.documentStore.appStartUpTimestamp
let isRevealing: Bool = { let isRevealing: Bool = {
if dependency.context.documentStore.defaultRevealStatusDict[status.id] == true { if dependency.context.documentStore.defaultRevealStatusDict[status.id] == true {
@ -560,7 +561,11 @@ extension StatusProviderFacade {
// toggle reveal // toggle reveal
dependency.context.documentStore.defaultRevealStatusDict[status.id] = false dependency.context.documentStore.defaultRevealStatusDict[status.id] = false
status.update(isReveal: !isRevealing) status.update(isReveal: !isRevealing)
status.reblog?.update(isReveal: !isRevealing)
if let reblog = status.reblog {
dependency.context.documentStore.defaultRevealStatusDict[reblog.id] = false
reblog.update(isReveal: !isRevealing)
}
// pause video playback if isRevealing before toggle // pause video playback if isRevealing before toggle
if isRevealing, let attachment = (status.reblog ?? status).mediaAttachments?.first, if isRevealing, let attachment = (status.reblog ?? status).mediaAttachments?.first,

View File

@ -0,0 +1,9 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"provides-namespace" : true
}
}

View File

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "235",
"green" : "229",
"red" : "221"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.922",
"green" : "0.898",
"red" : "0.867"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -94,9 +94,8 @@ Please check your internet connection.";
"Common.Controls.Status.Actions.Reply" = "Reply"; "Common.Controls.Status.Actions.Reply" = "Reply";
"Common.Controls.Status.Actions.Unfavorite" = "Unfavorite"; "Common.Controls.Status.Actions.Unfavorite" = "Unfavorite";
"Common.Controls.Status.Actions.Unreblog" = "Unreblog"; "Common.Controls.Status.Actions.Unreblog" = "Unreblog";
"Common.Controls.Status.ContentWarning" = "content warning"; "Common.Controls.Status.ContentWarning" = "Content Warning";
"Common.Controls.Status.ContentWarningText" = "cw: %@"; "Common.Controls.Status.MediaContentWarning" = "Tap anywhere to reveal";
"Common.Controls.Status.MediaContentWarning" = "Tap to reveal that may be sensitive";
"Common.Controls.Status.Poll.Closed" = "Closed"; "Common.Controls.Status.Poll.Closed" = "Closed";
"Common.Controls.Status.Poll.TimeLeft" = "%@ left"; "Common.Controls.Status.Poll.TimeLeft" = "%@ left";
"Common.Controls.Status.Poll.Vote" = "Vote"; "Common.Controls.Status.Poll.Vote" = "Vote";

View File

@ -94,9 +94,8 @@ Please check your internet connection.";
"Common.Controls.Status.Actions.Reply" = "Reply"; "Common.Controls.Status.Actions.Reply" = "Reply";
"Common.Controls.Status.Actions.Unfavorite" = "Unfavorite"; "Common.Controls.Status.Actions.Unfavorite" = "Unfavorite";
"Common.Controls.Status.Actions.Unreblog" = "Unreblog"; "Common.Controls.Status.Actions.Unreblog" = "Unreblog";
"Common.Controls.Status.ContentWarning" = "content warning"; "Common.Controls.Status.ContentWarning" = "Content Warning";
"Common.Controls.Status.ContentWarningText" = "cw: %@"; "Common.Controls.Status.MediaContentWarning" = "Tap anywhere to reveal";
"Common.Controls.Status.MediaContentWarning" = "Tap to reveal that may be sensitive";
"Common.Controls.Status.Poll.Closed" = "Closed"; "Common.Controls.Status.Poll.Closed" = "Closed";
"Common.Controls.Status.Poll.TimeLeft" = "%@ left"; "Common.Controls.Status.Poll.TimeLeft" = "%@ left";
"Common.Controls.Status.Poll.Vote" = "Vote"; "Common.Controls.Status.Poll.Vote" = "Vote";

View File

@ -10,10 +10,6 @@ import UIKit
import Combine import Combine
import SafariServices import SafariServices
#if DEBUG
import GDPerformanceView_Swift
#endif
class MainTabBarController: UITabBarController { class MainTabBarController: UITabBarController {
var disposeBag = Set<AnyCancellable>() var disposeBag = Set<AnyCancellable>()
@ -190,14 +186,6 @@ extension MainTabBarController {
.store(in: &disposeBag) .store(in: &disposeBag)
} }
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
#if DEBUG
PerformanceMonitor.shared().start()
#endif
}
} }
extension MainTabBarController { extension MainTabBarController {

View File

@ -105,15 +105,6 @@ final class NotificationStatusTableViewCell: UITableViewCell, StatusCell {
configure() configure()
} }
override func layoutSubviews() {
super.layoutSubviews()
// precondition: app is active
guard UIApplication.shared.applicationState == .active else { return }
DispatchQueue.main.async {
self.statusView.drawContentWarningImageView()
}
}
} }
extension NotificationStatusTableViewCell { extension NotificationStatusTableViewCell {
@ -232,31 +223,16 @@ extension NotificationStatusTableViewCell {
actionImageBackground.layer.borderColor = Asset.Colors.Background.systemBackground.color.cgColor actionImageBackground.layer.borderColor = Asset.Colors.Background.systemBackground.color.cgColor
} }
override func setHighlighted(_ highlighted: Bool, animated: Bool) {
super.setHighlighted(highlighted, animated: animated)
resetContentOverlayBlurImageBackgroundColor(selected: highlighted)
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
resetContentOverlayBlurImageBackgroundColor(selected: selected)
}
private func resetContentOverlayBlurImageBackgroundColor(selected: Bool) {
let imageViewBackgroundColor: UIColor? = selected ? selectedBackgroundView?.backgroundColor : backgroundColor
statusView.contentWarningOverlayView.blurContentImageView.backgroundColor = imageViewBackgroundColor
}
} }
// MARK: - StatusViewDelegate // MARK: - StatusViewDelegate
extension NotificationStatusTableViewCell: StatusViewDelegate { extension NotificationStatusTableViewCell: StatusViewDelegate {
func statusView(_ statusView: StatusView, headerInfoLabelDidPressed label: UILabel) { func statusView(_ statusView: StatusView, headerInfoLabelDidPressed label: UILabel) {
// do nothing // do nothing
} }
func statusView(_ statusView: StatusView, avatarButtonDidPressed button: UIButton) { func statusView(_ statusView: StatusView, avatarImageViewDidPressed imageView: UIImageView) {
// do nothing // do nothing
} }

View File

@ -36,6 +36,7 @@ final class WelcomeViewController: UIViewController, NeedsDependency {
private(set) lazy var signUpButton: PrimaryActionButton = { private(set) lazy var signUpButton: PrimaryActionButton = {
let button = PrimaryActionButton() let button = PrimaryActionButton()
button.adjustsBackgroundImageWhenUserInterfaceStyleChanges = false
button.setTitle(L10n.Common.Controls.Actions.signUp, for: .normal) button.setTitle(L10n.Common.Controls.Actions.signUp, for: .normal)
let backgroundImageColor: UIColor = traitCollection.userInterfaceIdiom == .phone ? .white : Asset.Colors.brandBlue.color let backgroundImageColor: UIColor = traitCollection.userInterfaceIdiom == .phone ? .white : Asset.Colors.brandBlue.color
let backgroundImageHighlightedColor: UIColor = traitCollection.userInterfaceIdiom == .phone ? UIColor(white: 0.8, alpha: 1.0) : Asset.Colors.brandBlueDarken20.color let backgroundImageHighlightedColor: UIColor = traitCollection.userInterfaceIdiom == .phone ? UIColor(white: 0.8, alpha: 1.0) : Asset.Colors.brandBlueDarken20.color

View File

@ -9,6 +9,7 @@ import os.log
import UIKit import UIKit
import ActiveLabel import ActiveLabel
import TwitterTextEditor import TwitterTextEditor
import FLAnimatedImage
protocol ProfileHeaderViewDelegate: AnyObject { protocol ProfileHeaderViewDelegate: AnyObject {
func profileHeaderView(_ profileHeaderView: ProfileHeaderView, avatarImageViewDidPressed imageView: UIImageView) func profileHeaderView(_ profileHeaderView: ProfileHeaderView, avatarImageViewDidPressed imageView: UIImageView)
@ -66,7 +67,7 @@ final class ProfileHeaderView: UIView {
}() }()
let avatarImageView: UIImageView = { let avatarImageView: UIImageView = {
let imageView = UIImageView() let imageView = FLAnimatedImageView()
let placeholderImage = UIImage let placeholderImage = UIImage
.placeholder(size: ProfileHeaderView.avatarImageViewSize, color: Asset.Colors.Background.systemGroupedBackground.color) .placeholder(size: ProfileHeaderView.avatarImageViewSize, color: Asset.Colors.Background.systemGroupedBackground.color)
.af.imageRounded(withCornerRadius: ProfileHeaderView.avatarImageViewCornerRadius, divideRadiusByImageScale: false) .af.imageRounded(withCornerRadius: ProfileHeaderView.avatarImageViewCornerRadius, divideRadiusByImageScale: false)

View File

@ -19,7 +19,6 @@ final class ReportedStatusTableViewCell: UITableViewCell, StatusCell {
weak var dependency: ReportViewController? weak var dependency: ReportViewController?
var disposeBag = Set<AnyCancellable>() var disposeBag = Set<AnyCancellable>()
var pollCountdownSubscription: AnyCancellable?
var observations = Set<NSKeyValueObservation>() var observations = Set<NSKeyValueObservation>()
let statusView = StatusView() let statusView = StatusView()
@ -62,16 +61,6 @@ final class ReportedStatusTableViewCell: UITableViewCell, StatusCell {
_init() _init()
} }
override func layoutSubviews() {
super.layoutSubviews()
// precondition: app is active
guard UIApplication.shared.applicationState == .active else { return }
DispatchQueue.main.async {
self.statusView.drawContentWarningImageView()
}
}
override func setHighlighted(_ highlighted: Bool, animated: Bool) { override func setHighlighted(_ highlighted: Bool, animated: Bool) {
super.setHighlighted(highlighted, animated: animated) super.setHighlighted(highlighted, animated: animated)
if highlighted { if highlighted {
@ -134,7 +123,6 @@ extension ReportedStatusTableViewCell {
statusView.delegate = self statusView.delegate = self
statusView.statusMosaicImageViewContainer.delegate = self statusView.statusMosaicImageViewContainer.delegate = self
statusView.actionToolbarContainer.isHidden = true statusView.actionToolbarContainer.isHidden = true
statusView.contentWarningOverlayView.blurContentImageView.backgroundColor = backgroundColor
} }
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
@ -188,10 +176,11 @@ extension ReportedStatusTableViewCell: MosaicImageViewContainerDelegate {
} }
extension ReportedStatusTableViewCell: StatusViewDelegate { extension ReportedStatusTableViewCell: StatusViewDelegate {
func statusView(_ statusView: StatusView, headerInfoLabelDidPressed label: UILabel) { func statusView(_ statusView: StatusView, headerInfoLabelDidPressed label: UILabel) {
} }
func statusView(_ statusView: StatusView, avatarButtonDidPressed button: UIButton) { func statusView(_ statusView: StatusView, avatarImageViewDidPressed imageView: UIImageView) {
} }
func statusView(_ statusView: StatusView, revealContentWarningButtonDidPressed button: UIButton) { func statusView(_ statusView: StatusView, revealContentWarningButtonDidPressed button: UIButton) {

View File

@ -21,6 +21,8 @@ class PrimaryActionButton: UIButton {
private var originalButtonTitle: String? private var originalButtonTitle: String?
var adjustsBackgroundImageWhenUserInterfaceStyleChanges = true
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
_init() _init()
@ -51,7 +53,9 @@ extension PrimaryActionButton {
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection) super.traitCollectionDidChange(previousTraitCollection)
setupBackgroundAppearance() if adjustsBackgroundImageWhenUserInterfaceStyleChanges {
setupBackgroundAppearance()
}
} }
func showLoading() { func showLoading() {

View File

@ -42,7 +42,7 @@ final class MosaicImageViewContainer: UIView {
let contentWarningOverlayView: ContentWarningOverlayView = { let contentWarningOverlayView: ContentWarningOverlayView = {
let contentWarningOverlayView = ContentWarningOverlayView() let contentWarningOverlayView = ContentWarningOverlayView()
contentWarningOverlayView.configure(style: .visualEffectView) contentWarningOverlayView.configure(style: .media)
return contentWarningOverlayView return contentWarningOverlayView
}() }()
@ -103,10 +103,20 @@ extension MosaicImageViewContainer {
imageViews.forEach { imageView in imageViews.forEach { imageView in
imageView.constraints.forEach { imageView.removeConstraint($0) } imageView.constraints.forEach { imageView.removeConstraint($0) }
imageView.removeFromSuperview() imageView.removeFromSuperview()
imageView.layer.maskedCorners = [
.layerMinXMinYCorner, .layerMaxXMinYCorner,
.layerMinXMaxYCorner, .layerMaxXMaxYCorner
]
imageView.image = nil
} }
blurhashOverlayImageViews.forEach { imageView in blurhashOverlayImageViews.forEach { imageView in
imageView.constraints.forEach { imageView.removeConstraint($0) } imageView.constraints.forEach { imageView.removeConstraint($0) }
imageView.removeFromSuperview() imageView.removeFromSuperview()
imageView.layer.maskedCorners = [
.layerMinXMinYCorner, .layerMaxXMinYCorner,
.layerMinXMaxYCorner, .layerMaxXMaxYCorner
]
imageView.image = nil
} }
contentWarningOverlayView.removeFromSuperview() contentWarningOverlayView.removeFromSuperview()

View File

@ -30,18 +30,21 @@ class ContentWarningOverlayView: UIView {
return label return label
}() }()
let blurContentImageView: UIImageView = { // for status style overlay
let imageView = UIImageView() let contentOverlayView: UIView = {
imageView.layer.masksToBounds = false let view = UIView()
return imageView view.backgroundColor = Asset.Colors.ContentWarningOverlay.background.color
view.applyCornerRadius(radius: ContentWarningOverlayView.cornerRadius)
return view
}() }()
let blurContentWarningTitleLabel: UILabel = { let blurContentWarningTitleLabel: UILabel = {
let label = UILabel() let label = UILabel()
label.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 17), maximumPointSize: 23) label.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: .systemFont(ofSize: 17, weight: .semibold), maximumPointSize: 23)
label.text = L10n.Common.Controls.Status.mediaContentWarning label.text = L10n.Common.Controls.Status.mediaContentWarning
label.textColor = Asset.Colors.Label.primary.color label.textColor = Asset.Colors.Label.primary.color
label.textAlignment = .center label.textAlignment = .center
label.isAccessibilityElement = false label.isAccessibilityElement = false
label.numberOfLines = 2
return label return label
}() }()
let blurContentWarningLabel: UILabel = { let blurContentWarningLabel: UILabel = {
@ -50,8 +53,8 @@ class ContentWarningOverlayView: UIView {
label.text = L10n.Common.Controls.Status.mediaContentWarning label.text = L10n.Common.Controls.Status.mediaContentWarning
label.textColor = Asset.Colors.Label.secondary.color label.textColor = Asset.Colors.Label.secondary.color
label.textAlignment = .center label.textAlignment = .center
label.layer.setupShadow()
label.isAccessibilityElement = false label.isAccessibilityElement = false
label.numberOfLines = 2
return label return label
}() }()
@ -108,13 +111,13 @@ extension ContentWarningOverlayView {
]) ])
// blur image style // blur image style
blurContentImageView.translatesAutoresizingMaskIntoConstraints = false contentOverlayView.translatesAutoresizingMaskIntoConstraints = false
addSubview(blurContentImageView) addSubview(contentOverlayView)
NSLayoutConstraint.activate([ NSLayoutConstraint.activate([
blurContentImageView.topAnchor.constraint(equalTo: topAnchor), contentOverlayView.topAnchor.constraint(equalTo: topAnchor),
blurContentImageView.leadingAnchor.constraint(equalTo: leadingAnchor), contentOverlayView.leadingAnchor.constraint(equalTo: leadingAnchor),
blurContentImageView.trailingAnchor.constraint(equalTo: trailingAnchor), contentOverlayView.trailingAnchor.constraint(equalTo: trailingAnchor),
blurContentImageView.bottomAnchor.constraint(equalTo: bottomAnchor), contentOverlayView.bottomAnchor.constraint(equalTo: bottomAnchor),
]) ])
let blurContentWarningLabelContainer = UIStackView() let blurContentWarningLabelContainer = UIStackView()
@ -123,7 +126,7 @@ extension ContentWarningOverlayView {
blurContentWarningLabelContainer.alignment = .center blurContentWarningLabelContainer.alignment = .center
blurContentWarningLabelContainer.translatesAutoresizingMaskIntoConstraints = false blurContentWarningLabelContainer.translatesAutoresizingMaskIntoConstraints = false
blurContentImageView.addSubview(blurContentWarningLabelContainer) contentOverlayView.addSubview(blurContentWarningLabelContainer)
NSLayoutConstraint.activate([ NSLayoutConstraint.activate([
blurContentWarningLabelContainer.topAnchor.constraint(equalTo: topAnchor), blurContentWarningLabelContainer.topAnchor.constraint(equalTo: topAnchor),
blurContentWarningLabelContainer.leadingAnchor.constraint(equalTo: leadingAnchor), blurContentWarningLabelContainer.leadingAnchor.constraint(equalTo: leadingAnchor),
@ -143,42 +146,43 @@ extension ContentWarningOverlayView {
topPaddingView.heightAnchor.constraint(equalTo: bottomPaddingView.heightAnchor, multiplier: 1.0).priority(.defaultHigh), topPaddingView.heightAnchor.constraint(equalTo: bottomPaddingView.heightAnchor, multiplier: 1.0).priority(.defaultHigh),
]) ])
blurContentWarningTitleLabel.setContentHuggingPriority(.defaultHigh + 2, for: .vertical) blurContentWarningTitleLabel.setContentHuggingPriority(.defaultHigh + 2, for: .vertical)
blurContentWarningTitleLabel.setContentCompressionResistancePriority(.defaultHigh + 1, for: .vertical)
blurContentWarningLabel.setContentHuggingPriority(.defaultHigh + 1, for: .vertical) blurContentWarningLabel.setContentHuggingPriority(.defaultHigh + 1, for: .vertical)
tapGestureRecognizer.addTarget(self, action: #selector(ContentWarningOverlayView.tapGestureRecognizerHandler(_:))) tapGestureRecognizer.addTarget(self, action: #selector(ContentWarningOverlayView.tapGestureRecognizerHandler(_:)))
addGestureRecognizer(tapGestureRecognizer) addGestureRecognizer(tapGestureRecognizer)
configure(style: .visualEffectView) configure(style: .media)
} }
} }
extension ContentWarningOverlayView { extension ContentWarningOverlayView {
enum Style { enum Style {
case visualEffectView case media // visualEffectView for media
case blurContentImageView case contentWarning // overlay for post
} }
func configure(style: Style) { func configure(style: Style) {
switch style { switch style {
case .visualEffectView: case .media:
blurVisualEffectView.isHidden = false blurVisualEffectView.isHidden = false
vibrancyVisualEffectView.isHidden = false vibrancyVisualEffectView.isHidden = false
blurContentImageView.isHidden = true contentOverlayView.isHidden = true
case .blurContentImageView: case .contentWarning:
blurVisualEffectView.isHidden = true blurVisualEffectView.isHidden = true
vibrancyVisualEffectView.isHidden = true vibrancyVisualEffectView.isHidden = true
blurContentImageView.isHidden = false contentOverlayView.isHidden = false
} }
} }
func update(isRevealing: Bool, style: Style) { func update(isRevealing: Bool, style: Style) {
switch style { switch style {
case .visualEffectView: case .media:
blurVisualEffectView.effect = isRevealing ? nil : ContentWarningOverlayView.blurVisualEffect blurVisualEffectView.effect = isRevealing ? nil : ContentWarningOverlayView.blurVisualEffect
vibrancyVisualEffectView.alpha = isRevealing ? 0 : 1 vibrancyVisualEffectView.alpha = isRevealing ? 0 : 1
isUserInteractionEnabled = !isRevealing isUserInteractionEnabled = !isRevealing
case .blurContentImageView: case .contentWarning:
assertionFailure("not handle here") assertionFailure("not handle here")
break break
} }

View File

@ -7,13 +7,18 @@
import os.log import os.log
import UIKit import UIKit
import Combine
import AVKit import AVKit
import ActiveLabel import ActiveLabel
import AlamofireImage import AlamofireImage
import FLAnimatedImage
// TODO:
// import LinkPresentation
protocol StatusViewDelegate: AnyObject { protocol StatusViewDelegate: AnyObject {
func statusView(_ statusView: StatusView, headerInfoLabelDidPressed label: UILabel) func statusView(_ statusView: StatusView, headerInfoLabelDidPressed label: UILabel)
func statusView(_ statusView: StatusView, avatarButtonDidPressed button: UIButton) func statusView(_ statusView: StatusView, avatarImageViewDidPressed imageView: UIImageView)
func statusView(_ statusView: StatusView, revealContentWarningButtonDidPressed button: UIButton) func statusView(_ statusView: StatusView, revealContentWarningButtonDidPressed button: UIButton)
func statusView(_ statusView: StatusView, contentWarningOverlayViewDidPressed contentWarningOverlayView: ContentWarningOverlayView) func statusView(_ statusView: StatusView, contentWarningOverlayViewDidPressed contentWarningOverlayView: ContentWarningOverlayView)
func statusView(_ statusView: StatusView, playerContainerView: PlayerContainerView, contentWarningOverlayViewDidPressed contentWarningOverlayView: ContentWarningOverlayView) func statusView(_ statusView: StatusView, playerContainerView: PlayerContainerView, contentWarningOverlayViewDidPressed contentWarningOverlayView: ContentWarningOverlayView)
@ -24,6 +29,7 @@ protocol StatusViewDelegate: AnyObject {
final class StatusView: UIView { final class StatusView: UIView {
var statusPollTableViewHeightObservation: NSKeyValueObservation? var statusPollTableViewHeightObservation: NSKeyValueObservation?
var pollCountdownSubscription: AnyCancellable?
static let avatarImageSize = CGSize(width: 42, height: 42) static let avatarImageSize = CGSize(width: 42, height: 42)
static let avatarImageCornerRadius: CGFloat = 4 static let avatarImageCornerRadius: CGFloat = 4
@ -32,9 +38,9 @@ final class StatusView: UIView {
static let containerStackViewSpacing: CGFloat = 10 static let containerStackViewSpacing: CGFloat = 10
weak var delegate: StatusViewDelegate? weak var delegate: StatusViewDelegate?
private var needsDrawContentOverlay = false
var pollTableViewDataSource: UITableViewDiffableDataSource<PollSection, PollItem>? var pollTableViewDataSource: UITableViewDiffableDataSource<PollSection, PollItem>?
var pollTableViewHeightLaoutConstraint: NSLayoutConstraint! var pollTableViewHeightLayoutConstraint: NSLayoutConstraint!
let containerStackView = UIStackView() let containerStackView = UIStackView()
let headerContainerView = UIView() let headerContainerView = UIView()
@ -82,18 +88,11 @@ final class StatusView: UIView {
view.accessibilityLabel = L10n.Common.Controls.Status.showUserProfile view.accessibilityLabel = L10n.Common.Controls.Status.showUserProfile
return view return view
}() }()
let avatarButton: UIButton = { let avatarImageView: UIImageView = FLAnimatedImageView()
let button = HighlightDimmableButton(type: .custom)
let placeholderImage = UIImage.placeholder(size: avatarImageSize, color: .systemFill)
.af.imageRounded(withCornerRadius: StatusView.avatarImageCornerRadius, divideRadiusByImageScale: true)
button.setImage(placeholderImage, for: .normal)
return button
}()
let avatarStackedContainerButton: AvatarStackContainerButton = AvatarStackContainerButton() let avatarStackedContainerButton: AvatarStackContainerButton = AvatarStackContainerButton()
let nameLabel: ActiveLabel = { let nameLabel: ActiveLabel = {
let label = ActiveLabel(style: .statusName) let label = ActiveLabel(style: .statusName)
label.text = "Alice"
return label return label
}() }()
@ -185,8 +184,8 @@ final class StatusView: UIView {
// do not use visual effect view due to we blur text only without background // do not use visual effect view due to we blur text only without background
let contentWarningOverlayView: ContentWarningOverlayView = { let contentWarningOverlayView: ContentWarningOverlayView = {
let contentWarningOverlayView = ContentWarningOverlayView() let contentWarningOverlayView = ContentWarningOverlayView()
contentWarningOverlayView.layer.masksToBounds = false contentWarningOverlayView.configure(style: .contentWarning)
contentWarningOverlayView.configure(style: .blurContentImageView) contentWarningOverlayView.layer.masksToBounds = true
return contentWarningOverlayView return contentWarningOverlayView
}() }()
@ -208,6 +207,9 @@ final class StatusView: UIView {
var isRevealing = true var isRevealing = true
// TODO:
// let linkPreview = LPLinkView()
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
_init() _init()
@ -218,15 +220,6 @@ final class StatusView: UIView {
_init() _init()
} }
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
// update blur image when interface style changed
if previousTraitCollection?.userInterfaceStyle != traitCollection.userInterfaceStyle {
drawContentWarningImageView()
}
}
deinit { deinit {
statusPollTableViewHeightObservation = nil statusPollTableViewHeightObservation = nil
} }
@ -249,6 +242,7 @@ extension StatusView {
bottomAnchor.constraint(equalTo: containerStackView.bottomAnchor), bottomAnchor.constraint(equalTo: containerStackView.bottomAnchor),
]) ])
containerStackView.setContentHuggingPriority(.required - 1, for: .vertical) containerStackView.setContentHuggingPriority(.required - 1, for: .vertical)
containerStackView.setContentCompressionResistancePriority(.required - 1, for: .vertical)
// header container: [icon | info] // header container: [icon | info]
let headerContainerStackView = UIStackView() let headerContainerStackView = UIStackView()
@ -281,13 +275,13 @@ extension StatusView {
avatarView.widthAnchor.constraint(equalToConstant: StatusView.avatarImageSize.width).priority(.required - 1), avatarView.widthAnchor.constraint(equalToConstant: StatusView.avatarImageSize.width).priority(.required - 1),
avatarView.heightAnchor.constraint(equalToConstant: StatusView.avatarImageSize.height).priority(.required - 1), avatarView.heightAnchor.constraint(equalToConstant: StatusView.avatarImageSize.height).priority(.required - 1),
]) ])
avatarButton.translatesAutoresizingMaskIntoConstraints = false avatarImageView.translatesAutoresizingMaskIntoConstraints = false
avatarView.addSubview(avatarButton) avatarView.addSubview(avatarImageView)
NSLayoutConstraint.activate([ NSLayoutConstraint.activate([
avatarButton.topAnchor.constraint(equalTo: avatarView.topAnchor), avatarImageView.topAnchor.constraint(equalTo: avatarView.topAnchor),
avatarButton.leadingAnchor.constraint(equalTo: avatarView.leadingAnchor), avatarImageView.leadingAnchor.constraint(equalTo: avatarView.leadingAnchor),
avatarButton.trailingAnchor.constraint(equalTo: avatarView.trailingAnchor), avatarImageView.trailingAnchor.constraint(equalTo: avatarView.trailingAnchor),
avatarButton.bottomAnchor.constraint(equalTo: avatarView.bottomAnchor), avatarImageView.bottomAnchor.constraint(equalTo: avatarView.bottomAnchor),
]) ])
avatarStackedContainerButton.translatesAutoresizingMaskIntoConstraints = false avatarStackedContainerButton.translatesAutoresizingMaskIntoConstraints = false
avatarView.addSubview(avatarStackedContainerButton) avatarView.addSubview(avatarStackedContainerButton)
@ -355,18 +349,25 @@ extension StatusView {
contentWarningOverlayView.translatesAutoresizingMaskIntoConstraints = false contentWarningOverlayView.translatesAutoresizingMaskIntoConstraints = false
containerStackView.addSubview(contentWarningOverlayView) containerStackView.addSubview(contentWarningOverlayView)
NSLayoutConstraint.activate([ NSLayoutConstraint.activate([
statusContainerStackView.topAnchor.constraint(equalTo: contentWarningOverlayView.topAnchor, constant: StatusView.contentWarningBlurRadius).priority(.defaultHigh), statusContainerStackView.topAnchor.constraint(equalTo: contentWarningOverlayView.topAnchor).priority(.defaultHigh + 10),
statusContainerStackView.leftAnchor.constraint(equalTo: contentWarningOverlayView.leftAnchor, constant: StatusView.contentWarningBlurRadius).priority(.defaultHigh), statusContainerStackView.leftAnchor.constraint(equalTo: contentWarningOverlayView.leftAnchor).priority(.defaultHigh),
contentWarningOverlayView.rightAnchor.constraint(equalTo: statusContainerStackView.rightAnchor, constant: StatusView.contentWarningBlurRadius).priority(.defaultHigh), contentWarningOverlayView.rightAnchor.constraint(equalTo: statusContainerStackView.rightAnchor).priority(.defaultHigh),
// only layout to top and left & right then draw image to fit size contentWarningOverlayView.bottomAnchor.constraint(equalTo: statusContainerStackView.bottomAnchor).priority(.defaultHigh),
]) ])
// avoid overlay clip author view // avoid overlay behind other views
containerStackView.bringSubviewToFront(authorContainerView) defer {
containerStackView.bringSubviewToFront(authorContainerView)
}
// status // status
statusContainerStackView.addArrangedSubview(activeTextLabel) statusContainerStackView.addArrangedSubview(activeTextLabel)
activeTextLabel.setContentCompressionResistancePriority(.required - 1, for: .vertical) activeTextLabel.setContentCompressionResistancePriority(.required - 1, for: .vertical)
// TODO:
// link preview
// statusContainerStackView.addArrangedSubview(linkPreview)
// linkPreview.setContentHuggingPriority(.defaultHigh, for: .vertical)
// image // image
statusContainerStackView.addArrangedSubview(statusMosaicImageViewContainer) statusContainerStackView.addArrangedSubview(statusMosaicImageViewContainer)
@ -382,18 +383,18 @@ extension StatusView {
pollTableView.translatesAutoresizingMaskIntoConstraints = false pollTableView.translatesAutoresizingMaskIntoConstraints = false
statusContainerStackView.addArrangedSubview(pollTableView) statusContainerStackView.addArrangedSubview(pollTableView)
pollTableViewHeightLaoutConstraint = pollTableView.heightAnchor.constraint(equalToConstant: 44.0).priority(.required - 1) pollTableViewHeightLayoutConstraint = pollTableView.heightAnchor.constraint(equalToConstant: 44.0).priority(.required - 1)
NSLayoutConstraint.activate([ NSLayoutConstraint.activate([
pollTableViewHeightLaoutConstraint, pollTableViewHeightLayoutConstraint,
]) ])
statusPollTableViewHeightObservation = pollTableView.observe(\.contentSize, options: .new, changeHandler: { [weak self] tableView, _ in statusPollTableViewHeightObservation = pollTableView.observe(\.contentSize, options: .new, changeHandler: { [weak self] tableView, _ in
guard let self = self else { return } guard let self = self else { return }
guard self.pollTableView.contentSize.height != .zero else { guard self.pollTableView.contentSize.height != .zero else {
self.pollTableViewHeightLaoutConstraint.constant = 44 self.pollTableViewHeightLayoutConstraint.constant = 44
return return
} }
self.pollTableViewHeightLaoutConstraint.constant = self.pollTableView.contentSize.height self.pollTableViewHeightLayoutConstraint.constant = self.pollTableView.contentSize.height
}) })
statusContainerStackView.addArrangedSubview(pollStatusStackView) statusContainerStackView.addArrangedSubview(pollStatusStackView)
@ -409,7 +410,9 @@ extension StatusView {
// action toolbar container // action toolbar container
containerStackView.addArrangedSubview(actionToolbarContainer) containerStackView.addArrangedSubview(actionToolbarContainer)
containerStackView.sendSubviewToBack(actionToolbarContainer)
actionToolbarContainer.setContentCompressionResistancePriority(.defaultLow, for: .vertical) actionToolbarContainer.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
actionToolbarContainer.setContentHuggingPriority(.required - 1, for: .vertical)
headerContainerView.isHidden = true headerContainerView.isHidden = true
statusMosaicImageViewContainer.isHidden = true statusMosaicImageViewContainer.isHidden = true
@ -429,7 +432,11 @@ extension StatusView {
headerInfoLabel.isUserInteractionEnabled = true headerInfoLabel.isUserInteractionEnabled = true
headerInfoLabel.addGestureRecognizer(headerInfoLabelTapGestureRecognizer) headerInfoLabel.addGestureRecognizer(headerInfoLabelTapGestureRecognizer)
avatarButton.addTarget(self, action: #selector(StatusView.avatarButtonDidPressed(_:)), for: .touchUpInside) let avatarImageViewTapGestureRecognizer = UITapGestureRecognizer.singleTapGestureRecognizer
avatarImageViewTapGestureRecognizer.addTarget(self, action: #selector(StatusView.avatarImageViewDidPressed(_:)))
avatarImageView.addGestureRecognizer(avatarImageViewTapGestureRecognizer)
avatarImageView.isUserInteractionEnabled = true
avatarStackedContainerButton.addTarget(self, action: #selector(StatusView.avatarStackedContainerButtonDidPressed(_:)), for: .touchUpInside) avatarStackedContainerButton.addTarget(self, action: #selector(StatusView.avatarStackedContainerButtonDidPressed(_:)), for: .touchUpInside)
revealContentWarningButton.addTarget(self, action: #selector(StatusView.revealContentWarningButtonDidPressed(_:)), for: .touchUpInside) revealContentWarningButton.addTarget(self, action: #selector(StatusView.revealContentWarningButtonDidPressed(_:)), for: .touchUpInside)
pollVoteButton.addTarget(self, action: #selector(StatusView.pollVoteButtonPressed(_:)), for: .touchUpInside) pollVoteButton.addTarget(self, action: #selector(StatusView.pollVoteButtonPressed(_:)), for: .touchUpInside)
@ -439,50 +446,24 @@ extension StatusView {
extension StatusView { extension StatusView {
private func cleanUpContentWarning() { func updateContentWarningDisplay(isHidden: Bool, animated: Bool, completion: (() -> Void)? = nil) {
contentWarningOverlayView.blurContentImageView.image = nil func updateOverlayView() {
} contentWarningOverlayView.contentOverlayView.alpha = isHidden ? 0 : 1
contentWarningOverlayView.isUserInteractionEnabled = !isHidden
func drawContentWarningImageView() {
guard window != nil else {
return
}
guard needsDrawContentOverlay, statusContainerStackView.frame != .zero else {
cleanUpContentWarning()
return
}
let format = UIGraphicsImageRendererFormat()
format.opaque = false
let image = UIGraphicsImageRenderer(size: statusContainerStackView.frame.size, format: format).image { context in
statusContainerStackView.drawHierarchy(in: statusContainerStackView.bounds, afterScreenUpdates: true)
}
.blur(radius: StatusView.contentWarningBlurRadius)
contentWarningOverlayView.blurContentImageView.contentScaleFactor = traitCollection.displayScale
contentWarningOverlayView.blurContentImageView.image = image
}
func updateContentWarningDisplay(isHidden: Bool, animated: Bool) {
needsDrawContentOverlay = !isHidden
if !isHidden {
drawContentWarningImageView()
}
if animated {
UIView.animate(withDuration: 0.33, delay: 0, options: .curveEaseInOut) { [weak self] in
guard let self = self else { return }
self.contentWarningOverlayView.alpha = isHidden ? 0 : 1
} completion: { _ in
// do nothing
}
} else {
contentWarningOverlayView.alpha = isHidden ? 0 : 1
} }
contentWarningOverlayView.blurContentWarningTitleLabel.isHidden = isHidden contentWarningOverlayView.blurContentWarningTitleLabel.isHidden = isHidden
contentWarningOverlayView.blurContentWarningLabel.isHidden = isHidden
if animated {
UIView.animate(withDuration: 0.33, delay: 0, options: .curveEaseInOut) {
updateOverlayView()
} completion: { _ in
completion!()
}
} else {
updateOverlayView()
completion?()
}
} }
func updateRevealContentWarningButton(isRevealing: Bool) { func updateRevealContentWarningButton(isRevealing: Bool) {
@ -512,14 +493,14 @@ extension StatusView {
delegate?.statusView(self, headerInfoLabelDidPressed: headerInfoLabel) delegate?.statusView(self, headerInfoLabelDidPressed: headerInfoLabel)
} }
@objc private func avatarButtonDidPressed(_ sender: UIButton) { @objc private func avatarImageViewDidPressed(_ sender: UITapGestureRecognizer) {
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function) os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
delegate?.statusView(self, avatarButtonDidPressed: sender) delegate?.statusView(self, avatarImageViewDidPressed: avatarImageView)
} }
@objc private func avatarStackedContainerButtonDidPressed(_ sender: UIButton) { @objc private func avatarStackedContainerButtonDidPressed(_ sender: UIButton) {
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function) os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
delegate?.statusView(self, avatarButtonDidPressed: sender) delegate?.statusView(self, avatarImageViewDidPressed: avatarStackedContainerButton.topLeadingAvatarStackedImageView)
} }
@objc private func revealContentWarningButtonDidPressed(_ sender: UIButton) { @objc private func revealContentWarningButtonDidPressed(_ sender: UIButton) {
@ -562,9 +543,8 @@ extension StatusView: PlayerContainerViewDelegate {
extension StatusView: AvatarConfigurableView { extension StatusView: AvatarConfigurableView {
static var configurableAvatarImageSize: CGSize { return Self.avatarImageSize } static var configurableAvatarImageSize: CGSize { return Self.avatarImageSize }
static var configurableAvatarImageCornerRadius: CGFloat { return 4 } static var configurableAvatarImageCornerRadius: CGFloat { return 4 }
var configurableAvatarImageView: UIImageView? { return nil } var configurableAvatarImageView: UIImageView? { avatarImageView }
var configurableAvatarButton: UIButton? { return avatarButton } var configurableAvatarButton: UIButton? { nil }
var configurableVerifiedBadgeImageView: UIImageView? { nil }
} }
#if canImport(SwiftUI) && DEBUG #if canImport(SwiftUI) && DEBUG
@ -592,7 +572,7 @@ struct StatusView_Previews: PreviewProvider {
UIViewPreview(width: 375) { UIViewPreview(width: 375) {
let statusView = StatusView() let statusView = StatusView()
statusView.headerContainerView.isHidden = false statusView.headerContainerView.isHidden = false
statusView.avatarButton.isHidden = true statusView.avatarImageView.isHidden = true
statusView.avatarStackedContainerButton.isHidden = false statusView.avatarStackedContainerButton.isHidden = false
statusView.avatarStackedContainerButton.topLeadingAvatarStackedImageView.configure( statusView.avatarStackedContainerButton.topLeadingAvatarStackedImageView.configure(
with: AvatarConfigurableViewConfiguration( with: AvatarConfigurableViewConfiguration(
@ -642,7 +622,6 @@ struct StatusView_Previews: PreviewProvider {
statusView.setNeedsLayout() statusView.setNeedsLayout()
statusView.layoutIfNeeded() statusView.layoutIfNeeded()
statusView.updateContentWarningDisplay(isHidden: false, animated: false) statusView.updateContentWarningDisplay(isHidden: false, animated: false)
statusView.drawContentWarningImageView()
let images = MosaicImageView_Previews.images let images = MosaicImageView_Previews.images
let mosaics = statusView.statusMosaicImageViewContainer.setupImageViews(count: 4, maxSize: CGSize(width: 375, height: 162)) let mosaics = statusView.statusMosaicImageViewContainer.setupImageViews(count: 4, maxSize: CGSize(width: 375, height: 162))
for (i, mosaic) in mosaics.enumerated() { for (i, mosaic) in mosaics.enumerated() {

View File

@ -7,7 +7,9 @@
import os.log import os.log
import UIKit import UIKit
final class AvatarStackedImageView: UIImageView { } import FLAnimatedImage
final class AvatarStackedImageView: FLAnimatedImageView { }
// MARK: - AvatarConfigurableView // MARK: - AvatarConfigurableView
extension AvatarStackedImageView: AvatarConfigurableView { extension AvatarStackedImageView: AvatarConfigurableView {

View File

@ -21,7 +21,7 @@ protocol StatusTableViewCellDelegate: AnyObject {
var playerViewControllerDelegate: AVPlayerViewControllerDelegate? { get } var playerViewControllerDelegate: AVPlayerViewControllerDelegate? { get }
func statusTableViewCell(_ cell: StatusTableViewCell, statusView: StatusView, headerInfoLabelDidPressed label: UILabel) func statusTableViewCell(_ cell: StatusTableViewCell, statusView: StatusView, headerInfoLabelDidPressed label: UILabel)
func statusTableViewCell(_ cell: StatusTableViewCell, statusView: StatusView, avatarButtonDidPressed button: UIButton) func statusTableViewCell(_ cell: StatusTableViewCell, statusView: StatusView, avatarImageViewDidPressed imageView: UIImageView)
func statusTableViewCell(_ cell: StatusTableViewCell, statusView: StatusView, revealContentWarningButtonDidPressed button: UIButton) func statusTableViewCell(_ cell: StatusTableViewCell, statusView: StatusView, revealContentWarningButtonDidPressed button: UIButton)
func statusTableViewCell(_ cell: StatusTableViewCell, statusView: StatusView, contentWarningOverlayViewDidPressed contentWarningOverlayView: ContentWarningOverlayView) func statusTableViewCell(_ cell: StatusTableViewCell, statusView: StatusView, contentWarningOverlayViewDidPressed contentWarningOverlayView: ContentWarningOverlayView)
func statusTableViewCell(_ cell: StatusTableViewCell, statusView: StatusView, pollVoteButtonPressed button: UIButton) func statusTableViewCell(_ cell: StatusTableViewCell, statusView: StatusView, pollVoteButtonPressed button: UIButton)
@ -93,16 +93,6 @@ final class StatusTableViewCell: UITableViewCell, StatusCell {
_init() _init()
} }
override func layoutSubviews() {
super.layoutSubviews()
// precondition: app is active
guard UIApplication.shared.applicationState == .active else { return }
DispatchQueue.main.async {
self.statusView.drawContentWarningImageView()
}
}
} }
extension StatusTableViewCell { extension StatusTableViewCell {
@ -155,17 +145,6 @@ extension StatusTableViewCell {
resetSeparatorLineLayout() resetSeparatorLineLayout()
} }
override func setHighlighted(_ highlighted: Bool, animated: Bool) {
super.setHighlighted(highlighted, animated: animated)
resetContentOverlayBlurImageBackgroundColor(selected: highlighted)
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
resetContentOverlayBlurImageBackgroundColor(selected: selected)
}
} }
@ -200,10 +179,6 @@ extension StatusTableViewCell {
} }
} }
private func resetContentOverlayBlurImageBackgroundColor(selected: Bool) {
let imageViewBackgroundColor: UIColor? = selected ? selectedBackgroundView?.backgroundColor : backgroundColor
statusView.contentWarningOverlayView.blurContentImageView.backgroundColor = imageViewBackgroundColor
}
} }
// MARK: - MosaicImageViewContainerPresentable // MARK: - MosaicImageViewContainerPresentable
@ -302,8 +277,8 @@ extension StatusTableViewCell: StatusViewDelegate {
delegate?.statusTableViewCell(self, statusView: statusView, headerInfoLabelDidPressed: label) delegate?.statusTableViewCell(self, statusView: statusView, headerInfoLabelDidPressed: label)
} }
func statusView(_ statusView: StatusView, avatarButtonDidPressed button: UIButton) { func statusView(_ statusView: StatusView, avatarImageViewDidPressed imageView: UIImageView) {
delegate?.statusTableViewCell(self, statusView: statusView, avatarButtonDidPressed: button) delegate?.statusTableViewCell(self, statusView: statusView, avatarImageViewDidPressed: imageView)
} }
func statusView(_ statusView: StatusView, revealContentWarningButtonDidPressed button: UIButton) { func statusView(_ statusView: StatusView, revealContentWarningButtonDidPressed button: UIButton) {

View File

@ -10,10 +10,6 @@ import UIKit
import UserNotifications import UserNotifications
import AppShared import AppShared
#if DEBUG
import GDPerformanceView_Swift
#endif
#if ASDK #if ASDK
import AsyncDisplayKit import AsyncDisplayKit
#endif #endif

View File

@ -9,6 +9,10 @@ import UIKit
import Combine import Combine
import CoreDataStack import CoreDataStack
#if DEBUG
import FPSIndicator
#endif
class SceneDelegate: UIResponder, UIWindowSceneDelegate { class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var observations = Set<NSKeyValueObservation>() var observations = Set<NSKeyValueObservation>()
@ -16,6 +20,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow? var window: UIWindow?
var coordinator: SceneCoordinator? var coordinator: SceneCoordinator?
#if DEBUG
var fpsIndicator: FPSIndicator?
#endif
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = scene as? UIWindowScene else { return } guard let windowScene = scene as? UIWindowScene else { return }
@ -38,6 +47,10 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
self.window?.overrideUserInterfaceStyle = defaults.customUserInterfaceStyle self.window?.overrideUserInterfaceStyle = defaults.customUserInterfaceStyle
} }
.store(in: &observations) .store(in: &observations)
#if DEBUG
fpsIndicator = FPSIndicator(windowScene: windowScene)
#endif
} }
func sceneDidDisconnect(_ scene: UIScene) { func sceneDidDisconnect(_ scene: UIScene) {

View File

@ -17,7 +17,6 @@ target 'Mastodon' do
# DEBUG # DEBUG
pod 'FLEX', '~> 4.4.0', :configurations => ['Debug', 'ASDK - Debug'] pod 'FLEX', '~> 4.4.0', :configurations => ['Debug', 'ASDK - Debug']
pod 'GDPerformanceView-Swift', '~> 2.1.1', :configurations => ['Debug', 'ASDK - Debug']
target 'MastodonTests' do target 'MastodonTests' do
inherit! :search_paths inherit! :search_paths

View File

@ -1,7 +1,6 @@
PODS: PODS:
- DateToolsSwift (5.0.0) - DateToolsSwift (5.0.0)
- FLEX (4.4.1) - FLEX (4.4.1)
- GDPerformanceView-Swift (2.1.1)
- Kanna (5.2.4) - Kanna (5.2.4)
- Keys (1.0.1) - Keys (1.0.1)
- PINCache (3.0.3): - PINCache (3.0.3):
@ -45,7 +44,6 @@ PODS:
DEPENDENCIES: DEPENDENCIES:
- DateToolsSwift (~> 5.0.0) - DateToolsSwift (~> 5.0.0)
- FLEX (~> 4.4.0) - FLEX (~> 4.4.0)
- GDPerformanceView-Swift (~> 2.1.1)
- Kanna (~> 5.2.2) - Kanna (~> 5.2.2)
- Keys (from `Pods/CocoaPodsKeys`) - Keys (from `Pods/CocoaPodsKeys`)
- SwiftGen (~> 6.4.0) - SwiftGen (~> 6.4.0)
@ -56,7 +54,6 @@ SPEC REPOS:
trunk: trunk:
- DateToolsSwift - DateToolsSwift
- FLEX - FLEX
- GDPerformanceView-Swift
- Kanna - Kanna
- PINCache - PINCache
- PINOperation - PINOperation
@ -72,7 +69,6 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
DateToolsSwift: 4207ada6ad615d8dc076323d27037c94916dbfa6 DateToolsSwift: 4207ada6ad615d8dc076323d27037c94916dbfa6
FLEX: 7ca2c8cd3a435ff501ff6d2f2141e9bdc934eaab FLEX: 7ca2c8cd3a435ff501ff6d2f2141e9bdc934eaab
GDPerformanceView-Swift: 22d964fe40b19e3d914dba2586237d064de8fd77
Kanna: b9d00d7c11428308c7f95e1f1f84b8205f567a8f Kanna: b9d00d7c11428308c7f95e1f1f84b8205f567a8f
Keys: a576f4c9c1c641ca913a959a9c62ed3f215a8de9 Keys: a576f4c9c1c641ca913a959a9c62ed3f215a8de9
PINCache: 7a8fc1a691173d21dbddbf86cd515de6efa55086 PINCache: 7a8fc1a691173d21dbddbf86cd515de6efa55086
@ -82,6 +78,6 @@ SPEC CHECKSUMS:
Texture: 2f109e937850d94d1d07232041c9c7313ccddb81 Texture: 2f109e937850d94d1d07232041c9c7313ccddb81
"UITextField+Shake": 298ac5a0f239d731bdab999b19b628c956ca0ac3 "UITextField+Shake": 298ac5a0f239d731bdab999b19b628c956ca0ac3
PODFILE CHECKSUM: a0d0a385a2888802244e7841940a7d5a55315e1f PODFILE CHECKSUM: f2f99b5771c5c36ef69d13999b88cea5b0e8bfe1
COCOAPODS: 1.10.1 COCOAPODS: 1.10.1