mirror of
https://github.com/Finb/Bark.git
synced 2025-12-08 21:36:01 +00:00
支持夜间模式
This commit is contained in:
parent
199768be3e
commit
2be2448fc5
@ -84,6 +84,7 @@
|
||||
0672CB06256903F700570C9D /* MessageListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0672CB05256903F700570C9D /* MessageListViewModel.swift */; };
|
||||
067B2EB525693E38008B6BE1 /* MessageTableViewCellViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 067B2EB425693E38008B6BE1 /* MessageTableViewCellViewModel.swift */; };
|
||||
06802E5320ECC40C00767047 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0661A549204FDA4100965E4E /* Assets.xcassets */; };
|
||||
06840DBB272298FB001B3193 /* BKColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06840DBA272298FB001B3193 /* BKColor.swift */; };
|
||||
06885EB6247FB9880004A303 /* MessageSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06885EB5247FB9880004A303 /* MessageSettingsViewController.swift */; };
|
||||
068F66B3247BD84C00DAD25A /* MessageListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 068F66B2247BD84C00DAD25A /* MessageListViewController.swift */; };
|
||||
06AE3118266F4E2E00B39FBB /* GroupFilterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06AE3117266F4E2E00B39FBB /* GroupFilterViewController.swift */; };
|
||||
@ -244,6 +245,7 @@
|
||||
0683486A2050F1310024B6DA /* Bark.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Bark.entitlements; sourceTree = "<group>"; };
|
||||
0683487020510FB20024B6DA /* UserNotifications.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotifications.framework; path = System/Library/Frameworks/UserNotifications.framework; sourceTree = SDKROOT; };
|
||||
0683487220510FB20024B6DA /* UserNotificationsUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UserNotificationsUI.framework; path = System/Library/Frameworks/UserNotificationsUI.framework; sourceTree = SDKROOT; };
|
||||
06840DBA272298FB001B3193 /* BKColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BKColor.swift; sourceTree = "<group>"; };
|
||||
06885EB5247FB9880004A303 /* MessageSettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageSettingsViewController.swift; sourceTree = "<group>"; };
|
||||
068F66B2247BD84C00DAD25A /* MessageListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageListViewController.swift; sourceTree = "<group>"; };
|
||||
06AE3117266F4E2E00B39FBB /* GroupFilterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupFilterViewController.swift; sourceTree = "<group>"; };
|
||||
@ -451,6 +453,7 @@
|
||||
06C5953224811505006B98F3 /* ArchiveSettingManager.swift */,
|
||||
06BBB8C82567B6730076F63E /* Operators.swift */,
|
||||
0633E809256A091B00ED0680 /* MJRefresh+Rx.swift */,
|
||||
06840DBA272298FB001B3193 /* BKColor.swift */,
|
||||
);
|
||||
path = Common;
|
||||
sourceTree = "<group>";
|
||||
@ -910,6 +913,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
06840DBB272298FB001B3193 /* BKColor.swift in Sources */,
|
||||
06C2CF232685B88D0034B127 /* TextCell.swift in Sources */,
|
||||
06BBB896256518760076F63E /* NewServerViewModel.swift in Sources */,
|
||||
06BBB8C92567B6730076F63E /* Operators.swift in Sources */,
|
||||
|
||||
@ -51,11 +51,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
||||
setupRealm()
|
||||
|
||||
self.window = UIWindow(frame: UIScreen.main.bounds)
|
||||
if #available(iOS 13.0, *) {
|
||||
self.window?.overrideUserInterfaceStyle = .light
|
||||
}
|
||||
let tabBarController = StateStorageTabBarController()
|
||||
tabBarController.tabBar.tintColor = UIColor.black
|
||||
tabBarController.tabBar.tintColor = BKColor.grey.darken4
|
||||
|
||||
self.window?.backgroundColor = UIColor.black
|
||||
self.window?.rootViewController = BarkSnackbarController(
|
||||
@ -96,7 +93,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
||||
let bar = UINavigationBar.appearance(whenContainedInInstancesOf: [BarkNavigationController.self])
|
||||
bar.backIndicatorImage = UIImage(named: "back")
|
||||
bar.backIndicatorTransitionMaskImage = UIImage(named: "back")
|
||||
bar.tintColor = Color.darkText.primary
|
||||
bar.tintColor = BKColor.grey.darken4
|
||||
|
||||
return true
|
||||
}
|
||||
@ -123,8 +120,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
||||
|
||||
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
|
||||
if let dict = userInfo as? [String: NSObject],
|
||||
let notification = CKNotification(fromRemoteNotificationDictionary: dict),
|
||||
let subscriptionID = notification.subscriptionID, IceCreamSubscription.allIDs.contains(subscriptionID) {
|
||||
let notification = CKNotification(fromRemoteNotificationDictionary: dict),
|
||||
let subscriptionID = notification.subscriptionID, IceCreamSubscription.allIDs.contains(subscriptionID)
|
||||
{
|
||||
NotificationCenter.default.post(name: Notifications.cloudKitDataDidChangeRemotely.name, object: nil, userInfo: userInfo)
|
||||
completionHandler(.newData)
|
||||
}
|
||||
|
||||
6
Bark/Assets.xcassets/Colors/Contents.json
Normal file
6
Bark/Assets.xcassets/Colors/Contents.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "245",
|
||||
"green" : "245",
|
||||
"red" : "245"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0",
|
||||
"green" : "0",
|
||||
"red" : "0"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "255",
|
||||
"green" : "255",
|
||||
"red" : "255"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "22",
|
||||
"green" : "22",
|
||||
"red" : "22"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
38
Bark/Assets.xcassets/Colors/blue_base.colorset/Contents.json
Normal file
38
Bark/Assets.xcassets/Colors/blue_base.colorset/Contents.json
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "243",
|
||||
"green" : "150",
|
||||
"red" : "33"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "243",
|
||||
"green" : "150",
|
||||
"red" : "33"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "229",
|
||||
"green" : "136",
|
||||
"red" : "30"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "245",
|
||||
"green" : "165",
|
||||
"red" : "66"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "0.870",
|
||||
"blue" : "255",
|
||||
"green" : "255",
|
||||
"red" : "255"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "0.870",
|
||||
"blue" : "0",
|
||||
"green" : "0",
|
||||
"red" : "0"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "0.540",
|
||||
"blue" : "255",
|
||||
"green" : "255",
|
||||
"red" : "255"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "0.540",
|
||||
"blue" : "0",
|
||||
"green" : "0",
|
||||
"red" : "0"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
38
Bark/Assets.xcassets/Colors/grey_base.colorset/Contents.json
Normal file
38
Bark/Assets.xcassets/Colors/grey_base.colorset/Contents.json
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "158",
|
||||
"green" : "158",
|
||||
"red" : "158"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "97",
|
||||
"green" : "97",
|
||||
"red" : "97"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "117",
|
||||
"green" : "117",
|
||||
"red" : "117"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "189",
|
||||
"green" : "189",
|
||||
"red" : "189"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "97",
|
||||
"green" : "97",
|
||||
"red" : "97"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "224",
|
||||
"green" : "224",
|
||||
"red" : "224"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "66",
|
||||
"green" : "66",
|
||||
"red" : "66"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "238",
|
||||
"green" : "238",
|
||||
"red" : "238"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "33",
|
||||
"green" : "33",
|
||||
"red" : "33"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "245",
|
||||
"green" : "245",
|
||||
"red" : "245"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "189",
|
||||
"green" : "189",
|
||||
"red" : "189"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "117",
|
||||
"green" : "117",
|
||||
"red" : "117"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "238",
|
||||
"green" : "238",
|
||||
"red" : "238"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "66",
|
||||
"green" : "66",
|
||||
"red" : "66"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "245",
|
||||
"green" : "245",
|
||||
"red" : "245"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "33",
|
||||
"green" : "33",
|
||||
"red" : "33"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "250",
|
||||
"green" : "250",
|
||||
"red" : "250"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "28",
|
||||
"green" : "28",
|
||||
"red" : "28"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "189",
|
||||
"green" : "119",
|
||||
"red" : "2"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "250",
|
||||
"green" : "212",
|
||||
"red" : "129"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
38
Bark/Assets.xcassets/Colors/white.colorset/Contents.json
Normal file
38
Bark/Assets.xcassets/Colors/white.colorset/Contents.json
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "1.000",
|
||||
"green" : "1.000",
|
||||
"red" : "1.000"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
},
|
||||
{
|
||||
"appearances" : [
|
||||
{
|
||||
"appearance" : "luminosity",
|
||||
"value" : "dark"
|
||||
}
|
||||
],
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0.000",
|
||||
"green" : "0.000",
|
||||
"red" : "0.000"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" systemVersion="17A277" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19162" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19144"/>
|
||||
<capability name="Named colors" minToolsVersion="9.0"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
@ -11,10 +14,10 @@
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
<color key="backgroundColor" name="background"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
@ -22,4 +25,9 @@
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<namedColor name="background">
|
||||
<color red="0.96078431372549022" green="0.96078431372549022" blue="0.96078431372549022" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</namedColor>
|
||||
</resources>
|
||||
</document>
|
||||
|
||||
40
Common/BKColor.swift
Normal file
40
Common/BKColor.swift
Normal file
@ -0,0 +1,40 @@
|
||||
//
|
||||
// BKColor.swift
|
||||
// Bark
|
||||
//
|
||||
// Created by huangfeng on 2021/10/22.
|
||||
// Copyright © 2021 Fin. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class BKColor: NSObject {
|
||||
|
||||
enum grey {
|
||||
public static let base = UIColor(named: "grey_base")!
|
||||
public static let darken1 = UIColor(named: "grey_darken1")!
|
||||
public static let darken2 = UIColor(named: "grey_darken2")!
|
||||
public static let darken3 = UIColor(named: "grey_darken3")!
|
||||
public static let darken4 = UIColor(named: "grey_darken4")!
|
||||
public static let lighten1 = UIColor(named: "grey_lighten1")!
|
||||
public static let lighten3 = UIColor(named: "grey_lighten3")!
|
||||
public static let lighten4 = UIColor(named: "grey_lighten4")!
|
||||
public static let lighten5 = UIColor(named: "grey_lighten5")!
|
||||
}
|
||||
|
||||
enum blue {
|
||||
public static let base = UIColor(named: "blue_base")!
|
||||
public static let darken1 = UIColor(named: "blue_darken1")!
|
||||
}
|
||||
|
||||
enum lightBlue {
|
||||
public static let darken3 = UIColor(named: "lightBlue_darken3")!
|
||||
}
|
||||
|
||||
public static let white = UIColor(named: "white")!
|
||||
|
||||
enum background {
|
||||
public static let primary = UIColor(named: "background")!
|
||||
public static let secondary = UIColor(named: "background_seconday")!
|
||||
}
|
||||
}
|
||||
@ -14,7 +14,7 @@ class BaseViewController: UIViewController {
|
||||
self.viewModel = viewModel
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
|
||||
self.view.backgroundColor = Color.grey.lighten5
|
||||
self.view.backgroundColor = BKColor.background.primary
|
||||
}
|
||||
|
||||
@available(*, unavailable)
|
||||
|
||||
@ -36,8 +36,8 @@ class GroupFilterViewController: BaseViewController {
|
||||
let tableView: UITableView = {
|
||||
let tableView = UITableView(frame: CGRect.zero, style: .insetGrouped)
|
||||
tableView.separatorStyle = .singleLine
|
||||
tableView.separatorColor = Color.grey.lighten3
|
||||
tableView.backgroundColor = Color.grey.lighten5
|
||||
tableView.separatorColor = BKColor.grey.lighten3
|
||||
tableView.backgroundColor = BKColor.background.primary
|
||||
tableView.register(GroupTableViewCell.self, forCellReuseIdentifier: "\(GroupTableViewCell.self)")
|
||||
return tableView
|
||||
}()
|
||||
|
||||
@ -16,13 +16,14 @@ class HomeViewController: BaseViewController {
|
||||
let newButton: BKButton = {
|
||||
let btn = BKButton()
|
||||
btn.setImage(Icon.add, for: .normal)
|
||||
btn.imageView?.tintColor = BKColor.grey.darken4
|
||||
btn.frame = CGRect(x: 0, y: 0, width: 40, height: 40)
|
||||
return btn
|
||||
}()
|
||||
|
||||
let startButton: FABButton = {
|
||||
let button = FABButton(title: NSLocalizedString("RegisterDevice"))
|
||||
button.backgroundColor = Color.white
|
||||
button.backgroundColor = BKColor.white
|
||||
button.transition([.scale(0.75), .opacity(0)])
|
||||
return button
|
||||
}()
|
||||
@ -30,14 +31,14 @@ class HomeViewController: BaseViewController {
|
||||
let tableView: UITableView = {
|
||||
let tableView = UITableView()
|
||||
tableView.separatorStyle = .none
|
||||
tableView.backgroundColor = Color.grey.lighten4
|
||||
tableView.backgroundColor = BKColor.background.primary
|
||||
tableView.register(PreviewCardCell.self, forCellReuseIdentifier: "\(PreviewCardCell.self)")
|
||||
tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 20, right: 0)
|
||||
return tableView
|
||||
}()
|
||||
|
||||
override func makeUI() {
|
||||
self.view.backgroundColor = Color.grey.lighten4
|
||||
self.view.backgroundColor = BKColor.background.primary
|
||||
|
||||
navigationItem.setRightBarButtonItem(
|
||||
item: UIBarButtonItem(customView: newButton))
|
||||
|
||||
@ -48,7 +48,7 @@ class MessageListViewController: BaseViewController {
|
||||
let tableView: UITableView = {
|
||||
let tableView = UITableView()
|
||||
tableView.separatorStyle = .none
|
||||
tableView.backgroundColor = Color.grey.lighten5
|
||||
tableView.backgroundColor = BKColor.background.primary
|
||||
tableView.register(MessageTableViewCell.self, forCellReuseIdentifier: "\(MessageTableViewCell.self)")
|
||||
tableView.contentInset = UIEdgeInsets(top: 20, left: 0, bottom: 0, right: 0)
|
||||
return tableView
|
||||
|
||||
@ -13,7 +13,7 @@ class MessageSettingsViewController: BaseViewController {
|
||||
let tableView: UITableView = {
|
||||
let tableView = UITableView()
|
||||
tableView.separatorStyle = .none
|
||||
tableView.backgroundColor = Color.grey.lighten5
|
||||
tableView.backgroundColor = BKColor.background.primary
|
||||
tableView.register(LabelCell.self, forCellReuseIdentifier: "\(LabelCell.self)")
|
||||
tableView.register(iCloudStatusCell.self, forCellReuseIdentifier: "\(iCloudStatusCell.self)")
|
||||
tableView.register(ArchiveSettingCell.self, forCellReuseIdentifier: "\(ArchiveSettingCell.self)")
|
||||
|
||||
@ -31,7 +31,7 @@ class MessageSettingsViewModel: ViewModel, ViewModelType {
|
||||
settings.append(.label(text: NSLocalizedString("defaultArchiveSettings")))
|
||||
settings.append(.archiveSetting(viewModel: ArchiveSettingCellViewModel(on: ArchiveSettingManager.shared.isArchive)))
|
||||
settings.append(.label(text: NSLocalizedString("archiveNote")))
|
||||
|
||||
|
||||
if let infoDict = Bundle.main.infoDictionary,
|
||||
let runId = infoDict["GitHub Run Id"] as? String
|
||||
{
|
||||
@ -39,26 +39,26 @@ class MessageSettingsViewModel: ViewModel, ViewModelType {
|
||||
settings.append(.detail(
|
||||
title: "Github Run Id",
|
||||
text: "\(runId)",
|
||||
textColor: Color.grey.darken2,
|
||||
textColor: BKColor.grey.darken2,
|
||||
url: URL(string: "https://github.com/Finb/Bark/actions/runs/\(runId)")))
|
||||
settings.append(.label(text: NSLocalizedString("buildDesc")))
|
||||
}
|
||||
|
||||
|
||||
settings.append(.label(text: NSLocalizedString("other")))
|
||||
settings.append(.detail(
|
||||
title: NSLocalizedString("faq"),
|
||||
text: nil,
|
||||
textColor: nil,
|
||||
url: URL(string: "https://day.app/2021/06/barkfaq/")))
|
||||
|
||||
settings.append(.spacer(height: 0.5, color: Color.grey.lighten4))
|
||||
|
||||
settings.append(.spacer(height: 0.5, color: BKColor.grey.lighten4))
|
||||
settings.append(.detail(
|
||||
title: NSLocalizedString("appSC"),
|
||||
text: nil,
|
||||
textColor: nil,
|
||||
url: URL(string: "https://github.com/Finb/Bark")))
|
||||
|
||||
settings.append(.spacer(height: 0.5, color: Color.grey.lighten4))
|
||||
|
||||
settings.append(.spacer(height: 0.5, color: BKColor.grey.lighten4))
|
||||
settings.append(.detail(
|
||||
title: NSLocalizedString("backendSC"),
|
||||
text: nil,
|
||||
@ -66,7 +66,7 @@ class MessageSettingsViewModel: ViewModel, ViewModelType {
|
||||
url: URL(string: "https://github.com/Finb/bark-server")))
|
||||
return settings
|
||||
}()
|
||||
|
||||
|
||||
settings.compactMap { item -> ArchiveSettingCellViewModel? in
|
||||
if case let MessageSettingItem.archiveSetting(viewModel) = item {
|
||||
return viewModel
|
||||
@ -85,7 +85,7 @@ class MessageSettingsViewModel: ViewModel, ViewModelType {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
return Output(
|
||||
settings: Driver<[SectionModel<String, MessageSettingItem>]>
|
||||
.just([SectionModel(model: "model", items: settings)]),
|
||||
|
||||
@ -21,13 +21,16 @@ class NewServerViewController: BaseViewController {
|
||||
textField.detail = NSLocalizedString("ServerExample")
|
||||
textField.transition([.scale(0.85), .opacity(0)])
|
||||
textField.detailLabel.transition([.scale(0.85), .opacity(0)])
|
||||
textField.textColor = BKColor.grey.darken4
|
||||
textField.placeholderNormalColor = BKColor.grey.base
|
||||
textField.detailLabel.textColor = BKColor.grey.base
|
||||
return textField
|
||||
}()
|
||||
|
||||
let noticeLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.text = NSLocalizedString("DeploymentDocuments")
|
||||
label.textColor = Color.blue.base
|
||||
label.textColor = BKColor.blue.base
|
||||
label.font = UIFont.systemFont(ofSize: 12)
|
||||
label.transition([.scale(0.85), .opacity(0), .translate(x: 50)])
|
||||
label.isUserInteractionEnabled = true
|
||||
@ -40,6 +43,7 @@ class NewServerViewController: BaseViewController {
|
||||
doneButton.setImage(Icon.check, for: .normal)
|
||||
doneButton.frame = CGRect(x: 0, y: 0, width: 40, height: 40)
|
||||
navigationItem.setRightBarButtonItem(item: UIBarButtonItem(customView: doneButton))
|
||||
doneButton.tintColor = BKColor.grey.darken4
|
||||
return doneButton
|
||||
}()
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ import RxSwift
|
||||
class SoundsViewController: BaseViewController {
|
||||
let tableView: UITableView = {
|
||||
let tableView = UITableView()
|
||||
tableView.backgroundColor = Color.grey.lighten5
|
||||
tableView.backgroundColor = BKColor.background.primary
|
||||
tableView.register(SoundCell.self, forCellReuseIdentifier: "\(SoundCell.self)")
|
||||
return tableView
|
||||
}()
|
||||
@ -35,7 +35,7 @@ class SoundsViewController: BaseViewController {
|
||||
let header = UILabel()
|
||||
header.fontSize = 12
|
||||
header.text = " \(NSLocalizedString("previewSound"))"
|
||||
header.textColor = Color.darkText.secondary
|
||||
header.textColor = BKColor.grey.darken1
|
||||
header.frame = CGRect(x: 0, y: 0, width: 0, height: 40)
|
||||
return header
|
||||
}()
|
||||
|
||||
@ -17,7 +17,7 @@ class ArchiveSettingCell: BaseTableViewCell {
|
||||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
self.selectionStyle = .none
|
||||
|
||||
self.backgroundColor = BKColor.background.secondary
|
||||
self.textLabel?.text = NSLocalizedString("defaultArchiveSettings")
|
||||
|
||||
contentView.addSubview(switchButton)
|
||||
|
||||
@ -13,7 +13,7 @@ class GroupTableViewCell: BaseTableViewCell {
|
||||
let nameLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.fontSize = 14
|
||||
label.textColor = Color.darkText.primary
|
||||
label.textColor = BKColor.grey.darken4
|
||||
return label
|
||||
}()
|
||||
|
||||
@ -21,7 +21,7 @@ class GroupTableViewCell: BaseTableViewCell {
|
||||
let btn = BKButton()
|
||||
btn.setImage(UIImage(named: "baseline_radio_button_unchecked_black_24pt"), for: .normal)
|
||||
btn.setImage(UIImage(named: "baseline_check_circle_outline_black_24pt"), for: .selected)
|
||||
btn.tintColor = Color.lightGray
|
||||
btn.tintColor = BKColor.grey.base
|
||||
btn.isUserInteractionEnabled = false
|
||||
return btn
|
||||
}()
|
||||
@ -74,7 +74,7 @@ class GroupTableViewCell: BaseTableViewCell {
|
||||
|
||||
viewModel.checked.subscribe(
|
||||
onNext: { [weak self] checked in
|
||||
self?.checkButton.tintColor = checked ? Color.lightBlue.darken3 : Color.lightGray
|
||||
self?.checkButton.tintColor = checked ? BKColor.lightBlue.darken3 : BKColor.grey.base
|
||||
}).disposed(by: rx.reuseBag)
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,8 +14,8 @@ class LabelCell: UITableViewCell {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
self.selectionStyle = .none
|
||||
|
||||
self.backgroundColor = Color.grey.lighten5
|
||||
self.textLabel?.textColor = Color.darkText.secondary
|
||||
self.backgroundColor = BKColor.background.primary
|
||||
self.textLabel?.textColor = BKColor.grey.darken1
|
||||
self.textLabel?.fontSize = 12
|
||||
self.textLabel?.numberOfLines = 0
|
||||
}
|
||||
|
||||
@ -13,14 +13,14 @@ class MessageTableViewCell: BaseTableViewCell {
|
||||
let view = UIView()
|
||||
view.layer.cornerRadius = 3
|
||||
view.clipsToBounds = true
|
||||
view.backgroundColor = UIColor.white
|
||||
view.backgroundColor = BKColor.background.secondary
|
||||
return view
|
||||
}()
|
||||
|
||||
let titleLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.font = RobotoFont.medium(with: 16)
|
||||
label.textColor = Color.darkText.primary
|
||||
label.textColor = BKColor.grey.darken4
|
||||
label.numberOfLines = 0
|
||||
return label
|
||||
}()
|
||||
@ -28,7 +28,7 @@ class MessageTableViewCell: BaseTableViewCell {
|
||||
let bodyLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.font = RobotoFont.regular(with: 14)
|
||||
label.textColor = Color.darkText.primary
|
||||
label.textColor = BKColor.grey.darken4
|
||||
label.numberOfLines = 0
|
||||
return label
|
||||
}()
|
||||
@ -38,7 +38,7 @@ class MessageTableViewCell: BaseTableViewCell {
|
||||
label.hitTestSlop = UIEdgeInsets(top: -20, left: -20, bottom: -20, right: -20)
|
||||
label.isUserInteractionEnabled = true
|
||||
label.font = RobotoFont.regular(with: 14)
|
||||
label.textColor = Color.blue.darken1
|
||||
label.textColor = BKColor.blue.darken1
|
||||
label.numberOfLines = 0
|
||||
return label
|
||||
}()
|
||||
@ -46,7 +46,7 @@ class MessageTableViewCell: BaseTableViewCell {
|
||||
let dateLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.font = RobotoFont.medium(with: 11)
|
||||
label.textColor = Color.darkText.others
|
||||
label.textColor = BKColor.grey.base
|
||||
return label
|
||||
}()
|
||||
|
||||
@ -58,7 +58,7 @@ class MessageTableViewCell: BaseTableViewCell {
|
||||
|
||||
let separatorLine: UIImageView = {
|
||||
let imageView = UIImageView()
|
||||
imageView.backgroundColor = Color.grey.lighten5
|
||||
imageView.backgroundColor = BKColor.background.primary
|
||||
return imageView
|
||||
}()
|
||||
|
||||
@ -66,7 +66,7 @@ class MessageTableViewCell: BaseTableViewCell {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
self.selectionStyle = .none
|
||||
|
||||
self.backgroundColor = Color.grey.lighten5
|
||||
self.backgroundColor = BKColor.background.primary
|
||||
contentView.addSubview(backgroundPanel)
|
||||
contentView.addSubview(bodyStackView)
|
||||
|
||||
|
||||
@ -10,13 +10,13 @@ import Material
|
||||
import UIKit
|
||||
|
||||
class PreviewCardCell: BaseTableViewCell {
|
||||
let previewButton = IconButton(image: Icon.cm.skipForward, tintColor: Color.grey.base)
|
||||
let copyButton = IconButton(image: UIImage(named: "baseline_file_copy_white_24pt"), tintColor: Color.grey.base)
|
||||
let previewButton = IconButton(image: Icon.cm.skipForward, tintColor: BKColor.grey.base)
|
||||
let copyButton = IconButton(image: UIImage(named: "baseline_file_copy_white_24pt"), tintColor: BKColor.grey.base)
|
||||
|
||||
let titleLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.font = RobotoFont.regular(with: 14)
|
||||
label.textColor = Color.grey.darken3
|
||||
label.textColor = BKColor.grey.darken3
|
||||
label.numberOfLines = 0
|
||||
return label
|
||||
}()
|
||||
@ -24,7 +24,7 @@ class PreviewCardCell: BaseTableViewCell {
|
||||
let bodyLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.font = RobotoFont.regular(with: 14)
|
||||
label.textColor = Color.grey.darken2
|
||||
label.textColor = BKColor.grey.darken2
|
||||
label.numberOfLines = 0
|
||||
return label
|
||||
}()
|
||||
@ -32,7 +32,7 @@ class PreviewCardCell: BaseTableViewCell {
|
||||
let noticeLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.font = RobotoFont.regular(with: 12)
|
||||
label.textColor = Color.grey.base
|
||||
label.textColor = BKColor.grey.base
|
||||
label.numberOfLines = 0
|
||||
label.isUserInteractionEnabled = true
|
||||
return label
|
||||
@ -46,7 +46,7 @@ class PreviewCardCell: BaseTableViewCell {
|
||||
|
||||
let card: UIView = {
|
||||
let view = UIView()
|
||||
view.backgroundColor = Color.white
|
||||
view.backgroundColor = BKColor.background.secondary
|
||||
view.layer.cornerRadius = 2
|
||||
view.clipsToBounds = true
|
||||
return view
|
||||
@ -70,7 +70,7 @@ class PreviewCardCell: BaseTableViewCell {
|
||||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
self.selectionStyle = .none
|
||||
self.backgroundColor = Color.grey.lighten4
|
||||
self.backgroundColor = BKColor.background.primary
|
||||
|
||||
contentView.addSubview(card)
|
||||
card.addSubview(copyButton)
|
||||
|
||||
@ -47,13 +47,13 @@ class PreviewCardCellViewModel: ViewModel {
|
||||
|
||||
let noticeStr = "\(previewModel.notice ?? "")"
|
||||
let noticeAttrStr = NSMutableAttributedString(string: noticeStr, attributes: [
|
||||
NSAttributedString.Key.foregroundColor: Color.grey.base,
|
||||
NSAttributedString.Key.foregroundColor: BKColor.grey.base,
|
||||
NSAttributedString.Key.font: RobotoFont.regular(with: 12)
|
||||
])
|
||||
|
||||
if let moreInfo = previewModel.moreInfo {
|
||||
noticeAttrStr.append(NSMutableAttributedString(string: " \(moreInfo)", attributes: [
|
||||
NSAttributedString.Key.foregroundColor: Color.blue.base,
|
||||
NSAttributedString.Key.foregroundColor: BKColor.blue.base,
|
||||
NSAttributedString.Key.font: RobotoFont.regular(with: 12)
|
||||
]))
|
||||
}
|
||||
@ -68,30 +68,30 @@ class PreviewCardCellViewModel: ViewModel {
|
||||
let serverUrl = URL(string: ServerManager.shared.currentAddress)!
|
||||
let attrStr = NSMutableAttributedString(string: "")
|
||||
attrStr.append(NSAttributedString(string: serverUrl.absoluteString, attributes: [
|
||||
NSAttributedString.Key.foregroundColor: Color.grey.darken4,
|
||||
NSAttributedString.Key.foregroundColor: BKColor.grey.darken4,
|
||||
NSAttributedString.Key.font: RobotoFont.regular(with: fontSize)
|
||||
]))
|
||||
|
||||
attrStr.append(NSAttributedString(string: "/\(Client.shared.key ?? "Your Key")", attributes: [
|
||||
NSAttributedString.Key.foregroundColor: Color.grey.darken3,
|
||||
NSAttributedString.Key.foregroundColor: BKColor.grey.darken3,
|
||||
NSAttributedString.Key.font: RobotoFont.regular(with: fontSize)
|
||||
]))
|
||||
|
||||
if let modelTitle = previewModel.title {
|
||||
attrStr.append(NSAttributedString(string: "/\(modelTitle)", attributes: [
|
||||
NSAttributedString.Key.foregroundColor: Color.grey.darken1,
|
||||
NSAttributedString.Key.foregroundColor: BKColor.grey.darken1,
|
||||
NSAttributedString.Key.font: RobotoFont.regular(with: fontSize)
|
||||
]))
|
||||
}
|
||||
if let modelBody = previewModel.body {
|
||||
attrStr.append(NSAttributedString(string: "/\(modelBody)", attributes: [
|
||||
NSAttributedString.Key.foregroundColor: Color.grey.base,
|
||||
NSAttributedString.Key.foregroundColor: BKColor.grey.base,
|
||||
NSAttributedString.Key.font: RobotoFont.regular(with: fontSize)
|
||||
]))
|
||||
}
|
||||
if let queryParameter = previewModel.queryParameter {
|
||||
attrStr.append(NSAttributedString(string: "?\(queryParameter)", attributes: [
|
||||
NSAttributedString.Key.foregroundColor: Color.grey.lighten1,
|
||||
NSAttributedString.Key.foregroundColor: BKColor.grey.lighten1,
|
||||
NSAttributedString.Key.font: RobotoFont.regular(with: fontSize)
|
||||
]))
|
||||
}
|
||||
|
||||
@ -11,25 +11,25 @@ import Material
|
||||
import UIKit
|
||||
|
||||
class SoundCell: BaseTableViewCell {
|
||||
let copyButton = IconButton(image: UIImage(named: "baseline_file_copy_white_24pt"), tintColor: Color.grey.base)
|
||||
let copyButton = IconButton(image: UIImage(named: "baseline_file_copy_white_24pt"), tintColor: BKColor.grey.base)
|
||||
let nameLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.fontSize = 14
|
||||
label.textColor = Color.darkText.primary
|
||||
label.textColor = BKColor.grey.darken4
|
||||
return label
|
||||
}()
|
||||
|
||||
let durationLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.fontSize = 12
|
||||
label.textColor = Color.darkText.secondary
|
||||
label.textColor = BKColor.grey.darken1
|
||||
return label
|
||||
}()
|
||||
|
||||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
self.selectionStyle = .none
|
||||
|
||||
self.backgroundColor = BKColor.background.secondary
|
||||
self.contentView.addSubview(nameLabel)
|
||||
self.contentView.addSubview(durationLabel)
|
||||
self.contentView.addSubview(copyButton)
|
||||
|
||||
@ -13,6 +13,7 @@ class DetailTextCell: UITableViewCell {
|
||||
super.init(style: .value1, reuseIdentifier: reuseIdentifier)
|
||||
self.selectionStyle = .none
|
||||
self.accessoryType = .disclosureIndicator
|
||||
self.backgroundColor = BKColor.background.secondary
|
||||
}
|
||||
|
||||
@available(*, unavailable)
|
||||
|
||||
@ -13,7 +13,7 @@ class iCloudStatusCell: UITableViewCell {
|
||||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
super.init(style: .value1, reuseIdentifier: reuseIdentifier)
|
||||
self.selectionStyle = .none
|
||||
|
||||
self.backgroundColor = BKColor.background.secondary
|
||||
self.textLabel?.text = NSLocalizedString("iCloudSatatus")
|
||||
self.detailTextLabel?.text = ""
|
||||
CKContainer.default().accountStatus { status, _ in
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user