Set different status bar style depending on theme color.

Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Ivan Sein 2020-11-02 18:07:22 +01:00
Родитель d37c0fc08e
Коммит b40d631104
6 изменённых файлов: 95 добавлений и 8 удалений

Просмотреть файл

@ -20,6 +20,9 @@
2C06BF6720AC647A0031EB46 /* DateHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C06BF6620AC647A0031EB46 /* DateHeaderView.m */; };
2C06BF6C20AEB0030031EB46 /* RoundedNumberView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C06BF6A20AEB0030031EB46 /* RoundedNumberView.m */; };
2C1D13A3253760EE00EC0533 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2C1D13A1253760EE00EC0533 /* LaunchScreen.xib */; };
2C1EF36B25505DCE007C9768 /* NCNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C1EF36A25505DCE007C9768 /* NCNavigationController.m */; };
2C1EF36C25505DCE007C9768 /* NCNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C1EF36A25505DCE007C9768 /* NCNavigationController.m */; };
2C1EF36D25505DCE007C9768 /* NCNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C1EF36A25505DCE007C9768 /* NCNavigationController.m */; };
2C2026A0236832D300DFC89B /* FTPopOverMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C20269F236832D300DFC89B /* FTPopOverMenu.m */; };
2C2026A42369F47400DFC89B /* AccountTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C2026A22369F47400DFC89B /* AccountTableViewCell.m */; };
2C2026A52369F47400DFC89B /* AccountTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2C2026A32369F47400DFC89B /* AccountTableViewCell.xib */; };
@ -463,6 +466,8 @@
2C06BF6A20AEB0030031EB46 /* RoundedNumberView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RoundedNumberView.m; sourceTree = "<group>"; };
2C06BF6B20AEB0030031EB46 /* RoundedNumberView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoundedNumberView.h; sourceTree = "<group>"; };
2C1D13A2253760EE00EC0533 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
2C1EF36925505DCE007C9768 /* NCNavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NCNavigationController.h; sourceTree = "<group>"; };
2C1EF36A25505DCE007C9768 /* NCNavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NCNavigationController.m; sourceTree = "<group>"; };
2C20269E236832D300DFC89B /* FTPopOverMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FTPopOverMenu.h; sourceTree = "<group>"; };
2C20269F236832D300DFC89B /* FTPopOverMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FTPopOverMenu.m; sourceTree = "<group>"; };
2C2026A12369F47400DFC89B /* AccountTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccountTableViewCell.h; sourceTree = "<group>"; };
@ -516,7 +521,7 @@
2C604BD7211988A700D34DCD /* SystemMessageTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SystemMessageTableViewCell.h; sourceTree = "<group>"; };
2C604BD8211988A700D34DCD /* SystemMessageTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SystemMessageTableViewCell.m; sourceTree = "<group>"; };
2C6085C11FB1063700B36A6E /* NextcloudTalk.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = NextcloudTalk.entitlements; sourceTree = "<group>"; };
2C62AFA324C08845007E460A /* ShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "ShareExtension.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
2C62AFA324C08845007E460A /* ShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = ShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
2C62AFAB24C08845007E460A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2C62AFB524C1A449007E460A /* Share.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Share.storyboard; sourceTree = "<group>"; };
2C62AFB724C1A4E6007E460A /* ShareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareViewController.h; sourceTree = "<group>"; };
@ -942,6 +947,8 @@
2CC7158820B837140045C789 /* PlaceholderView.xib */,
2C9200C12474262C0050084F /* UIBarButtonItem+Badge.h */,
2C9200C22474262C0050084F /* UIBarButtonItem+Badge.m */,
2C1EF36925505DCE007C9768 /* NCNavigationController.h */,
2C1EF36A25505DCE007C9768 /* NCNavigationController.m */,
);
name = "User Interface";
sourceTree = "<group>";
@ -1871,6 +1878,7 @@
2C78EFA91F87EF39008AFA74 /* NBMPeersFlowLayout.m in Sources */,
C1292B8C237313590004C3B7 /* CCBKPasscode.m in Sources */,
2CA1CCDB1F1F6FCA002FE6A2 /* RoomTableViewCell.m in Sources */,
2C1EF36B25505DCE007C9768 /* NCNavigationController.m in Sources */,
2CC007B420D7AE990096D91F /* ResultMultiSelectionTableViewController.m in Sources */,
2C961E1E2216BF4B00F5C23F /* OCXMLServerErrorsParser.m in Sources */,
2CA1CCC31F166CC5002FE6A2 /* NCRoom.m in Sources */,
@ -2092,6 +2100,7 @@
2C62AFFA24C1BDA5007E460A /* NCChatMessage.m in Sources */,
2C62B00824C1BDBD007E460A /* NCConnectionController.m in Sources */,
2C62B02B24C1BDCF007E460A /* VideoSettingsViewController.m in Sources */,
2C1EF36D25505DCE007C9768 /* NCNavigationController.m in Sources */,
2C62B01924C1BDC6007E460A /* NCRoomParticipants.m in Sources */,
2C62AFD424C1BD7E007E460A /* NSDate+RFC1123.m in Sources */,
2C62B01A24C1BDC6007E460A /* RoomSearchTableViewController.m in Sources */,
@ -2149,6 +2158,7 @@
2CC001D524A37ACA00A20167 /* NewRoomTableViewController.m in Sources */,
2CC001BB24A37AA700A20167 /* DirectoryTableViewCell.m in Sources */,
2CC001B124A37A9500A20167 /* NCChatTitleView.m in Sources */,
2C1EF36C25505DCE007C9768 /* NCNavigationController.m in Sources */,
2CC001CE24A37ACA00A20167 /* NCRoom.m in Sources */,
2CC0018F24A37A6B00A20167 /* NSDate+RFC1123.m in Sources */,
2CC0017124A3793700A20167 /* OCCommunication.m in Sources */,
@ -2470,7 +2480,7 @@
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = "ShareExtension/ShareExtension.entitlements";
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
@ -2533,7 +2543,7 @@
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.nextcloud.Talk.ShareExtension;
PRODUCT_NAME = "ShareExtension";
PRODUCT_NAME = ShareExtension;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
};
@ -2555,7 +2565,7 @@
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = "ShareExtension/ShareExtension.entitlements";
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution: Nextcloud GmbH (NKUJUXUJ3B)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
@ -2617,7 +2627,7 @@
MARKETING_VERSION = 10.0.1;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.nextcloud.Talk.ShareExtension;
PRODUCT_NAME = "ShareExtension";
PRODUCT_NAME = ShareExtension;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
};

