Merge pull request #162 from tootsuite/fix/UI-issues

Fix UI issues in profile, notification, report and and search scene
This commit is contained in:
CMK 2021-06-22 20:05:23 +08:00 committed by GitHub
commit f57f00e833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
86 changed files with 608 additions and 230 deletions

View File

@ -170,7 +170,7 @@
"unmute": "Unmute",
"unmute_user": "Unmute %s",
"muted": "Muted",
"edit_info": "Edit info"
"edit_info": "Edit Info"
},
"timeline": {
"timestamp": {
@ -465,7 +465,7 @@
"hashtags": "Hashtags"
},
"recent_search": "Recent searches",
"clear": "clear"
"clear": "Clear"
}
},
"hashtag": {

View File

@ -31,7 +31,7 @@
164F0EBC267D4FE400249499 /* BoopSound.caf in Resources */ = {isa = PBXBuildFile; fileRef = 164F0EBB267D4FE400249499 /* BoopSound.caf */; };
18BC7629F65E6DB12CB8416D /* Pods_Mastodon_MastodonUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C030226D3C73DCC23D67452 /* Pods_Mastodon_MastodonUITests.framework */; };
2D04F42525C255B9003F936F /* APIService+PublicTimeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D04F42425C255B9003F936F /* APIService+PublicTimeline.swift */; };
2D084B8D26258EA3003AA3AF /* NotificationViewModel+diffable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D084B8C26258EA3003AA3AF /* NotificationViewModel+diffable.swift */; };
2D084B8D26258EA3003AA3AF /* NotificationViewModel+Diffable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D084B8C26258EA3003AA3AF /* NotificationViewModel+Diffable.swift */; };
2D084B9326259545003AA3AF /* NotificationViewModel+LoadLatestState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D084B9226259545003AA3AF /* NotificationViewModel+LoadLatestState.swift */; };
2D0B7A1D261D839600B44727 /* SearchHistory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D0B7A1C261D839600B44727 /* SearchHistory.swift */; };
2D152A8C25C295CC009AA50C /* StatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D152A8B25C295CC009AA50C /* StatusView.swift */; };
@ -620,8 +620,9 @@
0FB3D33125E5F50E00AAD544 /* PickServerSearchCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PickServerSearchCell.swift; sourceTree = "<group>"; };
0FB3D33725E6401400AAD544 /* PickServerCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PickServerCell.swift; sourceTree = "<group>"; };
164F0EBB267D4FE400249499 /* BoopSound.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = BoopSound.caf; sourceTree = "<group>"; };
1D6D967E77A5357E2C6110D9 /* Pods-Mastodon.asdk - debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mastodon.asdk - debug.xcconfig"; path = "Target Support Files/Pods-Mastodon/Pods-Mastodon.asdk - debug.xcconfig"; sourceTree = "<group>"; };
2D04F42425C255B9003F936F /* APIService+PublicTimeline.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "APIService+PublicTimeline.swift"; sourceTree = "<group>"; };
2D084B8C26258EA3003AA3AF /* NotificationViewModel+diffable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NotificationViewModel+diffable.swift"; sourceTree = "<group>"; };
2D084B8C26258EA3003AA3AF /* NotificationViewModel+Diffable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NotificationViewModel+Diffable.swift"; sourceTree = "<group>"; };
2D084B9226259545003AA3AF /* NotificationViewModel+LoadLatestState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NotificationViewModel+LoadLatestState.swift"; sourceTree = "<group>"; };
2D0B7A1C261D839600B44727 /* SearchHistory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchHistory.swift; sourceTree = "<group>"; };
2D152A8B25C295CC009AA50C /* StatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusView.swift; sourceTree = "<group>"; };
@ -733,9 +734,11 @@
2DFAD5362617010500F9EE7C /* SearchingTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchingTableViewCell.swift; sourceTree = "<group>"; };
2E1F6A67FDF9771D3E064FDC /* Pods-Mastodon.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mastodon.debug.xcconfig"; path = "Target Support Files/Pods-Mastodon/Pods-Mastodon.debug.xcconfig"; sourceTree = "<group>"; };
374AA339A20E0FAC75BCDA6D /* Pods_NotificationService.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_NotificationService.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3B7FD8F28DDA8FBCE5562B78 /* Pods-NotificationService.asdk - debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationService.asdk - debug.xcconfig"; path = "Target Support Files/Pods-NotificationService/Pods-NotificationService.asdk - debug.xcconfig"; sourceTree = "<group>"; };
3C030226D3C73DCC23D67452 /* Pods_Mastodon_MastodonUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Mastodon_MastodonUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
452147B2903DF38070FE56A2 /* Pods_MastodonTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MastodonTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
459EA4F43058CAB47719E963 /* Pods-Mastodon-MastodonUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mastodon-MastodonUITests.debug.xcconfig"; path = "Target Support Files/Pods-Mastodon-MastodonUITests/Pods-Mastodon-MastodonUITests.debug.xcconfig"; sourceTree = "<group>"; };
46DAB0EBDDFB678347CD96FF /* Pods-MastodonTests.asdk - release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MastodonTests.asdk - release.xcconfig"; path = "Target Support Files/Pods-MastodonTests/Pods-MastodonTests.asdk - release.xcconfig"; sourceTree = "<group>"; };
5B24BBD7262DB14800A9381B /* ReportViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReportViewModel.swift; sourceTree = "<group>"; };
5B24BBD8262DB14800A9381B /* ReportViewModel+Diffable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ReportViewModel+Diffable.swift"; sourceTree = "<group>"; };
5B24BBE1262DB19100A9381B /* APIService+Report.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "APIService+Report.swift"; sourceTree = "<group>"; };
@ -770,17 +773,22 @@
5DF1058425F88AE500D6C0D4 /* NeedsDependency+AVPlayerViewControllerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NeedsDependency+AVPlayerViewControllerDelegate.swift"; sourceTree = "<group>"; };
5DFC35DE262068D20045711D /* SearchViewController+Follow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SearchViewController+Follow.swift"; sourceTree = "<group>"; };
75E3471C898DDD9631729B6E /* Pods-Mastodon.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mastodon.release.xcconfig"; path = "Target Support Files/Pods-Mastodon/Pods-Mastodon.release.xcconfig"; sourceTree = "<group>"; };
7CEFFAE9AF9284B13C0A758D /* Pods-MastodonTests.asdk - debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MastodonTests.asdk - debug.xcconfig"; path = "Target Support Files/Pods-MastodonTests/Pods-MastodonTests.asdk - debug.xcconfig"; sourceTree = "<group>"; };
819CEC9DCAD8E8E7BD85A7BB /* Pods-Mastodon.asdk.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mastodon.asdk.xcconfig"; path = "Target Support Files/Pods-Mastodon/Pods-Mastodon.asdk.xcconfig"; sourceTree = "<group>"; };
8850E70A1D5FF51432E43653 /* Pods-Mastodon-MastodonUITests.asdk - release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mastodon-MastodonUITests.asdk - release.xcconfig"; path = "Target Support Files/Pods-Mastodon-MastodonUITests/Pods-Mastodon-MastodonUITests.asdk - release.xcconfig"; sourceTree = "<group>"; };
8ED8C4B1F1BA2DCFF2926BB1 /* Pods-Mastodon-NotificationService.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mastodon-NotificationService.debug.xcconfig"; path = "Target Support Files/Pods-Mastodon-NotificationService/Pods-Mastodon-NotificationService.debug.xcconfig"; sourceTree = "<group>"; };
9553C689FFA9EBC880CAB78D /* Pods-NotificationService.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationService.debug.xcconfig"; path = "Target Support Files/Pods-NotificationService/Pods-NotificationService.debug.xcconfig"; sourceTree = "<group>"; };
9776D7C4B79101CF70181127 /* Pods-NotificationService.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationService.release.xcconfig"; path = "Target Support Files/Pods-NotificationService/Pods-NotificationService.release.xcconfig"; sourceTree = "<group>"; };
9780A4C98FFC65B32B50D1C0 /* Pods-MastodonTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MastodonTests.release.xcconfig"; path = "Target Support Files/Pods-MastodonTests/Pods-MastodonTests.release.xcconfig"; sourceTree = "<group>"; };
9A0982D8F349244EB558CDFD /* Pods-AppShared.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppShared.debug.xcconfig"; path = "Target Support Files/Pods-AppShared/Pods-AppShared.debug.xcconfig"; sourceTree = "<group>"; };
9CFF58FD900AC059428700E7 /* Pods-NotificationService.asdk - release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationService.asdk - release.xcconfig"; path = "Target Support Files/Pods-NotificationService/Pods-NotificationService.asdk - release.xcconfig"; sourceTree = "<group>"; };
A4ABE34829701A4496C5BB64 /* Pods_Mastodon.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Mastodon.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A67FD038ECDA0E411AF8DB4D /* Pods-Mastodon-MastodonUITests.asdk.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mastodon-MastodonUITests.asdk.xcconfig"; path = "Target Support Files/Pods-Mastodon-MastodonUITests/Pods-Mastodon-MastodonUITests.asdk.xcconfig"; sourceTree = "<group>"; };
A9B1FB898DFD6063B044298C /* Pods-AppShared.asdk - debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppShared.asdk - debug.xcconfig"; path = "Target Support Files/Pods-AppShared/Pods-AppShared.asdk - debug.xcconfig"; sourceTree = "<group>"; };
B31D44635FCF6452F7E1B865 /* Pods-Mastodon-AppShared.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mastodon-AppShared.release.xcconfig"; path = "Target Support Files/Pods-Mastodon-AppShared/Pods-Mastodon-AppShared.release.xcconfig"; sourceTree = "<group>"; };
B44342AC2B6585F8295F1DDF /* Pods-Mastodon-NotificationService.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mastodon-NotificationService.release.xcconfig"; path = "Target Support Files/Pods-Mastodon-NotificationService/Pods-Mastodon-NotificationService.release.xcconfig"; sourceTree = "<group>"; };
BB482D32A7B9825BF5327C4F /* Pods-Mastodon-MastodonUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mastodon-MastodonUITests.release.xcconfig"; path = "Target Support Files/Pods-Mastodon-MastodonUITests/Pods-Mastodon-MastodonUITests.release.xcconfig"; sourceTree = "<group>"; };
BD7598A87F4497045EDEF252 /* Pods-Mastodon.asdk - release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mastodon.asdk - release.xcconfig"; path = "Target Support Files/Pods-Mastodon/Pods-Mastodon.asdk - release.xcconfig"; sourceTree = "<group>"; };
CD92E0F10BDE4FE7C4B999F2 /* Pods_MastodonTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MastodonTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D7D7CF93E262178800077512 /* Pods-Mastodon-AppShared.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mastodon-AppShared.debug.xcconfig"; path = "Target Support Files/Pods-Mastodon-AppShared/Pods-Mastodon-AppShared.debug.xcconfig"; sourceTree = "<group>"; };
DB0140CE25C42AEE00F9F3CF /* OSLog.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OSLog.swift; sourceTree = "<group>"; };
@ -1091,6 +1099,8 @@
DBF96325262EC0A6001D8D25 /* AuthenticationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AuthenticationServices.framework; path = System/Library/Frameworks/AuthenticationServices.framework; sourceTree = SDKROOT; };
DBF98149265E24F500E4BA07 /* ProfileFieldCollectionViewHeaderFooterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileFieldCollectionViewHeaderFooterView.swift; sourceTree = "<group>"; };
DBF9814B265E339500E4BA07 /* ProfileFieldAddEntryCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileFieldAddEntryCollectionViewCell.swift; sourceTree = "<group>"; };
DDB1B139FA8EA26F510D58B6 /* Pods-AppShared.asdk - release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppShared.asdk - release.xcconfig"; path = "Target Support Files/Pods-AppShared/Pods-AppShared.asdk - release.xcconfig"; sourceTree = "<group>"; };
E5C7236E58D14A0322FE00F2 /* Pods-Mastodon-MastodonUITests.asdk - debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mastodon-MastodonUITests.asdk - debug.xcconfig"; path = "Target Support Files/Pods-Mastodon-MastodonUITests/Pods-Mastodon-MastodonUITests.asdk - debug.xcconfig"; sourceTree = "<group>"; };
EC6E707B68A67DB08EC288FA /* Pods-MastodonTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MastodonTests.debug.xcconfig"; path = "Target Support Files/Pods-MastodonTests/Pods-MastodonTests.debug.xcconfig"; sourceTree = "<group>"; };
ECA373ABA86BE3C2D7ED878E /* Pods-AppShared.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppShared.release.xcconfig"; path = "Target Support Files/Pods-AppShared/Pods-AppShared.release.xcconfig"; sourceTree = "<group>"; };
EE13214BC0246BE5210CCC10 /* Pods-AppShared.asdk.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppShared.asdk.xcconfig"; path = "Target Support Files/Pods-AppShared/Pods-AppShared.asdk.xcconfig"; sourceTree = "<group>"; };
@ -1271,6 +1281,16 @@
A67FD038ECDA0E411AF8DB4D /* Pods-Mastodon-MastodonUITests.asdk.xcconfig */,
5DA82A9B4ABDAFA3AB9A49C7 /* Pods-MastodonTests.asdk.xcconfig */,
F31E7502A7E3945B98C6CBAF /* Pods-NotificationService.asdk.xcconfig */,
A9B1FB898DFD6063B044298C /* Pods-AppShared.asdk - debug.xcconfig */,
DDB1B139FA8EA26F510D58B6 /* Pods-AppShared.asdk - release.xcconfig */,
1D6D967E77A5357E2C6110D9 /* Pods-Mastodon.asdk - debug.xcconfig */,
BD7598A87F4497045EDEF252 /* Pods-Mastodon.asdk - release.xcconfig */,
E5C7236E58D14A0322FE00F2 /* Pods-Mastodon-MastodonUITests.asdk - debug.xcconfig */,
8850E70A1D5FF51432E43653 /* Pods-Mastodon-MastodonUITests.asdk - release.xcconfig */,
7CEFFAE9AF9284B13C0A758D /* Pods-MastodonTests.asdk - debug.xcconfig */,
46DAB0EBDDFB678347CD96FF /* Pods-MastodonTests.asdk - release.xcconfig */,
3B7FD8F28DDA8FBCE5562B78 /* Pods-NotificationService.asdk - debug.xcconfig */,
9CFF58FD900AC059428700E7 /* Pods-NotificationService.asdk - release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
@ -2310,7 +2330,7 @@
children = (
DB9D6BF725E4F5690051B173 /* NotificationViewController.swift */,
2D607AD726242FC500B70763 /* NotificationViewModel.swift */,
2D084B8C26258EA3003AA3AF /* NotificationViewModel+diffable.swift */,
2D084B8C26258EA3003AA3AF /* NotificationViewModel+Diffable.swift */,
2D084B9226259545003AA3AF /* NotificationViewModel+LoadLatestState.swift */,
2D24E12C2626FD2E00A59D4F /* NotificationViewModel+LoadOldestState.swift */,
2D35237F26256F470031AF25 /* TableViewCell */,
@ -3281,7 +3301,7 @@
DB789A1C25F9F76A0071ACA0 /* ComposeStatusContentCollectionViewCell.swift in Sources */,
DB1FD43625F26899004CFCFC /* MastodonPickServerViewModel+LoadIndexedServerState.swift in Sources */,
2D939AE825EE1CF80076FA61 /* MastodonRegisterViewController+Avatar.swift in Sources */,
2D084B8D26258EA3003AA3AF /* NotificationViewModel+diffable.swift in Sources */,
2D084B8D26258EA3003AA3AF /* NotificationViewModel+Diffable.swift in Sources */,
DB6D1B24263684C600ACB481 /* UserDefaults.swift in Sources */,
DB1D186C25EF5BA7003F1F23 /* PollTableView.swift in Sources */,
DBA94434265CBB5300C537E1 /* ProfileFieldSection.swift in Sources */,
@ -4052,7 +4072,7 @@
};
name = Release;
};
DBCBCC0E2680BE3E000F5B51 /* ASDK */ = {
DBCBCC0E2680BE3E000F5B51 /* ASDK - Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
@ -4112,11 +4132,11 @@
SWIFT_ACTIVE_COMPILATION_CONDITIONS = ASDK;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = ASDK;
name = "ASDK - Release";
};
DBCBCC0F2680BE3E000F5B51 /* ASDK */ = {
DBCBCC0F2680BE3E000F5B51 /* ASDK - Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 819CEC9DCAD8E8E7BD85A7BB /* Pods-Mastodon.asdk.xcconfig */;
baseConfigurationReference = BD7598A87F4497045EDEF252 /* Pods-Mastodon.asdk - release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
@ -4139,11 +4159,11 @@
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = ASDK;
name = "ASDK - Release";
};
DBCBCC102680BE3E000F5B51 /* ASDK */ = {
DBCBCC102680BE3E000F5B51 /* ASDK - Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 5DA82A9B4ABDAFA3AB9A49C7 /* Pods-MastodonTests.asdk.xcconfig */;
baseConfigurationReference = 46DAB0EBDDFB678347CD96FF /* Pods-MastodonTests.asdk - release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
@ -4160,11 +4180,11 @@
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mastodon.app/Mastodon";
};
name = ASDK;
name = "ASDK - Release";
};
DBCBCC112680BE3E000F5B51 /* ASDK */ = {
DBCBCC112680BE3E000F5B51 /* ASDK - Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A67FD038ECDA0E411AF8DB4D /* Pods-Mastodon-MastodonUITests.asdk.xcconfig */;
baseConfigurationReference = 8850E70A1D5FF51432E43653 /* Pods-Mastodon-MastodonUITests.asdk - release.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5Z4GVSS33P;
@ -4180,9 +4200,9 @@
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = Mastodon;
};
name = ASDK;
name = "ASDK - Release";
};
DBCBCC122680BE3E000F5B51 /* ASDK */ = {
DBCBCC122680BE3E000F5B51 /* ASDK - Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
@ -4209,9 +4229,9 @@
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = ASDK;
name = "ASDK - Release";
};
DBCBCC132680BE3E000F5B51 /* ASDK */ = {
DBCBCC132680BE3E000F5B51 /* ASDK - Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
@ -4229,11 +4249,11 @@
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mastodon.app/Mastodon";
};
name = ASDK;
name = "ASDK - Release";
};
DBCBCC142680BE3E000F5B51 /* ASDK */ = {
DBCBCC142680BE3E000F5B51 /* ASDK - Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F31E7502A7E3945B98C6CBAF /* Pods-NotificationService.asdk.xcconfig */;
baseConfigurationReference = 9CFF58FD900AC059428700E7 /* Pods-NotificationService.asdk - release.xcconfig */;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements;
CODE_SIGN_STYLE = Automatic;
@ -4252,11 +4272,11 @@
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = ASDK;
name = "ASDK - Release";
};
DBCBCC152680BE3E000F5B51 /* ASDK */ = {
DBCBCC152680BE3E000F5B51 /* ASDK - Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = EE13214BC0246BE5210CCC10 /* Pods-AppShared.asdk.xcconfig */;
baseConfigurationReference = DDB1B139FA8EA26F510D58B6 /* Pods-AppShared.asdk - release.xcconfig */;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ENABLE_MODULES = YES;
@ -4283,7 +4303,240 @@
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = ASDK;
name = "ASDK - Release";
};
DBCBCC1E26818F6F000F5B51 /* ASDK - Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG ASDK";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = "ASDK - Debug";
};
DBCBCC1F26818F6F000F5B51 /* ASDK - Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1D6D967E77A5357E2C6110D9 /* Pods-Mastodon.asdk - debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 16;
DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets";
DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = Mastodon/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.7.1;
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = "ASDK - Debug";
};
DBCBCC2026818F6F000F5B51 /* ASDK - Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7CEFFAE9AF9284B13C0A758D /* Pods-MastodonTests.asdk - debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = MastodonTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.MastodonTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mastodon.app/Mastodon";
};
name = "ASDK - Debug";
};
DBCBCC2126818F6F000F5B51 /* ASDK - Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E5C7236E58D14A0322FE00F2 /* Pods-Mastodon-MastodonUITests.asdk - debug.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = MastodonUITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.MastodonUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = Mastodon;
};
name = "ASDK - Debug";
};
DBCBCC2226818F6F000F5B51 /* ASDK - Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 5Z4GVSS33P;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = CoreDataStack/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.CoreDataStack;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = "ASDK - Debug";
};
DBCBCC2326818F6F000F5B51 /* ASDK - Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = CoreDataStackTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.CoreDataStackTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mastodon.app/Mastodon";
};
name = "ASDK - Debug";
};
DBCBCC2426818F6F000F5B51 /* ASDK - Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3B7FD8F28DDA8FBCE5562B78 /* Pods-NotificationService.asdk - debug.xcconfig */;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 16;
DEVELOPMENT_TEAM = 5Z4GVSS33P;
INFOPLIST_FILE = NotificationService/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 0.7.1;
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = "ASDK - Debug";
};
DBCBCC2526818F6F000F5B51 /* ASDK - Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A9B1FB898DFD6063B044298C /* Pods-AppShared.asdk - debug.xcconfig */;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 5Z4GVSS33P;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = AppShared/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.AppShared;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = "ASDK - Debug";
};
DBF8AE1C263293E400C9C23C /* Debug */ = {
isa = XCBuildConfiguration;
@ -4338,7 +4591,8 @@
isa = XCConfigurationList;
buildConfigurations = (
DB427DFA25BAA00100D1B89D /* Debug */,
DBCBCC0E2680BE3E000F5B51 /* ASDK */,
DBCBCC1E26818F6F000F5B51 /* ASDK - Debug */,
DBCBCC0E2680BE3E000F5B51 /* ASDK - Release */,
DB427DFB25BAA00100D1B89D /* Release */,
);
defaultConfigurationIsVisible = 0;
@ -4348,7 +4602,8 @@
isa = XCConfigurationList;
buildConfigurations = (
DB427DFD25BAA00100D1B89D /* Debug */,
DBCBCC0F2680BE3E000F5B51 /* ASDK */,
DBCBCC1F26818F6F000F5B51 /* ASDK - Debug */,
DBCBCC0F2680BE3E000F5B51 /* ASDK - Release */,
DB427DFE25BAA00100D1B89D /* Release */,
);
defaultConfigurationIsVisible = 0;
@ -4358,7 +4613,8 @@
isa = XCConfigurationList;
buildConfigurations = (
DB427E0025BAA00100D1B89D /* Debug */,
DBCBCC102680BE3E000F5B51 /* ASDK */,
DBCBCC2026818F6F000F5B51 /* ASDK - Debug */,
DBCBCC102680BE3E000F5B51 /* ASDK - Release */,
DB427E0125BAA00100D1B89D /* Release */,
);
defaultConfigurationIsVisible = 0;
@ -4368,7 +4624,8 @@
isa = XCConfigurationList;
buildConfigurations = (
DB427E0325BAA00100D1B89D /* Debug */,
DBCBCC112680BE3E000F5B51 /* ASDK */,
DBCBCC2126818F6F000F5B51 /* ASDK - Debug */,
DBCBCC112680BE3E000F5B51 /* ASDK - Release */,
DB427E0425BAA00100D1B89D /* Release */,
);
defaultConfigurationIsVisible = 0;
@ -4378,7 +4635,8 @@
isa = XCConfigurationList;
buildConfigurations = (
DB6804892637CD4C00430867 /* Debug */,
DBCBCC152680BE3E000F5B51 /* ASDK */,
DBCBCC2526818F6F000F5B51 /* ASDK - Debug */,
DBCBCC152680BE3E000F5B51 /* ASDK - Release */,
DB68048A2637CD4C00430867 /* Release */,
);
defaultConfigurationIsVisible = 0;
@ -4388,7 +4646,8 @@
isa = XCConfigurationList;
buildConfigurations = (
DB89BA0625C10FD0008580ED /* Debug */,
DBCBCC122680BE3E000F5B51 /* ASDK */,
DBCBCC2226818F6F000F5B51 /* ASDK - Debug */,
DBCBCC122680BE3E000F5B51 /* ASDK - Release */,
DB89BA0725C10FD0008580ED /* Release */,
);
defaultConfigurationIsVisible = 0;
@ -4398,7 +4657,8 @@
isa = XCConfigurationList;
buildConfigurations = (
DB89BA0A25C10FD0008580ED /* Debug */,
DBCBCC132680BE3E000F5B51 /* ASDK */,
DBCBCC2326818F6F000F5B51 /* ASDK - Debug */,
DBCBCC132680BE3E000F5B51 /* ASDK - Release */,
DB89BA0B25C10FD0008580ED /* Release */,
);
defaultConfigurationIsVisible = 0;
@ -4408,7 +4668,8 @@
isa = XCConfigurationList;
buildConfigurations = (
DBF8AE1C263293E400C9C23C /* Debug */,
DBCBCC142680BE3E000F5B51 /* ASDK */,
DBCBCC2426818F6F000F5B51 /* ASDK - Debug */,
DBCBCC142680BE3E000F5B51 /* ASDK - Release */,
DBF8AE1D263293E400C9C23C /* Release */,
);
defaultConfigurationIsVisible = 0;

View File

@ -12,7 +12,7 @@
<key>CoreDataStack.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>31</integer>
<integer>34</integer>
</dict>
<key>Mastodon - ASDK.xcscheme_^#shared#^_</key>
<dict>
@ -37,7 +37,7 @@
<key>NotificationService.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>30</integer>
<integer>31</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>

View File

@ -48,8 +48,10 @@ extension SceneCoordinator {
case mastodonResendEmail(viewModel: MastodonResendEmailViewModel)
case mastodonWebView(viewModel:WebViewModel)
#if ASDK
// ASDK
case asyncHome
#endif
// compose
case compose(viewModel: ComposeViewModel)
@ -239,9 +241,11 @@ private extension SceneCoordinator {
let _viewController = WebViewController()
_viewController.viewModel = viewModel
viewController = _viewController
#if ASDK
case .asyncHome:
let _viewController = AsyncHomeTimelineViewController()
viewController = _viewController
#endif
case .compose(let viewModel):
let _viewController = ComposeViewController()
_viewController.viewModel = viewModel

View File

@ -5,6 +5,8 @@
// Created by Cirno MainasuK on 2021-6-19.
//
#if ASDK
import UIKit
import AsyncDisplayKit
import DifferenceKit
@ -79,3 +81,5 @@ extension ASTableNode: ReloadableTableView {
}
}
}
#endif

View File

@ -5,6 +5,8 @@
// Created by Cirno MainasuK on 2021-6-19.
//
#if ASDK
import UIKit
import AsyncDisplayKit
import DiffableDataSources
@ -109,3 +111,5 @@ open class TableNodeDiffableDataSource<SectionIdentifierType: Hashable, ItemIden
return block
}
}
#endif

View File

@ -38,7 +38,7 @@ extension NotificationSection {
}
let createAt = notification.createAt
let timeText = createAt.slowedTimeAgoSinceNow
let timeText = createAt.timeAgoSinceNow
let actionText = type.actionText
let actionImageName = type.actionImageName
@ -65,7 +65,7 @@ extension NotificationSection {
timestampUpdatePublisher
.sink { [weak cell] _ in
guard let cell = cell else { return }
let timeText = createAt.slowedTimeAgoSinceNow
let timeText = createAt.timeAgoSinceNow
cell.actionLabel.text = actionText + " · " + timeText
}
.store(in: &cell.disposeBag)
@ -91,7 +91,7 @@ extension NotificationSection {
timestampUpdatePublisher
.sink { [weak cell] _ in
guard let cell = cell else { return }
let timeText = createAt.slowedTimeAgoSinceNow
let timeText = createAt.timeAgoSinceNow
cell.actionLabel.text = actionText + " · " + timeText
}
.store(in: &cell.disposeBag)

View File

@ -11,9 +11,12 @@ import CoreDataStack
import os.log
import UIKit
import AVKit
import AsyncDisplayKit
import Nuke
#if ASDK
import AsyncDisplayKit
#endif
protocol StatusCell: DisposeBagCollectable {
var statusView: StatusView { get }
var pollCountdownSubscription: AnyCancellable? { get set }
@ -24,6 +27,7 @@ enum StatusSection: Equatable, Hashable {
}
extension StatusSection {
#if ASDK
static func tableNodeDiffableDataSource(
tableNode: ASTableNode,
managedObjectContext: NSManagedObjectContext
@ -49,7 +53,7 @@ extension StatusSection {
}
}
}
#endif
static func tableViewDiffableDataSource(
for tableView: UITableView,

View File

@ -180,7 +180,7 @@ internal enum L10n {
internal static func blockUser(_ p1: Any) -> String {
return L10n.tr("Localizable", "Common.Controls.Firendship.BlockUser", String(describing: p1))
}
/// Edit info
/// Edit Info
internal static let editInfo = L10n.tr("Localizable", "Common.Controls.Firendship.EditInfo")
/// Follow
internal static let follow = L10n.tr("Localizable", "Common.Controls.Firendship.Follow")
@ -843,7 +843,7 @@ internal enum L10n {
internal static let placeholder = L10n.tr("Localizable", "Scene.Search.Searchbar.Placeholder")
}
internal enum Searching {
/// clear
/// Clear
internal static let clear = L10n.tr("Localizable", "Scene.Search.Searching.Clear")
/// Recent searches
internal static let recentSearch = L10n.tr("Localizable", "Scene.Search.Searching.RecentSearch")

View File

@ -5,6 +5,8 @@
// Created by Cirno MainasuK on 2021-6-20.
//
#if ASDK
import Foundation
import ActiveLabel
@ -14,3 +16,5 @@ extension StatusNodeDelegate where Self: StatusProvider {
StatusProviderFacade.responseToStatusActiveLabelAction(provider: self, node: node, didSelectActiveEntityType: type)
}
}
#endif

View File

@ -9,7 +9,10 @@ import UIKit
import Combine
import CoreData
import CoreDataStack
#if ASDK
import AsyncDisplayKit
#endif
protocol StatusProvider: NeedsDependency & DisposeBagCollectable & UIViewController {
// async
@ -23,11 +26,15 @@ protocol StatusProvider: NeedsDependency & DisposeBagCollectable & UIViewControl
func item(for cell: UITableViewCell?, indexPath: IndexPath?) -> Item?
func items(indexPaths: [IndexPath]) -> [Item]
#if ASDK
func status(node: ASCellNode?, indexPath: IndexPath?) -> Status?
#endif
}
#if ASDK
extension StatusProvider {
func status(node: ASCellNode?, indexPath: IndexPath?) -> Status? {
fatalError("Needs implement this")
}
}
#endif

View File

@ -12,7 +12,10 @@ import CoreData
import CoreDataStack
import MastodonSDK
import ActiveLabel
#if ASDK
import AsyncDisplayKit
#endif
enum StatusProviderFacade { }
@ -146,6 +149,7 @@ extension StatusProviderFacade {
}
}
#if ASDK
static func responseToStatusActiveLabelAction(provider: StatusProvider, node: ASCellNode, didSelectActiveEntityType type: ActiveEntityType) {
switch type {
case .hashtag(let text, _):
@ -175,6 +179,7 @@ extension StatusProviderFacade {
guard let status = provider.status(node: node, indexPath: nil) else { return }
coordinateToStatusMentionProfileScene(for: target, provider: provider, status: status, mention: mention)
}
#endif
private static func coordinateToStatusMentionProfileScene(for target: Target, provider: StatusProvider, cell: UITableViewCell, mention: String) {
provider.status(for: cell, indexPath: nil)

View File

@ -1,103 +1,103 @@
{
"images" : [
{
"filename" : "Icon-Small-40.png",
"filename" : "icon_20pt@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "notification-icon@3x.png",
"filename" : "icon_20pt@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "Icon-Small@2x-1.png",
"filename" : "icon_29pt@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "Icon-Small@3x.png",
"filename" : "icon_29pt@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "Icon-Small-40@2x.png",
"filename" : "icon_40pt@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "Icon-60@2x.png",
"filename" : "icon_40pt@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "icon-60@2x-1.png",
"filename" : "icon_60pt@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "Icon-60@3x.png",
"filename" : "icon_60pt@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "notification-icon~ipad.png",
"filename" : "icon_20pt.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "Icon-Small-41.png",
"filename" : "icon_20pt@2x-1.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "Icon-Small.png",
"filename" : "icon_29pt.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "Icon-Small@2x.png",
"filename" : "icon_29pt@2x-1.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "Icon-Small-42.png",
"filename" : "icon_40pt.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "Icon-Small-40@2x-1.png",
"filename" : "icon_40pt@2x-1.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "Icon-76.png",
"filename" : "icon_76pt.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "Icon-76@2x.png",
"filename" : "icon_76pt@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "Icon-83.5@2x.png",
"filename" : "icon_83.5@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 B

View File

@ -60,7 +60,7 @@ Please check your internet connection.";
"Common.Controls.Firendship.BlockDomain" = "Block %@";
"Common.Controls.Firendship.BlockUser" = "Block %@";
"Common.Controls.Firendship.Blocked" = "Blocked";
"Common.Controls.Firendship.EditInfo" = "Edit info";
"Common.Controls.Firendship.EditInfo" = "Edit Info";
"Common.Controls.Firendship.Follow" = "Follow";
"Common.Controls.Firendship.Following" = "Following";
"Common.Controls.Firendship.Mute" = "Mute";
@ -277,7 +277,7 @@ tap the link to confirm your account.";
"Scene.Search.Recommend.HashTag.Title" = "Trending in your timeline";
"Scene.Search.Searchbar.Cancel" = "Cancel";
"Scene.Search.Searchbar.Placeholder" = "Search hashtags and users";
"Scene.Search.Searching.Clear" = "clear";
"Scene.Search.Searching.Clear" = "Clear";
"Scene.Search.Searching.RecentSearch" = "Recent searches";
"Scene.Search.Searching.Segment.All" = "All";
"Scene.Search.Searching.Segment.Hashtags" = "Hashtags";

View File

@ -60,7 +60,7 @@ Please check your internet connection.";
"Common.Controls.Firendship.BlockDomain" = "Block %@";
"Common.Controls.Firendship.BlockUser" = "Block %@";
"Common.Controls.Firendship.Blocked" = "Blocked";
"Common.Controls.Firendship.EditInfo" = "Edit info";
"Common.Controls.Firendship.EditInfo" = "Edit Info";
"Common.Controls.Firendship.Follow" = "Follow";
"Common.Controls.Firendship.Following" = "Following";
"Common.Controls.Firendship.Mute" = "Mute";
@ -277,7 +277,7 @@ tap the link to confirm your account.";
"Scene.Search.Recommend.HashTag.Title" = "Trending in your timeline";
"Scene.Search.Searchbar.Cancel" = "Cancel";
"Scene.Search.Searchbar.Placeholder" = "Search hashtags and users";
"Scene.Search.Searching.Clear" = "clear";
"Scene.Search.Searching.Clear" = "Clear";
"Scene.Search.Searching.RecentSearch" = "Recent searches";
"Scene.Search.Searching.Segment.All" = "All";
"Scene.Search.Searching.Segment.Hashtags" = "Hashtags";

View File

@ -117,10 +117,9 @@ extension HashtagTimelineViewController {
aspectViewWillAppear(animated)
viewModel.fetchTag()
guard viewModel.loadLatestStateMachine.currentState is HashtagTimelineViewModel.LoadLatestState.Initial else { return }
refreshControl.beginRefreshing()
refreshControl.sendActions(for: .valueChanged)
if viewModel.loadLatestStateMachine.currentState is HashtagTimelineViewModel.LoadLatestState.Initial {
viewModel.loadLatestStateMachine.enter(HashtagTimelineViewModel.LoadLatestState.Loading.self)
}
}
override func viewDidDisappear(_ animated: Bool) {

View File

@ -31,6 +31,14 @@ extension HashtagTimelineViewModel {
timelineMiddleLoaderTableViewCellDelegate: timelineMiddleLoaderTableViewCellDelegate,
threadReplyLoaderTableViewCellDelegate: nil
)
var snapshot = NSDiffableDataSourceSnapshot<StatusSection, Item>()
snapshot.appendSections([.main])
diffableDataSource?.apply(snapshot)
// workaround to append loader wrong animation issue
snapshot.appendItems([.bottomLoader], toSection: .main)
diffableDataSource?.apply(snapshot)
}
}

View File

@ -5,12 +5,12 @@
// Created by MainasuK Cirno on 2021-6-21.
//
#if ASDK && DEBUG
import os.log
import UIKit
import CoreData
import CoreDataStack
#if DEBUG
import FLEX
extension AsyncHomeTimelineViewController {
@ -25,10 +25,6 @@ extension AsyncHomeTimelineViewController {
guard let self = self else { return }
self.showFLEXAction(action)
}),
UIAction(title: "Toggle Home", image: nil, identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off, handler: { [weak self] action in
guard let self = self else { return }
self.context.toggleHomePreference(action)
}),
moveMenu,
dropMenu,
UIAction(title: "Show Welcome", image: UIImage(systemName: "figure.walk"), attributes: []) { [weak self] action in
@ -384,4 +380,5 @@ extension AsyncHomeTimelineViewController {
.store(in: &disposeBag)
}
}
#endif

View File

@ -5,6 +5,8 @@
// Created by MainasuK Cirno on 2021-6-21.
//
#if ASDK
import os.log
import UIKit
import Combine
@ -111,3 +113,5 @@ extension AsyncHomeTimelineViewController: StatusProvider {
}
extension AsyncHomeTimelineViewController: UserProvider {}
#endif

View File

@ -5,6 +5,8 @@
// Created by MainasuK Cirno on 2021-6-21.
//
#if ASDK
import os.log
import UIKit
import AVKit
@ -56,16 +58,6 @@ final class AsyncHomeTimelineViewController: ASDKViewController<ASTableNode>, Ne
}()
var tableView: UITableView { node.view }
//let tableView: UITableView = {
// let tableView = ControlContainableTableView()
// tableView.register(StatusTableViewCell.self, forCellReuseIdentifier: String(describing: StatusTableViewCell.self))
// tableView.register(TimelineMiddleLoaderTableViewCell.self, forCellReuseIdentifier: String(describing: TimelineMiddleLoaderTableViewCell.self))
// tableView.register(TimelineBottomLoaderTableViewCell.self, forCellReuseIdentifier: String(describing: TimelineBottomLoaderTableViewCell.self))
// tableView.rowHeight = UITableView.automaticDimension
// tableView.separatorStyle = .none
// tableView.backgroundColor = .clear
// return tableView
//}()
let publishProgressView: UIProgressView = {
let progressView = UIProgressView(progressViewStyle: .bar)
@ -116,25 +108,10 @@ extension AsyncHomeTimelineViewController {
// long press to trigger debug menu
settingBarButtonItem.menu = debugMenu
PerformanceMonitor.shared().delegate = self
#else
settingBarButtonItem.target = self
settingBarButtonItem.action = #selector(AsyncHomeTimelineViewController.settingBarButtonItemPressed(_:))
#endif
settingBarButtonItem.menu = UIMenu(title: "Toggle Home", image: nil, identifier: nil, options: [], children: [
UIAction(title: "Setting", image: nil, identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off, handler: { [weak self] _ in
guard let self = self else { return }
self.settingBarButtonItemPressed(self.settingBarButtonItem)
}),
UIAction(title: "Toggle Home", image: nil, identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off, handler: { [weak self] action in
guard let self = self else { return }
self.context.toggleHomePreference(action)
let alertController = UIAlertController(title: "Please Restart App", message: nil, preferredStyle: .alert)
let okAction = UIAlertAction(title: "OK", style: .default, handler: nil)
alertController.addAction(okAction)
self.coordinator.present(scene: .alertController(alertController: alertController), from: nil, transition: .alertController(animated: true, completion: nil))
})
])
navigationItem.rightBarButtonItem = composeBarButtonItem
composeBarButtonItem.target = self
@ -604,3 +581,5 @@ extension AsyncHomeTimelineViewController: ASTableDelegate {
// MARK: - StatusNodeDelegate
extension AsyncHomeTimelineViewController: StatusNodeDelegate { }
#endif

View File

@ -5,6 +5,8 @@
// Created by MainasuK Cirno on 2021-6-21.
//
#if ASDK
import os.log
import UIKit
import CoreData
@ -153,3 +155,5 @@ extension AsyncHomeTimelineViewModel: NSFetchedResultsControllerDelegate {
}
}
#endif

View File

@ -6,6 +6,8 @@
//
//
#if ASDK
import os.log
import func QuartzCore.CACurrentMediaTime
import Foundation
@ -128,3 +130,5 @@ extension AsyncHomeTimelineViewModel.LoadLatestState {
}
}
#endif

View File

@ -5,6 +5,8 @@
// Created by MainasuK Cirno on 2021-6-21.
//
#if ASDK
import os.log
import Foundation
import GameplayKit
@ -106,3 +108,5 @@ extension AsyncHomeTimelineViewModel.LoadMiddleState {
}
}
#endif

View File

@ -5,6 +5,8 @@
// Created by MainasuK Cirno on 2021-6-21.
//
#if ASDK
import os.log
import Foundation
import GameplayKit
@ -111,3 +113,5 @@ extension AsyncHomeTimelineViewModel.LoadOldestState {
}
}
}
#endif

View File

@ -6,6 +6,8 @@
//
//
#if ASDK
import os.log
import func AVFoundation.AVMakeRect
import UIKit
@ -146,3 +148,5 @@ final class AsyncHomeTimelineViewModel: NSObject {
}
extension AsyncHomeTimelineViewModel: SuggestionAccountViewModelDelegate { }
#endif

View File

@ -25,10 +25,6 @@ extension HomeTimelineViewController {
guard let self = self else { return }
self.showFLEXAction(action)
}),
UIAction(title: "Toggle Home", image: nil, identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off, handler: { [weak self] action in
guard let self = self else { return }
self.context.toggleHomePreference(action)
}),
moveMenu,
dropMenu,
UIAction(title: "Show Welcome", image: UIImage(systemName: "figure.walk"), attributes: []) { [weak self] action in

View File

@ -15,10 +15,6 @@ import GameplayKit
import MastodonSDK
import AlamofireImage
#if DEBUG
import GDPerformanceView_Swift
#endif
final class HomeTimelineViewController: UIViewController, NeedsDependency, MediaPreviewableViewController {
weak var context: AppContext! { willSet { precondition(!isViewLoaded) } }
@ -102,22 +98,6 @@ extension HomeTimelineViewController {
#if DEBUG
// long press to trigger debug menu
settingBarButtonItem.menu = debugMenu
PerformanceMonitor.shared().delegate = self
#elseif ASDK
settingBarButtonItem.menu = UIMenu(title: "Toggle Home", image: nil, identifier: nil, options: [], children: [
UIAction(title: "Setting", image: nil, identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off, handler: { [weak self] _ in
guard let self = self else { return }
self.settingBarButtonItemPressed(self.settingBarButtonItem)
}),
UIAction(title: "Show Async Home", image: nil, identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off, handler: { [weak self] action in
guard let self = self else { return }
self.context.toggleHomePreference(action)
let alertController = UIAlertController(title: "Please Restart App", message: nil, preferredStyle: .alert)
let okAction = UIAlertAction(title: "OK", style: .default, handler: nil)
alertController.addAction(okAction)
self.coordinator.present(scene: .alertController(alertController: alertController), from: nil, transition: .alertController(animated: true, completion: nil))
})
])
#else
settingBarButtonItem.target = self
settingBarButtonItem.action = #selector(HomeTimelineViewController.settingBarButtonItemPressed(_:))
@ -578,11 +558,3 @@ extension HomeTimelineViewController: StatusTableViewControllerNavigateable {
statusKeyCommandHandler(sender)
}
}
#if DEBUG
extension HomeTimelineViewController: PerformanceMonitorDelegate {
func performanceMonitor(didReport performanceReport: PerformanceReport) {
// print(performanceReport)
}
}
#endif

View File

@ -33,9 +33,13 @@ extension HomeTimelineViewModel {
threadReplyLoaderTableViewCellDelegate: nil
)
// var snapshot = NSDiffableDataSourceSnapshot<StatusSection, Item>()
// snapshot.appendSections([.main])
// diffableDataSource?.apply(snapshot)
var snapshot = NSDiffableDataSourceSnapshot<StatusSection, Item>()
snapshot.appendSections([.main])
diffableDataSource?.apply(snapshot)
// workaround to append loader wrong animation issue
snapshot.appendItems([.bottomLoader], toSection: .main)
diffableDataSource?.apply(snapshot)
}
}

View File

@ -10,6 +10,10 @@ import UIKit
import Combine
import SafariServices
#if DEBUG
import GDPerformanceView_Swift
#endif
class MainTabBarController: UITabBarController {
var disposeBag = Set<AnyCancellable>()
@ -185,6 +189,14 @@ extension MainTabBarController {
}
.store(in: &disposeBag)
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
#if DEBUG
PerformanceMonitor.shared().start()
#endif
}
}
@ -345,3 +357,33 @@ extension MainTabBarController {
}
}
#if ASDK
extension MainTabBarController {
override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {
guard let event = event else { return }
switch event.subtype {
case .motionShake:
let alertController = UIAlertController(title: "ASDK Debug Panel", message: nil, preferredStyle: .alert)
let toggleHomeAction = UIAlertAction(title: "Toggle Home", style: .default) { [weak self] _ in
guard let self = self else { return }
MainTabBarController.toggleAsyncHome()
let okAlertController = UIAlertController(title: "Success", message: "Please restart the app", preferredStyle: .alert)
let okAction = UIAlertAction(title: "OK", style: .default, handler: nil)
okAlertController.addAction(okAction)
self.coordinator.present(scene: .alertController(alertController: okAlertController), from: nil, transition: .alertController(animated: true, completion: nil))
}
alertController.addAction(toggleHomeAction)
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
alertController.addAction(cancelAction)
self.coordinator.present(scene: .alertController(alertController: alertController), from: nil, transition: .alertController(animated: true, completion: nil))
default:
break
}
}
static func toggleAsyncHome() {
UserDefaults.shared.preferAsyncHomeTimeline.toggle()
}
}
#endif

View File

@ -18,6 +18,8 @@ final class NotificationViewController: UIViewController, NeedsDependency {
weak var coordinator: SceneCoordinator! { willSet { precondition(!isViewLoaded) } }
var disposeBag = Set<AnyCancellable>()
var observations = Set<NSKeyValueObservation>()
private(set) lazy var viewModel = NotificationViewModel(context: context)
let segmentControl: UISegmentedControl = {
@ -48,8 +50,13 @@ extension NotificationViewController {
super.viewDidLoad()
view.backgroundColor = Asset.Colors.Background.secondarySystemBackground.color
segmentControl.translatesAutoresizingMaskIntoConstraints = false
navigationItem.titleView = segmentControl
NSLayoutConstraint.activate([
segmentControl.widthAnchor.constraint(equalToConstant: 287)
])
segmentControl.addTarget(self, action: #selector(NotificationViewController.segmentedControlValueChanged(_:)), for: .valueChanged)
tableView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(tableView)
NSLayoutConstraint.activate([
@ -81,6 +88,17 @@ extension NotificationViewController {
}
}
.store(in: &disposeBag)
viewModel.dataSourceDidUpdated
.receive(on: RunLoop.main)
.sink { [weak self] in
guard let self = self else { return }
self.viewModel.needsScrollToTopAfterDataSourceUpdate = false
DispatchQueue.main.asyncAfter(deadline: .now() + 0.33) {
self.scrollToTop(animated: true)
}
}
.store(in: &disposeBag)
viewModel.selectedIndex
.removeDuplicates()
@ -92,6 +110,9 @@ extension NotificationViewController {
guard let domain = self.viewModel.activeMastodonAuthenticationBox.value?.domain, let userID = self.viewModel.activeMastodonAuthenticationBox.value?.userID else {
return
}
self.viewModel.needsScrollToTopAfterDataSourceUpdate = true
switch segment {
case .EveryThing:
self.viewModel.notificationPredicate.value = MastodonNotification.predicate(domain: domain, userID: userID)
@ -100,6 +121,15 @@ extension NotificationViewController {
}
}
.store(in: &disposeBag)
segmentControl.observe(\.selectedSegmentIndex, options: [.new]) { [weak self] segmentControl, _ in
guard let self = self else { return }
// scroll to top when select same segment
if segmentControl.selectedSegmentIndex == self.viewModel.selectedIndex.value.rawValue {
self.scrollToTop(animated: true)
}
}
.store(in: &observations)
}
override func viewWillAppear(_ animated: Bool) {
@ -277,6 +307,18 @@ extension NotificationViewController {
}
}
// MARK: - ScrollViewContainer
extension NotificationViewController: ScrollViewContainer {
var scrollView: UIScrollView { tableView }
func scrollToTop(animated: Bool) {
let indexPath = IndexPath(row: 0, section: 0)
guard viewModel.diffableDataSource?.itemIdentifier(for: indexPath) != nil else { return }
tableView.scrollToRow(at: indexPath, at: .top, animated: true)
}
}
extension NotificationViewController: LoadMoreConfigurableTableViewContainer {
typealias BottomLoaderTableViewCell = TimelineBottomLoaderTableViewCell
typealias LoadingState = NotificationViewModel.LoadOldestState.Loading

View File

@ -1,5 +1,5 @@
//
// NotificationViewModel+diffable.swift
// NotificationViewModel+Diffable.swift
// Mastodon
//
// Created by sxiaojian on 2021/4/13.
@ -29,6 +29,14 @@ extension NotificationViewModel {
delegate: delegate,
dependency: dependency
)
var snapshot = NSDiffableDataSourceSnapshot<NotificationSection, NotificationItem>()
snapshot.appendSections([.main])
diffableDataSource.apply(snapshot)
// workaround to append loader wrong animation issue
snapshot.appendItems([.bottomLoader], toSection: .main)
diffableDataSource.apply(snapshot)
}
}
@ -87,55 +95,15 @@ extension NotificationViewModel: NSFetchedResultsControllerDelegate {
if !notifications.isEmpty, self.noMoreNotification.value == false {
newSnapshot.appendItems([.bottomLoader], toSection: .main)
}
guard let difference = self.calculateReloadSnapshotDifference(navigationBar: navigationBar, tableView: tableView, oldSnapshot: oldSnapshot, newSnapshot: newSnapshot) else {
diffableDataSource.apply(newSnapshot, animatingDifferences: false)
self.isFetchingLatestNotification.value = false
tableView.reloadData()
return
}
diffableDataSource.apply(newSnapshot, animatingDifferences: false) {
tableView.scrollToRow(at: difference.targetIndexPath, at: .top, animated: false)
tableView.contentOffset.y = tableView.contentOffset.y - difference.offset
self.isFetchingLatestNotification.value = false
self.isFetchingLatestNotification.value = false
diffableDataSource.apply(newSnapshot, animatingDifferences: false) { [weak self] in
guard let self = self else { return }
self.dataSourceDidUpdated.send()
}
}
}
}
private struct Difference<T> {
let item: T
let sourceIndexPath: IndexPath
let targetIndexPath: IndexPath
let offset: CGFloat
}
private func calculateReloadSnapshotDifference<T: Hashable>(
navigationBar: UINavigationBar,
tableView: UITableView,
oldSnapshot: NSDiffableDataSourceSnapshot<NotificationSection, T>,
newSnapshot: NSDiffableDataSourceSnapshot<NotificationSection, T>
) -> Difference<T>? {
guard oldSnapshot.numberOfItems != 0 else { return nil }
// old snapshot not empty. set source index path to first item if not match
let sourceIndexPath = UIViewController.topVisibleTableViewCellIndexPath(in: tableView, navigationBar: navigationBar) ?? IndexPath(row: 0, section: 0)
guard sourceIndexPath.row < oldSnapshot.itemIdentifiers(inSection: .main).count else { return nil }
if oldSnapshot.itemIdentifiers.elementsEqual(newSnapshot.itemIdentifiers) {
return nil
}
let timelineItem = oldSnapshot.itemIdentifiers(inSection: .main)[sourceIndexPath.row]
guard let itemIndex = newSnapshot.itemIdentifiers(inSection: .main).firstIndex(of: timelineItem) else { return nil }
let targetIndexPath = IndexPath(row: itemIndex, section: 0)
let offset = UIViewController.tableViewCellOriginOffsetToWindowTop(in: tableView, at: sourceIndexPath, navigationBar: navigationBar)
return Difference(
item: timelineItem,
sourceIndexPath: sourceIndexPath,
targetIndexPath: targetIndexPath,
offset: offset
)
}
}

View File

@ -31,10 +31,13 @@ final class NotificationViewModel: NSObject {
let notificationPredicate = CurrentValueSubject<NSPredicate?, Never>(nil)
let cellFrameCache = NSCache<NSNumber, NSValue>()
var needsScrollToTopAfterDataSourceUpdate = false
let dataSourceDidUpdated = PassthroughSubject<Void, Never>()
let isFetchingLatestNotification = CurrentValueSubject<Bool, Never>(false)
// output
var diffableDataSource: UITableViewDiffableDataSource<NotificationSection, NotificationItem>!
// top loader
private(set) lazy var loadLatestStateMachine: GKStateMachine = {
// exclude timeline middle fetcher state

View File

@ -220,6 +220,9 @@ extension ProfileHeaderViewController {
super.viewDidAppear(animated)
viewModel.viewDidAppear.value = true
// set display after view appear
profileHeaderView.setupAvatarOverlayViews()
}
override func viewDidLayoutSubviews() {

View File

@ -144,7 +144,7 @@ extension ProfileHeaderViewModel {
return html?.text
}
// check if profile chagned or not
// check if profile change or not
func isProfileInfoEdited() -> Bool {
guard isEditing.value else { return false }

View File

@ -73,10 +73,15 @@ final class ProfileHeaderView: UIView {
imageView.image = placeholderImage
return imageView
}()
func setupAvatarOverlayViews() {
editAvatarBackgroundView.backgroundColor = UIColor.black.withAlphaComponent(0.6)
editAvatarButton.tintColor = .white
}
let editAvatarBackgroundView: UIView = {
let view = UIView()
view.backgroundColor = UIColor.black.withAlphaComponent(0.6)
view.backgroundColor = .clear // set value after view appeared
view.layer.masksToBounds = true
view.layer.cornerCurve = .continuous
view.layer.cornerRadius = ProfileHeaderView.avatarImageViewCornerRadius
@ -87,7 +92,7 @@ final class ProfileHeaderView: UIView {
let editAvatarButton: HighlightDimmableButton = {
let button = HighlightDimmableButton()
button.setImage(UIImage(systemName: "photo", withConfiguration: UIImage.SymbolConfiguration(pointSize: 28)), for: .normal)
button.tintColor = .white
button.tintColor = .clear
return button
}()

View File

@ -58,7 +58,7 @@ final class ProfileViewController: UIViewController, NeedsDependency, MediaPrevi
let refreshControl: UIRefreshControl = {
let refreshControl = UIRefreshControl()
refreshControl.tintColor = .label
refreshControl.tintColor = .white
return refreshControl
}()

View File

@ -32,6 +32,9 @@ extension UserTimelineViewModel {
// set empty section to make update animation top-to-bottom style
var snapshot = NSDiffableDataSourceSnapshot<StatusSection, Item>()
snapshot.appendSections([.main])
diffableDataSource?.apply(snapshot)
// workaround to append loader wrong animation issue
snapshot.appendItems([.bottomLoader], toSection: .main)
diffableDataSource?.apply(snapshot)
}

View File

@ -222,10 +222,16 @@ class ReportViewController: UIViewController, NeedsDependency {
let padding = contentFrame.maxY - endFrame.minY
guard padding > 0 else {
self.bottomConstraint.constant = 0.0
UIView.animate(withDuration: 0.33) {
self.view.layoutIfNeeded()
}
return
}
self.bottomConstraint.constant = padding
UIView.animate(withDuration: 0.33) {
self.view.layoutIfNeeded()
}
})
.store(in: &disposeBag)
}

View File

@ -90,6 +90,13 @@ class SearchRecommendAccountsCollectionViewCell: UICollectionViewCell {
super.init(coder: coder)
configure()
}
override var isHighlighted: Bool {
didSet {
contentView.alpha = isHighlighted ? 0.8 : 1.0
}
}
}
extension SearchRecommendAccountsCollectionViewCell {

View File

@ -51,6 +51,12 @@ class SearchRecommendTagsCollectionViewCell: UICollectionViewCell {
super.init(coder: coder)
configure()
}
override var isHighlighted: Bool {
didSet {
backgroundColor = isHighlighted ? Asset.Colors.brandBlueDarken20.color : Asset.Colors.brandBlue.color
}
}
}
extension SearchRecommendTagsCollectionViewCell {
@ -106,7 +112,7 @@ extension SearchRecommendTagsCollectionViewCell {
flameIconView.translatesAutoresizingMaskIntoConstraints = false
horizontalStackView.addArrangedSubview(flameIconView)
flameIconView.setContentHuggingPriority(.required - 1, for: .horizontal)
containerStackView.addArrangedSubview(horizontalStackView)
peopleLabel.translatesAutoresizingMaskIntoConstraints = false

View File

@ -29,6 +29,7 @@ extension SearchViewController {
searchingTableView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor),
])
searchingTableView.tableFooterView = UIView()
searchingTableView.backgroundColor = Asset.Colors.Background.systemGroupedBackground.color
viewModel.isSearching
.receive(on: DispatchQueue.main)
.sink { [weak self] isSearching in

View File

@ -54,7 +54,7 @@ final class SearchingTableViewCell: UITableViewCell {
extension SearchingTableViewCell {
private func configure() {
backgroundColor = .clear
backgroundColor = Asset.Colors.Background.systemBackground.color
let containerStackView = UIStackView()
containerStackView.axis = .horizontal
@ -115,11 +115,11 @@ extension SearchingTableViewCell {
let image = UIImage(systemName: "number.circle.fill", withConfiguration: UIImage.SymbolConfiguration(pointSize: 34, weight: .regular))!.withRenderingMode(.alwaysTemplate)
_imageView.image = image
_titleLabel.text = "# " + tag.name
guard let historys = tag.history else {
guard let histories = tag.history else {
_subTitleLabel.text = ""
return
}
let recentHistory = historys.prefix(2)
let recentHistory = histories.prefix(2)
let peopleAreTalking = recentHistory.compactMap { Int($0.accounts) }.reduce(0, +)
let string = L10n.Scene.Search.Recommend.HashTag.peopleTalking(String(peopleAreTalking))
_subTitleLabel.text = string
@ -129,13 +129,13 @@ extension SearchingTableViewCell {
let image = UIImage(systemName: "number.circle.fill", withConfiguration: UIImage.SymbolConfiguration(pointSize: 34, weight: .regular))!.withRenderingMode(.alwaysTemplate)
_imageView.image = image
_titleLabel.text = "# " + tag.name
guard let historys = tag.histories?.sorted(by: {
guard let histories = tag.histories?.sorted(by: {
$0.createAt.compare($1.createAt) == .orderedAscending
}) else {
_subTitleLabel.text = ""
return
}
let recentHistory = historys.prefix(2)
let recentHistory = histories.prefix(2)
let peopleAreTalking = recentHistory.compactMap { Int($0.accounts) }.reduce(0, +)
let string = L10n.Scene.Search.Recommend.HashTag.peopleTalking(String(peopleAreTalking))
_subTitleLabel.text = string

View File

@ -24,18 +24,21 @@ final class MosaicImageViewContainer: UIView {
weak var delegate: MosaicImageViewContainerDelegate?
let container = UIStackView()
var imageViews: [UIImageView] = [] {
didSet {
imageViews.forEach { imageView in
imageView.isUserInteractionEnabled = true
let tapGesture = UITapGestureRecognizer.singleTapGestureRecognizer
tapGesture.addTarget(self, action: #selector(MosaicImageViewContainer.photoTapGestureRecognizerHandler(_:)))
imageView.addGestureRecognizer(tapGesture)
imageView.isAccessibilityElement = true
}
private(set) lazy var imageViews: [UIImageView] = {
(0..<4).map { _ -> UIImageView in
let imageView = UIImageView()
imageView.isUserInteractionEnabled = true
let tapGesture = UITapGestureRecognizer.singleTapGestureRecognizer
tapGesture.addTarget(self, action: #selector(MosaicImageViewContainer.photoTapGestureRecognizerHandler(_:)))
imageView.addGestureRecognizer(tapGesture)
imageView.isAccessibilityElement = true
imageView.backgroundColor = .systemFill
return imageView
}
}
var blurhashOverlayImageViews: [UIImageView] = []
}()
let blurhashOverlayImageViews: [UIImageView] = {
(0..<4).map { _ in UIImageView() }
}()
let contentWarningOverlayView: ContentWarningOverlayView = {
let contentWarningOverlayView = ContentWarningOverlayView()
@ -97,12 +100,19 @@ extension MosaicImageViewContainer {
container.subviews.forEach { subview in
subview.removeFromSuperview()
}
imageViews.forEach { imageView in
imageView.constraints.forEach { imageView.removeConstraint($0) }
imageView.removeFromSuperview()
}
blurhashOverlayImageViews.forEach { imageView in
imageView.constraints.forEach { imageView.removeConstraint($0) }
imageView.removeFromSuperview()
}
contentWarningOverlayView.removeFromSuperview()
contentWarningOverlayView.blurVisualEffectView.effect = ContentWarningOverlayView.blurVisualEffect
contentWarningOverlayView.vibrancyVisualEffectView.alpha = 1.0
contentWarningOverlayView.isUserInteractionEnabled = true
imageViews = []
blurhashOverlayImageViews = []
container.spacing = UIView.separatorLineHeight(of: self) * 2 // 2px
}
@ -129,8 +139,7 @@ extension MosaicImageViewContainer {
}()
let imageViewFrame = CGRect(origin: .zero, size: imageViewSize)
let imageView = UIImageView(frame: imageViewFrame)
imageViews.append(imageView)
let imageView = imageViews[0]
imageView.layer.masksToBounds = true
imageView.layer.cornerRadius = ContentWarningOverlayView.cornerRadius
imageView.layer.cornerCurve = .continuous
@ -147,12 +156,11 @@ extension MosaicImageViewContainer {
containerHeightLayoutConstraint.constant = imageViewFrame.height
containerHeightLayoutConstraint.isActive = true
let blurhashOverlayImageView = UIImageView()
let blurhashOverlayImageView = blurhashOverlayImageViews[0]
blurhashOverlayImageView.layer.masksToBounds = true
blurhashOverlayImageView.layer.cornerRadius = ContentWarningOverlayView.cornerRadius
blurhashOverlayImageView.layer.cornerCurve = .continuous
blurhashOverlayImageView.contentMode = .scaleAspectFill
blurhashOverlayImageViews.append(blurhashOverlayImageView)
blurhashOverlayImageView.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(blurhashOverlayImageView)
NSLayoutConstraint.activate([
@ -200,14 +208,9 @@ extension MosaicImageViewContainer {
container.addArrangedSubview(contentLeftStackView)
container.addArrangedSubview(contentRightStackView)
var imageViews: [UIImageView] = []
var blurhashOverlayImageViews: [UIImageView] = []
for _ in 0..<count {
imageViews.append(UIImageView())
blurhashOverlayImageViews.append(UIImageView())
}
self.imageViews.append(contentsOf: imageViews)
self.blurhashOverlayImageViews.append(contentsOf: blurhashOverlayImageViews)
let imageViews: [UIImageView] = (0..<count).map { i in self.imageViews[i] }
let blurhashOverlayImageViews: [UIImageView] = (0..<count).map { i in self.blurhashOverlayImageViews[i] }
imageViews.forEach { imageView in
imageView.layer.masksToBounds = true
imageView.layer.cornerRadius = ContentWarningOverlayView.cornerRadius

View File

@ -5,6 +5,8 @@
// Created by Cirno MainasuK on 2021-6-20.
//
#if ASDK
import UIKit
import AsyncDisplayKit
@ -19,3 +21,5 @@ final class ASMetaEditableTextNode: ASEditableTextNode, UITextViewDelegate {
return metaEditableTextNodeDelegate?.metaEditableTextNode(self, shouldInteractWith: URL, in: characterRange, interaction: interaction) ?? false
}
}
#endif

View File

@ -5,6 +5,8 @@
// Created by Cirno MainasuK on 2021-6-19.
//
#if ASDK
import UIKit
import Combine
import AsyncDisplayKit
@ -235,3 +237,5 @@ extension StatusNode: ASMultiplexImageNodeDataSource {
}
}
}
#endif

View File

@ -5,6 +5,8 @@
// Created by Cirno MainasuK on 2021-6-19.
//
#if ASDK
import UIKit
import AsyncDisplayKit
@ -35,3 +37,5 @@ final class TimelineBottomLoaderNode: ASCellNode {
}
}
#endif

View File

@ -5,6 +5,8 @@
// Created by Cirno MainasuK on 2021-6-19.
//
#if ASDK
import UIKit
import AsyncDisplayKit
@ -48,3 +50,5 @@ final class TimelineMiddleLoaderNode: ASCellNode {
}
}
#endif

View File

@ -211,9 +211,3 @@ extension AppContext {
}
}
extension AppContext {
@objc func toggleHomePreference(_ action: UIAction) {
UserDefaults.shared.preferAsyncHomeTimeline.toggle()
}
}

View File

@ -9,12 +9,15 @@ import os.log
import UIKit
import UserNotifications
import AppShared
import AsyncDisplayKit
#if DEBUG
import GDPerformanceView_Swift
#endif
#if ASDK
import AsyncDisplayKit
#endif
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
@ -32,7 +35,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
UNUserNotificationCenter.current().delegate = self
application.registerForRemoteNotifications()
#if DEBUG
#if ASDK && DEBUG
// PerformanceMonitor.shared().start()
// ASDisplayNode.shouldShowRangeDebugOverlay = true
// ASControlNode.enableHitTestDebug = true

View File

@ -1,5 +1,7 @@
// ref: https://github.com/Adlai-Holler/ASDKPlaceholderTest/blob/eea9fa7cff2d16a57efb47d208422ea9b49a630a/ASDKPlaceholderTest/ASDisplayNodeSubclasses.swift
#if ASDK
import Foundation
import AsyncDisplayKit
import UIKit
@ -69,3 +71,5 @@ class ActivityIndicatorNode: ASDisplayNode {
}
}
}
#endif

View File

@ -8,7 +8,7 @@ target 'Mastodon' do
# UI
pod 'UITextField+Shake', '~> 1.2'
pod 'Texture', '~> 3.0.0'
pod 'Texture', '~> 3.0.0', :configurations => ['ASDK - Debug', 'ASDK - Release']
# misc
pod 'SwiftGen', '~> 6.4.0'
@ -16,8 +16,8 @@ target 'Mastodon' do
pod 'Kanna', '~> 5.2.2'
# DEBUG
pod 'FLEX', '~> 4.4.0', :configurations => ['Debug']
pod 'GDPerformanceView-Swift', '~> 2.1.1', :configurations => ['Debug']
pod 'FLEX', '~> 4.4.0', :configurations => ['Debug', 'ASDK - Debug']
pod 'GDPerformanceView-Swift', '~> 2.1.1', :configurations => ['Debug', 'ASDK - Debug']
target 'MastodonTests' do
inherit! :search_paths

View File

@ -82,6 +82,6 @@ SPEC CHECKSUMS:
Texture: 2f109e937850d94d1d07232041c9c7313ccddb81
"UITextField+Shake": 298ac5a0f239d731bdab999b19b628c956ca0ac3
PODFILE CHECKSUM: ffa234348a25b078905180858ee4119fec0712d1
PODFILE CHECKSUM: a0d0a385a2888802244e7841940a7d5a55315e1f
COCOAPODS: 1.10.1