Просмотреть файл

@ -87,7 +87,7 @@
<!--Navigation Controller-->
<scene sceneID="WPn-o2-Zlg">
<objects>
<navigationController storyboardIdentifier="settingsNC" id="h6t-CT-B8r" sceneMemberID="viewController">
<navigationController storyboardIdentifier="settingsNC" id="h6t-CT-B8r" customClass="NCNavigationController" sceneMemberID="viewController">
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" translucent="NO" prompted="NO"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" translucent="NO" id="Mqg-tq-GRj">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
@ -104,7 +104,7 @@
<!--Navigation Controller-->
<scene sceneID="ICr-oC-JdW">
<objects>
<navigationController id="lDR-Z7-uv9" sceneMemberID="viewController">
<navigationController id="lDR-Z7-uv9" customClass="NCNavigationController" sceneMemberID="viewController">
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" translucent="NO" prompted="NO"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" translucent="NO" id="hHa-bu-9bX">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>

Просмотреть файл

@ -76,6 +76,6 @@
<key>UIUserInterfaceStyle</key>
<string>Light</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<true/>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,31 @@
/**
* @copyright Copyright (c) 2020 Ivan Sein <ivan@nextcloud.com>
*
* @author Ivan Sein <ivan@nextcloud.com>
*
* @license GNU GPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface NCNavigationController : UINavigationController
@end
NS_ASSUME_NONNULL_END

Просмотреть файл

@ -0,0 +1,44 @@
/**
* @copyright Copyright (c) 2020 Ivan Sein <ivan@nextcloud.com>
*
* @author Ivan Sein <ivan@nextcloud.com>
*
* @license GNU GPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#import "NCNavigationController.h"
#import "NCAppBranding.h"
#import "NCUtils.h"
@interface NCNavigationController ()
@end
@implementation NCNavigationController
- (void)viewDidLoad {
[super viewDidLoad];
}
- (UIStatusBarStyle)preferredStatusBarStyle
{
CGFloat luma = [NCUtils calculateLumaFromColor:[NCAppBranding themeColor]];
return (luma > 0.6) ? UIStatusBarStyleDefault : UIStatusBarStyleLightContent;
}
@end

Просмотреть файл

@ -174,6 +174,8 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
_searchController.searchBar.layer.borderWidth = 1;
_searchController.searchBar.layer.borderColor = [[UIColor colorWithRed:0.94 green:0.94 blue:0.96 alpha:1.0] CGColor];
}
[self setNeedsStatusBarAppearanceUpdate];
}
- (void)dealloc