mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Appearance (dark/light) handling
This commit is contained in:
parent
e02580bade
commit
93eecbc304
37 changed files with 261 additions and 98 deletions
|
|
@ -229,6 +229,8 @@
|
|||
cell.selectedImage.hidden = ![_contactsGroup containsObject:cell.addressLabel.text];
|
||||
[cell.avatarImage setImage:[FastAddressBook imageForAddress:addr] bordered:NO withRoundedRadius:YES];
|
||||
cell.contentView.userInteractionEnabled = false;
|
||||
cell.contentView.backgroundColor = UIColor.clearColor;
|
||||
cell.backgroundColor = UIColor.clearColor;
|
||||
return cell;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,6 +90,10 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
selector:@selector(viewUpdateEvent:)
|
||||
name:kLinphoneChatCreateViewChange
|
||||
object:nil];
|
||||
[NSNotificationCenter.defaultCenter addObserver:self
|
||||
selector:@selector(displayModeChanged)
|
||||
name:kDisplayModeChanged
|
||||
object:nil];
|
||||
LinphoneAccount *defaultAccount = linphone_core_get_default_account(LC);
|
||||
_chiffreOptionView.hidden = !(defaultAccount && linphone_account_params_get_conference_factory_uri(linphone_account_get_params(defaultAccount)));
|
||||
if ([LinphoneManager.instance lpConfigBoolForKey:@"hide_linphone_contacts" inSection:@"app"]) {
|
||||
|
|
@ -98,6 +102,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
CGRect frame = _allButton.frame;
|
||||
frame.origin.x = _linphoneButton.frame.origin.x;
|
||||
_allButton.frame = frame;
|
||||
|
||||
}
|
||||
|
||||
if ([LinphoneManager.instance lpConfigBoolForKey:@"force_lime_chat_rooms"]) {
|
||||
|
|
@ -116,13 +121,28 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
} else {
|
||||
[_nextButton setImage:[UIImage imageNamed:@"next_default"] forState:UIControlStateNormal];
|
||||
}
|
||||
_topBar.backgroundColor = VoipTheme.toolbar_color;
|
||||
} else {
|
||||
_voipTitle.hidden = true;
|
||||
[_nextButton setImage:[UIImage imageNamed:@"next_default"] forState:UIControlStateNormal];
|
||||
_topBar.backgroundColor = UIColor.secondarySystemBackgroundColor;
|
||||
}
|
||||
|
||||
[self displayModeChanged];
|
||||
}
|
||||
|
||||
- (void)displayModeChanged{
|
||||
[self.tableController.tableView reloadData];
|
||||
if (_isForVoipConference) {
|
||||
_topBar.backgroundColor = [VoipTheme.voipToolbarBackgroundColor get];
|
||||
self.view.backgroundColor = [VoipTheme.voipBackgroundBWColor get];
|
||||
_tableController.tableView.backgroundColor = [VoipTheme.voipBackgroundBWColor get];
|
||||
_tableController.searchBar.backgroundColor = [VoipTheme.voipBackgroundBWColor get];
|
||||
_tableController.collectionView.backgroundColor = [VoipTheme.voipBackgroundBWColor get];
|
||||
} else {
|
||||
_topBar.backgroundColor = UIColor.secondarySystemBackgroundColor;
|
||||
self.view.backgroundColor = [VoipTheme.backgroundWhiteBlack get];
|
||||
_tableController.tableView.backgroundColor = [VoipTheme.backgroundWhiteBlack get];
|
||||
_tableController.searchBar.backgroundColor = [VoipTheme.backgroundWhiteBlack get];
|
||||
_tableController.collectionView.backgroundColor = [VoipTheme.backgroundWhiteBlack get];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)viewUpdateEvent:(NSNotification *)notif {
|
||||
|
|
@ -170,9 +190,8 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
[super viewWillDisappear:animated];
|
||||
if (IPAD)
|
||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
||||
[super viewWillDisappear:animated];
|
||||
[NSNotificationCenter.defaultCenter removeObserver:self];
|
||||
}
|
||||
|
||||
#pragma mark - Chat room functions
|
||||
|
|
|
|||
|
|
@ -157,7 +157,9 @@
|
|||
[self handleShortcut:_shortcutItem];
|
||||
_shortcutItem = nil;
|
||||
}
|
||||
|
||||
|
||||
#if TARGET_IPHONE_SIMULATOR
|
||||
#else
|
||||
[[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:(UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge)
|
||||
completionHandler:^(BOOL granted, NSError *_Nullable error) {
|
||||
if (error)
|
||||
|
|
@ -183,10 +185,15 @@
|
|||
}
|
||||
|
||||
}];
|
||||
#endif
|
||||
|
||||
|
||||
if ([UIDeviceBridge switchedDisplayMode]) {
|
||||
[AvatarBridge prepareIt];
|
||||
[NSNotificationCenter.defaultCenter postNotificationName:kDisplayModeChanged object:nil];
|
||||
[PhoneMainView.instance.mainViewController removeEntryFromCache:ChatConversationCreateView.compositeViewDescription.name];
|
||||
[PhoneMainView.instance.mainViewController changeView:PhoneMainView.instance.currentView];
|
||||
[UIDeviceBridge notifyDisplayModeSwitch];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
|
|
@ -61,7 +61,7 @@
|
|||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<point key="canvasLocation" x="890.39999999999998" y="192.50374812593705"/>
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@
|
|||
- (UIViewController *)getCurrentViewController;
|
||||
- (UIInterfaceOrientation)currentOrientation;
|
||||
- (void)clearCache:(NSArray *)exclude;
|
||||
- (void)removeEntryFromCache:(NSString *)key;
|
||||
- (IBAction)onRightSwipe:(id)sender;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -305,6 +305,9 @@
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (void)removeEntryFromCache:(NSString *)key {
|
||||
[viewControllerCache removeObjectForKey:key];
|
||||
}
|
||||
|
||||
- (void)clearCache:(NSArray *)exclude {
|
||||
|
||||
|
|
|
|||
|
|
@ -960,4 +960,8 @@ void main_view_chat_room_state_changed(LinphoneChatRoom *cr, LinphoneChatRoomSta
|
|||
}
|
||||
}
|
||||
|
||||
-(void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {
|
||||
[UIDeviceBridge notifyDisplayModeSwitch];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -107,7 +107,6 @@ import linphonesw
|
|||
|
||||
// Organiser
|
||||
|
||||
organiserLabel.backgroundColor = VoipTheme.voipFormBackgroundColor.get()
|
||||
contentView.addSubview(organiserLabel)
|
||||
organiserLabel.matchParentSideBorders().height(form_input_height).alignUnder(view: schedulingStack,withMargin: form_margin*2).done()
|
||||
organiserLabel.textAlignment = .left
|
||||
|
|
@ -121,12 +120,10 @@ import linphonesw
|
|||
organizerTableView.allowsFocus = false
|
||||
}
|
||||
organizerTableView.separatorStyle = .singleLine
|
||||
organizerTableView.separatorColor = VoipTheme.light_grey_color
|
||||
organizerTableView.tag = 1;
|
||||
organizerTableView.matchParentSideBorders().height(VoipParticipantCell.cell_height).alignUnder(view: organiserLabel,withMargin: form_margin).done()
|
||||
|
||||
// Participants
|
||||
participantsLabel.backgroundColor = VoipTheme.voipFormBackgroundColor.get()
|
||||
contentView.addSubview(participantsLabel)
|
||||
participantsLabel.matchParentSideBorders().height(form_input_height).alignUnder(view: organizerTableView,withMargin: form_margin).done()
|
||||
participantsLabel.textAlignment = .left
|
||||
|
|
@ -140,7 +137,6 @@ import linphonesw
|
|||
participantsListTableView.allowsFocus = false
|
||||
}
|
||||
participantsListTableView.separatorStyle = .singleLine
|
||||
participantsListTableView.separatorColor = VoipTheme.light_grey_color
|
||||
|
||||
// Goto chat - v2
|
||||
/*
|
||||
|
|
@ -153,6 +149,14 @@ import linphonesw
|
|||
|
||||
chatButton.centerX().alignParentBottom(withMargin: 3*self.form_margin).alignUnder(view: participantsListTableView,withMargin: 3*self.form_margin).done()
|
||||
*/
|
||||
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
self.organiserLabel.backgroundColor = VoipTheme.voipFormBackgroundColor.get()
|
||||
self.organizerTableView.separatorColor = VoipTheme.separatorColor.get()
|
||||
self.participantsLabel.backgroundColor = VoipTheme.voipFormBackgroundColor.get()
|
||||
self.participantsListTableView.separatorColor = VoipTheme.separatorColor.get()
|
||||
self.view.backgroundColor = VoipTheme.voipBackgroundBWColor.get()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -141,7 +141,6 @@ import SVProgressHUD
|
|||
|
||||
// Participants
|
||||
let participantsLabel = StyledLabel(VoipTheme.conference_scheduling_font, " "+VoipTexts.conference_schedule_participants_list)
|
||||
participantsLabel.backgroundColor = VoipTheme.voipFormBackgroundColor.get()
|
||||
contentView.addSubview(participantsLabel)
|
||||
participantsLabel.matchParentSideBorders().height(form_input_height).alignUnder(view: viaChatLabel,withMargin: form_margin).done()
|
||||
participantsLabel.textAlignment = .left
|
||||
|
|
@ -156,7 +155,7 @@ import SVProgressHUD
|
|||
participantsListTableView.allowsFocus = false
|
||||
}
|
||||
participantsListTableView.separatorStyle = .singleLine
|
||||
participantsListTableView.separatorColor = VoipTheme.light_grey_color
|
||||
participantsListTableView.backgroundColor = .clear
|
||||
|
||||
ConferenceSchedulingViewModel.shared.selectedAddresses.readCurrentAndObserve { (addresses) in
|
||||
self.participantsListTableView.reloadData()
|
||||
|
|
@ -167,6 +166,7 @@ import SVProgressHUD
|
|||
|
||||
// Create / Schedule
|
||||
contentView.addSubview(createButton)
|
||||
createButton.centerX().alignParentBottom(withMargin: 3*self.form_margin).alignUnder(view: participantsListTableView,withMargin: 3*self.form_margin).width(0).done()
|
||||
ConferenceSchedulingViewModel.shared.scheduleForLater.readCurrentAndObserve { _ in
|
||||
self.createButton.title = ConferenceSchedulingViewModel.shared.scheduleForLater.value == true ? ConferenceSchedulingViewModel.shared.existingConfInfo.value != nil ? VoipTexts.conference_schedule_edit.uppercased() : VoipTexts.conference_schedule_start.uppercased() : VoipTexts.conference_group_call_create.uppercased()
|
||||
self.createButton.addSidePadding()
|
||||
|
|
@ -219,8 +219,12 @@ import SVProgressHUD
|
|||
self.createButton.addSidePadding()
|
||||
}
|
||||
|
||||
createButton.centerX().alignParentBottom(withMargin: 3*self.form_margin).alignUnder(view: participantsListTableView,withMargin: 3*self.form_margin).done()
|
||||
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
self.view.backgroundColor = VoipTheme.voipBackgroundBWColor.get()
|
||||
participantsLabel.backgroundColor = VoipTheme.voipFormBackgroundColor.get()
|
||||
self.participantsListTableView.separatorColor = VoipTheme.separatorColor.get()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ import IQKeyboardManager
|
|||
|
||||
let schedulingStack = UIStackView()
|
||||
schedulingStack.axis = .vertical
|
||||
schedulingStack.backgroundColor = VoipTheme.voipFormBackgroundColor.get()
|
||||
contentView.addSubview(schedulingStack)
|
||||
schedulingStack.alignUnder(view: subjectInput,withMargin: form_margin).matchParentSideBorders(insetedByDx: form_margin).done()
|
||||
|
||||
|
|
@ -206,6 +205,11 @@ import IQKeyboardManager
|
|||
ConferenceSchedulingViewModel.shared.existingConfInfo.readCurrentAndObserve { (confInfo) in
|
||||
super.titleLabel.text = ConferenceSchedulingViewModel.shared.scheduleForLater.value == true ? ConferenceSchedulingViewModel.shared.existingConfInfo.value != nil ? VoipTexts.conference_schedule_edit : VoipTexts.conference_schedule_title : VoipTexts.conference_group_call_title
|
||||
}
|
||||
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
self.view.backgroundColor = VoipTheme.voipBackgroundBWColor.get()
|
||||
schedulingStack.backgroundColor = VoipTheme.voipFormBackgroundColor.get()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ import linphonesw
|
|||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
view.backgroundColor = VoipTheme.voipBackgroundColor.get()
|
||||
|
||||
view.addSubview(subject)
|
||||
subject.centerX().alignParentTop(withMargin: common_margin).done()
|
||||
|
|
@ -192,6 +191,10 @@ import linphonesw
|
|||
|
||||
layoutRotatableElements()
|
||||
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
self.view.backgroundColor = VoipTheme.voipBackgroundColor.get()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func layoutRotatableElements() {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,9 @@ import EventKitUI
|
|||
|
||||
layer.cornerRadius = corner_radius
|
||||
clipsToBounds = true
|
||||
backgroundColor = VoipTheme.voip_light_gray
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
self.backgroundColor = VoipTheme.chatBubbleBGColor.get()
|
||||
}
|
||||
|
||||
let rows = UIStackView()
|
||||
rows.axis = .vertical
|
||||
|
|
|
|||
|
|
@ -29,12 +29,12 @@ class ScheduledConferencesCell: UITableViewCell {
|
|||
static let button_size = 40
|
||||
let delete_checkbox_margin = 5
|
||||
|
||||
let clockIcon = UIImageView(image: UIImage(named: "conference_schedule_time_default"))
|
||||
let clockIcon = UIImageView()
|
||||
let timeDuration = StyledLabel(VoipTheme.conference_invite_desc_font)
|
||||
let organiser = StyledLabel(VoipTheme.conference_invite_desc_font)
|
||||
let subject = StyledLabel(VoipTheme.conference_list_subject_font)
|
||||
let cancelledLabel = StyledLabel(VoipTheme.conference_cancelled_title_font)
|
||||
let participantsIcon = UIImageView(image: UIImage(named: "conference_schedule_participants_default"))
|
||||
let participantsIcon = UIImageView()
|
||||
let participants = StyledLabel(VoipTheme.conference_invite_desc_font)
|
||||
let infoConf = UIButton()
|
||||
|
||||
|
|
@ -101,7 +101,8 @@ class ScheduledConferencesCell: UITableViewCell {
|
|||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
|
||||
contentView.addSubview(myContentView)
|
||||
|
||||
contentView.backgroundColor = .clear
|
||||
backgroundColor = .clear
|
||||
myContentView.layer.cornerRadius = corner_radius
|
||||
myContentView.clipsToBounds = true
|
||||
myContentView.backgroundColor = VoipTheme.header_background_color
|
||||
|
|
@ -218,6 +219,10 @@ class ScheduledConferencesCell: UITableViewCell {
|
|||
onLongClick {
|
||||
ScheduledConferencesViewModel.shared.editionEnabled.value = true
|
||||
}
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
self.clockIcon.image = UIImage(named: "conference_schedule_time_default")?.tinted(with: VoipTheme.voipDrawableColor.get())
|
||||
self.participantsIcon.image = UIImage(named: "conference_schedule_participants_default")?.tinted(with: VoipTheme.voipDrawableColor.get())
|
||||
}
|
||||
}
|
||||
|
||||
func askConfirmationTodeleteEntry() {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,6 @@ import linphonesw
|
|||
filters.alignParentLeft(withMargin: 10).alignUnder(view: super.topBar,withMargin: self.form_margin).done()
|
||||
|
||||
self.view.addSubview(separator)
|
||||
separator.backgroundColor = VoipTheme.voip_light_gray
|
||||
separator.matchParentSideBorders().height(1).alignUnder(view: filters,withMargin: self.form_margin).done()
|
||||
|
||||
// Conference list
|
||||
|
|
@ -106,7 +105,7 @@ import linphonesw
|
|||
conferenceListView.allowsFocus = false
|
||||
}
|
||||
conferenceListView.separatorStyle = .singleLine
|
||||
conferenceListView.separatorColor = .white
|
||||
conferenceListView.backgroundColor = .clear
|
||||
|
||||
view.addSubview(noConference)
|
||||
noConference.center().done()
|
||||
|
|
@ -115,16 +114,14 @@ import linphonesw
|
|||
if (editing == true) {
|
||||
self.selectAllButton.isSelected = false
|
||||
self.selectAllButton.isHidden = false
|
||||
super.nextButton.setImage(UIImage(named: "delete_default"), for: .normal)
|
||||
super.nextButton.setImage(UIImage(named: "delete_disabled"), for: .disabled)
|
||||
super.nextButton.setImage(UIImage(named: "delete_default"), for: .highlighted)
|
||||
super.backButton.setImage(UIImage(named: "cancel_edit_default"), for: .normal)
|
||||
super.nextButton.applyTintedIcons(tintedIcons: VoipTheme.generic_delete_button)
|
||||
super.backButton.applyTintedIcons(tintedIcons: VoipTheme.generic_cancel)
|
||||
self.nextButton.isEnabled = ScheduledConferencesViewModel.shared.conferences.value?.filter{$0.selectedForDeletion.value == true}.count ?? 0 > 0
|
||||
} else {
|
||||
self.selectAllButton.isHidden = true
|
||||
ScheduledConferencesViewModel.shared.conferences.value?.forEach {$0.selectedForDeletion.value = false}
|
||||
super.nextButton.applyTintedIcons(tintedIcons: VoipTheme.conference_create_button)
|
||||
super.backButton.setImage(UIImage(named: "back_default"), for: .normal)
|
||||
super.backButton.applyTintedIcons(tintedIcons: VoipTheme.generic_back)
|
||||
self.nextButton.isEnabled = true
|
||||
}
|
||||
}
|
||||
|
|
@ -134,6 +131,12 @@ import linphonesw
|
|||
ScheduledConferencesViewModel.shared.conferences.value?.forEach {$0.selectedForDeletion.value = selectIt}
|
||||
}
|
||||
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
self.view.backgroundColor = VoipTheme.voipBackgroundBWColor.get()
|
||||
self.separator.backgroundColor = VoipTheme.separatorColor.get()
|
||||
self.conferenceListView.separatorColor = .clear
|
||||
self.conferenceListView.reloadData()
|
||||
}
|
||||
}
|
||||
|
||||
func getFilterButton(title:String) -> UIButton {
|
||||
|
|
@ -146,6 +149,7 @@ import linphonesw
|
|||
button.layer.cornerRadius = filter_button_height / 2
|
||||
button.clipsToBounds = true
|
||||
button.applyTitleStyle(VoipTheme.conf_list_filter_button_font)
|
||||
button.width(0).done()
|
||||
button.addSidePadding()
|
||||
return button
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ import SnapKit
|
|||
import UIKit
|
||||
|
||||
extension UIButton {
|
||||
func addSidePadding(p:CGFloat = 10) {
|
||||
func addSidePadding(p:CGFloat = 10) { // Requires a width to be set prior to this ! SnapKit does not support updateOrCreate.
|
||||
if let w = titleLabel?.textWidth {
|
||||
width(w+2*p).done()
|
||||
updateWidth(w+2*p).done()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,9 +69,11 @@ extension UIDevice {
|
|||
}
|
||||
|
||||
@objc class UIDeviceBridge : NSObject {
|
||||
@available(iOS 12.0, *)
|
||||
static let displayMode = MutableLiveData<UIUserInterfaceStyle>()
|
||||
static let displayModeSwitched = MutableLiveData<Bool>()
|
||||
@objc static func switchedDisplayMode() -> Bool {
|
||||
return UIDevice.switchedDisplayMode()
|
||||
}
|
||||
@objc static func notifyDisplayModeSwitch() {
|
||||
displayModeSwitched.notifyValue()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,6 +88,13 @@ extension UIView {
|
|||
return self
|
||||
}
|
||||
|
||||
func updateWidth(_ h:CGFloat) -> UIView {
|
||||
snp.updateConstraints { (make) in
|
||||
make.width.equalTo(h)
|
||||
}
|
||||
return self
|
||||
}
|
||||
|
||||
func width(_ h:Int) -> UIView {
|
||||
return width(CGFloat(h))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,14 +79,9 @@ import linphonesw
|
|||
scrollView.alignUnder(view: topBar, withMargin: content_margin_top).alignParentBottom().matchParentSideBorders().done()
|
||||
scrollView.addSubview(contentView)
|
||||
contentView.matchBordersOf(view: view).alignParentBottom().alignParentTop().done() // don't forget a bottom constraint b/w last element of contentview and contentview
|
||||
|
||||
}
|
||||
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
topBar.backgroundColor = VoipTheme.voipToolbarBackgroundColor.get()
|
||||
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
self.topBar.backgroundColor = VoipTheme.voipToolbarBackgroundColor.get()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
import Foundation
|
||||
|
||||
class LightDarkColor {
|
||||
@objc class LightDarkColor : NSObject {
|
||||
var light: UIColor
|
||||
var dark : UIColor
|
||||
init(_ l:UIColor,_ d:UIColor){
|
||||
|
|
@ -27,7 +27,7 @@ class LightDarkColor {
|
|||
dark = d
|
||||
}
|
||||
|
||||
func get() -> UIColor {
|
||||
@objc func get() -> UIColor {
|
||||
if #available(iOS 13.0, *) {
|
||||
if UITraitCollection.current.userInterfaceStyle == .light {
|
||||
return light
|
||||
|
|
|
|||
|
|
@ -35,9 +35,14 @@ struct TextStyle {
|
|||
|
||||
|
||||
extension UILabel {
|
||||
func applyStyle(_ style:TextStyle) {
|
||||
|
||||
func applyStyleColors(_ style:TextStyle) {
|
||||
textColor = style.fgColor.get()
|
||||
backgroundColor = style.bgColor.get()
|
||||
}
|
||||
|
||||
func applyStyle(_ style:TextStyle) {
|
||||
applyStyleColors(style)
|
||||
if (style.allCaps) {
|
||||
text = self.text?.uppercased()
|
||||
tag = 1
|
||||
|
|
@ -49,7 +54,7 @@ extension UILabel {
|
|||
|
||||
func addIndicatorIcon(iconName:String, padding:CGFloat = 5.0, y:CGFloat = 4.0, trailing: Bool = true) {
|
||||
let imageAttachment = NSTextAttachment()
|
||||
imageAttachment.image = UIImage(named:iconName)
|
||||
imageAttachment.image = UIImage(named:iconName)?.tinted(with: VoipTheme.voipDrawableColor.get())
|
||||
imageAttachment.bounds = CGRect(x: 0.0, y: y , width: font.lineHeight - 2*padding, height: font.lineHeight - 2*padding)
|
||||
let iconString = NSMutableAttributedString(attachment: imageAttachment)
|
||||
let textXtring = NSMutableAttributedString(string: text != nil ? (!trailing ? " " : "") + text! + (trailing ? " " : "") : "")
|
||||
|
|
@ -78,9 +83,14 @@ extension UIButton {
|
|||
}
|
||||
|
||||
extension UITextView {
|
||||
func applyStyle(_ style:TextStyle) {
|
||||
|
||||
func applyStyleColors(_ style:TextStyle) {
|
||||
textColor = style.fgColor.get()
|
||||
backgroundColor = style.bgColor.get()
|
||||
}
|
||||
|
||||
func applyStyle(_ style:TextStyle) {
|
||||
applyStyleColors(style)
|
||||
if (style.allCaps) {
|
||||
text = self.text?.uppercased()
|
||||
tag = 1
|
||||
|
|
|
|||
|
|
@ -64,14 +64,15 @@ import UIKit
|
|||
|
||||
// Light / Dark variations
|
||||
static let voipBackgroundColor = LightDarkColor(voip_gray_blue_color,voip_dark_color)
|
||||
static let voipBackgroundBWColor = LightDarkColor(UIColor.white,voip_dark_color)
|
||||
@objc static let voipBackgroundBWColor = LightDarkColor(.white,voip_dark_color)
|
||||
@objc static let backgroundWhiteBlack = LightDarkColor(.white,.black)
|
||||
static let voipParticipantBackgroundColor = LightDarkColor(voip_gray_background,voip_dark_color2)
|
||||
static let voipParticipantMeBackgroundColor = LightDarkColor(voip_dark_color3,voip_dark_color3)
|
||||
static let voipExtraButtonsBackgroundColor = LightDarkColor(voip_gray,voip_dark_color3)
|
||||
static let voipToolbarBackgroundColor = LightDarkColor(toolbar_color,voip_dark_color4)
|
||||
@objc static let voipToolbarBackgroundColor = LightDarkColor(toolbar_color,voip_dark_color4)
|
||||
static let voipDrawableColor = LightDarkColor(voip_dark_gray,.white)
|
||||
static let voipDrawableColorHighlighted = LightDarkColor(voip_gray,voip_gray)
|
||||
static let voipTextColor = LightDarkColor(voip_dark_gray,UIColor.white)
|
||||
static let voipTextColor = LightDarkColor(voip_dark_gray,.white)
|
||||
static let voipFormBackgroundColor = LightDarkColor(form_field_gray_background,voip_dark_color4)
|
||||
static let voipFormFieldBackgroundColor = LightDarkColor(light_grey_color,voip_dark_color4)
|
||||
static let voipFormDisabledFieldBackgroundColor = LightDarkColor(header_background_color,voip_dark_color4)
|
||||
|
|
@ -79,9 +80,10 @@ import UIKit
|
|||
static let primaryTextColor = LightDarkColor(dark_grey_color,.white)
|
||||
static let backgroundColor3 = LightDarkColor(voip_light_gray,voip_dark_color5)
|
||||
static let backgroundColor4 = LightDarkColor(header_background_color,voip_dark_color5)
|
||||
static let separatorColor = LightDarkColor(light_grey_color,.white)
|
||||
static let chatBubbleBGColor = LightDarkColor(voip_light_gray, voip_dark_color5)
|
||||
|
||||
|
||||
|
||||
// Text styles
|
||||
static let fontName = "Roboto"
|
||||
static let call_header_title = TextStyle(fgColor: LightDarkColor(.white,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .center, font: fontName+"-Bold", size: 18.0)
|
||||
|
|
@ -118,19 +120,19 @@ import UIKit
|
|||
|
||||
|
||||
static let conference_participant_admin_label = TextStyle(fgColor: primarySubtextLightColor, bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Bold", size: 13.0)
|
||||
static let conference_participant_name_font = TextStyle(fgColor: LightDarkColor(dark_grey_color,dark_grey_color), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Regular", size: 18.0)
|
||||
static let conference_participant_name_font = TextStyle(fgColor: LightDarkColor(dark_grey_color,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Regular", size: 18.0)
|
||||
static let conference_participant_sip_uri_font = TextStyle(fgColor: LightDarkColor(primary_color,primary_color), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Regular", size: 12.0)
|
||||
static let conference_participant_name_font_grid = TextStyle(fgColor: LightDarkColor(.white,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Bold", size: 15.0)
|
||||
static let conference_participant_name_font_as = TextStyle(fgColor: LightDarkColor(.white,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Bold", size: 12.0)
|
||||
static let conference_participant_name_font_audio_only = TextStyle(fgColor: LightDarkColor(.white,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName, size: 14.0)
|
||||
|
||||
static let conference_mode_title = TextStyle(fgColor: LightDarkColor(dark_grey_color,dark_grey_color), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Regular", size: 17.0)
|
||||
static let conference_mode_title = TextStyle(fgColor: LightDarkColor(dark_grey_color,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Regular", size: 17.0)
|
||||
static let conference_mode_title_selected = conference_mode_title.boldEd()
|
||||
static let conference_scheduling_font = TextStyle(fgColor: voipTextColor, bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Regular", size: 17.0)
|
||||
static let conference_invite_desc_font = TextStyle(fgColor: LightDarkColor(dark_grey_color,dark_grey_color), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Regular", size: 14.0)
|
||||
static let conference_invite_desc_title_font = TextStyle(fgColor: LightDarkColor(voip_dark_gray,voip_dark_gray), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Bold", size: 14.0)
|
||||
static let conference_invite_subject_font = TextStyle(fgColor: LightDarkColor(voip_dark_gray,voip_dark_gray), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Bold", size: 14.0)
|
||||
static let conference_invite_title_font = TextStyle(fgColor: LightDarkColor(dark_grey_color,dark_grey_color), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Bold", size: 16.0)
|
||||
static let conference_invite_desc_font = TextStyle(fgColor: LightDarkColor(dark_grey_color,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Regular", size: 14.0)
|
||||
static let conference_invite_desc_title_font = TextStyle(fgColor: LightDarkColor(voip_dark_gray,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Bold", size: 14.0)
|
||||
static let conference_invite_subject_font = TextStyle(fgColor: LightDarkColor(voip_dark_gray,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Bold", size: 14.0)
|
||||
static let conference_invite_title_font = TextStyle(fgColor: LightDarkColor(dark_grey_color,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Bold", size: 16.0)
|
||||
static let conference_cancelled_title_font = TextStyle(fgColor: LightDarkColor(.red,.red), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Bold", size: 16.0)
|
||||
static let conference_updated_title_font = TextStyle(fgColor: LightDarkColor(voip_conference_updated,voip_conference_updated), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Bold", size: 16.0)
|
||||
|
||||
|
|
@ -138,9 +140,9 @@ import UIKit
|
|||
static let conference_waiting_room_no_video_font = TextStyle(fgColor: LightDarkColor(.white,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .center, font: fontName+"-Regular", size: 16.0)
|
||||
|
||||
static let empty_list_font = TextStyle(fgColor: primaryTextColor, bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .center, font: fontName+"-Regular", size: 18.0)
|
||||
static let conf_list_filter_button_font = TextStyle(fgColor: LightDarkColor(.black,.black), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .center, font: fontName+"-Regular", size: 14.0)
|
||||
static let conference_list_subject_font = TextStyle(fgColor: LightDarkColor(voip_dark_gray,voip_dark_gray), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Bold", size: 18.0)
|
||||
static let conference_list_address_desc_font = TextStyle(fgColor: LightDarkColor(voip_dark_gray,voip_dark_gray), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Regular", size: 18.0)
|
||||
static let conf_list_filter_button_font = TextStyle(fgColor: LightDarkColor(.black,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .center, font: fontName+"-Regular", size: 14.0)
|
||||
static let conference_list_subject_font = TextStyle(fgColor: LightDarkColor(voip_dark_gray,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Bold", size: 18.0)
|
||||
static let conference_list_address_desc_font = TextStyle(fgColor: LightDarkColor(voip_dark_gray,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Regular", size: 18.0)
|
||||
|
||||
|
||||
// Buttons Background (State colors)
|
||||
|
|
@ -211,7 +213,7 @@ import UIKit
|
|||
]
|
||||
|
||||
static let button_conference_list_filter = [
|
||||
UIButton.State.normal.rawValue : LightDarkColor(light_grey_color,light_grey_color),
|
||||
UIButton.State.normal.rawValue : LightDarkColor(light_grey_color,dark_grey_color),
|
||||
UIButton.State.selected.rawValue : LightDarkColor(primary_color.withAlphaComponent(0.24),primary_color.withAlphaComponent(0.24)),
|
||||
]
|
||||
|
||||
|
|
@ -331,14 +333,14 @@ import UIKit
|
|||
|
||||
static let voip_edit = ButtonTheme(
|
||||
tintableStateIcons:[
|
||||
UIButton.State.normal.rawValue : TintableIcon(name: "voip_edit",tintColor: LightDarkColor(dark_grey_color,dark_grey_color)),
|
||||
UIButton.State.normal.rawValue : TintableIcon(name: "voip_edit",tintColor: LightDarkColor(dark_grey_color,.white)),
|
||||
UIButton.State.highlighted.rawValue : TintableIcon(name: "voip_edit",tintColor: voipDrawableColorHighlighted)
|
||||
],
|
||||
backgroundStateColors: [UIButton.State.normal.rawValue : LightDarkColor(.clear,.clear)])
|
||||
|
||||
static let radio_button = ButtonTheme(
|
||||
tintableStateIcons:[
|
||||
UIButton.State.normal.rawValue : TintableIcon(name: "voip_radio_off",tintColor: LightDarkColor(dark_grey_color,dark_grey_color)),
|
||||
UIButton.State.normal.rawValue : TintableIcon(name: "voip_radio_off",tintColor: LightDarkColor(dark_grey_color,.white)),
|
||||
UIButton.State.selected.rawValue : TintableIcon(name: "voip_radio_on",tintColor: LightDarkColor(primary_color,primary_color))
|
||||
],
|
||||
backgroundStateColors: [UIButton.State.normal.rawValue : LightDarkColor(.clear,.clear)])
|
||||
|
|
@ -381,9 +383,9 @@ import UIKit
|
|||
static func nav_button(_ iconName:String) -> ButtonTheme {
|
||||
return ButtonTheme(
|
||||
tintableStateIcons:[
|
||||
UIButton.State.normal.rawValue : TintableIcon(name: iconName,tintColor: LightDarkColor(.darkGray,.white)),
|
||||
UIButton.State.normal.rawValue : TintableIcon(name: iconName,tintColor: LightDarkColor(voip_dark_gray,.white)),
|
||||
UIButton.State.highlighted.rawValue : TintableIcon(name: iconName,tintColor: LightDarkColor(primary_color,primary_color)),
|
||||
UIButton.State.disabled.rawValue : TintableIcon(name: iconName,tintColor: LightDarkColor(light_grey_color,light_grey_color)),
|
||||
UIButton.State.disabled.rawValue : TintableIcon(name: iconName,tintColor: LightDarkColor(light_grey_color,.white)),
|
||||
],
|
||||
backgroundStateColors: [:])
|
||||
}
|
||||
|
|
@ -401,17 +403,27 @@ import UIKit
|
|||
]
|
||||
|
||||
static let conference_create_button = [
|
||||
UIButton.State.normal.rawValue : TintableIcon(name: "voip_conference_new",tintColor: LightDarkColor(voip_dark_gray,voip_dark_gray)),
|
||||
UIButton.State.normal.rawValue : TintableIcon(name: "voip_conference_new",tintColor: LightDarkColor(.darkGray,.white)),
|
||||
UIButton.State.highlighted.rawValue : TintableIcon(name: "voip_conference_new",tintColor: LightDarkColor(primary_color,primary_color)),
|
||||
UIButton.State.disabled.rawValue : TintableIcon(name: "voip_conference_new",tintColor: LightDarkColor(voip_light_gray,voip_light_gray)),
|
||||
]
|
||||
|
||||
static let generic_delete_button = [
|
||||
UIButton.State.normal.rawValue : TintableIcon(name: "voip_conference_new",tintColor: LightDarkColor(voip_dark_gray,voip_dark_gray)),
|
||||
UIButton.State.highlighted.rawValue : TintableIcon(name: "voip_conference_new",tintColor: LightDarkColor(primary_color,primary_color)),
|
||||
UIButton.State.disabled.rawValue : TintableIcon(name: "voip_conference_new",tintColor: LightDarkColor(voip_light_gray,voip_light_gray)),
|
||||
UIButton.State.normal.rawValue : TintableIcon(name: "delete_default",tintColor: LightDarkColor(.darkGray,.white)),
|
||||
UIButton.State.highlighted.rawValue : TintableIcon(name: "delete_default",tintColor: LightDarkColor(primary_color,primary_color)),
|
||||
UIButton.State.disabled.rawValue : TintableIcon(name: "delete_disabled",tintColor: LightDarkColor(voip_light_gray,.white)),
|
||||
]
|
||||
|
||||
static let generic_back = [
|
||||
UIButton.State.normal.rawValue : TintableIcon(name: "back_default",tintColor: LightDarkColor(.darkGray,.white)),
|
||||
UIButton.State.highlighted.rawValue : TintableIcon(name: "back_default",tintColor: LightDarkColor(primary_color,primary_color)),
|
||||
UIButton.State.disabled.rawValue : TintableIcon(name: "back_default",tintColor: LightDarkColor(voip_light_gray,voip_light_gray)),
|
||||
]
|
||||
|
||||
static let generic_cancel = [
|
||||
UIButton.State.normal.rawValue : TintableIcon(name: "cancel_edit_default",tintColor: LightDarkColor(.darkGray,.white)),
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,9 @@ import linphonesw
|
|||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
view.backgroundColor = VoipTheme.voipBackgroundColor.get()
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
self.view.backgroundColor = VoipTheme.voipBackgroundColor.get()
|
||||
}
|
||||
|
||||
// Hangup
|
||||
let hangup = CallControlButton(width: 65, imageInset:IncomingOutgoingCommonView.answer_decline_inset, buttonTheme: VoipTheme.call_terminate, onClickAction: {
|
||||
|
|
@ -212,9 +214,6 @@ import linphonesw
|
|||
self.dismissableView = VoipConferenceDisplayModeSelectionView()
|
||||
self.view.addSubview(self.dismissableView!)
|
||||
self.dismissableView?.matchParentDimmensions().done()
|
||||
let activeDisplayMode = ConferenceViewModel.shared.conferenceDisplayMode.value!
|
||||
let indexPath = IndexPath(row: activeDisplayMode == .Grid ? 0 : activeDisplayMode == .ActiveSpeaker ? 1 : 2, section: 0)
|
||||
(self.dismissableView as! VoipConferenceDisplayModeSelectionView).optionsListView.selectRow(at:indexPath, animated: true, scrollPosition: .bottom)
|
||||
}
|
||||
|
||||
// Shading mask, everything before will be shaded upon displaying of the mask
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ import linphonesw
|
|||
callsListTableView.allowsFocus = false
|
||||
}
|
||||
callsListTableView.separatorStyle = .singleLine
|
||||
callsListTableView.separatorColor = .white
|
||||
callsListTableView.onClick {
|
||||
self.hideMenu()
|
||||
}
|
||||
|
|
@ -90,6 +89,13 @@ import linphonesw
|
|||
|
||||
menuView.isHidden = true
|
||||
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
super.contentView.backgroundColor = VoipTheme.voipBackgroundBWColor.get()
|
||||
self.callsListTableView.backgroundColor = VoipTheme.voipBackgroundBWColor.get()
|
||||
self.callsListTableView.separatorColor = VoipTheme.separatorColor.get()
|
||||
self.callsListTableView.reloadData()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -368,6 +368,15 @@ class VoipConferenceActiveSpeakerView: UIView, UICollectionViewDataSource, UICol
|
|||
|
||||
//Rotation
|
||||
layoutRotatableElements()
|
||||
|
||||
//Appearance
|
||||
UIDeviceBridge.displayModeSwitched.observe { _ in
|
||||
fullScreenMutableView.backgroundColor = ControlsViewModel.shared.fullScreenMode.value == true ? .black : VoipTheme.voipBackgroundColor.get()
|
||||
self.fullScreenOpaqueMasqForNotchedDevices.backgroundColor = fullScreenMutableView.backgroundColor
|
||||
self.activeSpeakerView.backgroundColor = VoipTheme.voipParticipantBackgroundColor.get()
|
||||
self.pause.backgroundColor = self.activeSpeakerAvatar.backgroundColor
|
||||
self.reloadData()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,13 @@ class VoipConferenceAudioOnlyView: UIView, UICollectionViewDataSource, UICollect
|
|||
grid.matchParentDimmensions().done()
|
||||
|
||||
headerView.matchParentSideBorders().alignParentTop().done()
|
||||
|
||||
|
||||
//Appearance
|
||||
UIDeviceBridge.displayModeSwitched.observe { _ in
|
||||
self.gridContainer.backgroundColor = VoipTheme.voipBackgroundColor.get()
|
||||
self.reloadData()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -39,9 +39,16 @@ import linphonesw
|
|||
optionsListView.delegate = self
|
||||
optionsListView.register(ConferenceDisplayModeSelectionCell.self, forCellReuseIdentifier: "ConferenceDisplayModeSelectionCell")
|
||||
optionsListView.separatorStyle = .singleLine
|
||||
optionsListView.separatorColor = VoipTheme.light_grey_color
|
||||
optionsListView.separatorColor = VoipTheme.separatorColor.get()
|
||||
optionsListView.isScrollEnabled = false
|
||||
super.contentView.backgroundColor = .white
|
||||
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
super.contentView.backgroundColor = VoipTheme.voipBackgroundBWColor.get()
|
||||
self.optionsListView.backgroundColor = VoipTheme.voipBackgroundBWColor.get()
|
||||
self.optionsListView.separatorColor = VoipTheme.separatorColor.get()
|
||||
self.optionsListView.reloadData()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// TableView datasource delegate
|
||||
|
|
@ -63,6 +70,7 @@ import linphonesw
|
|||
ConferenceViewModel.shared.conferenceDisplayMode.value = .Grid
|
||||
}, image:(UIImage(named: "voip_conference_mosaic")?.tinted(with: VoipTheme.voipDrawableColor.get())!)!)
|
||||
cell.isUserInteractionEnabled = ConferenceViewModel.shared.conferenceParticipantDevices.value!.count <= ConferenceViewModel.shared.maxParticipantsForMosaicLayout
|
||||
cell.isSelected = ConferenceViewModel.shared.conferenceDisplayMode.value == .Grid
|
||||
}
|
||||
if (indexPath.row == 1) {
|
||||
cell.setOption(title: VoipTexts.conference_display_mode_active_speaker, onSelectAction: {
|
||||
|
|
@ -70,6 +78,7 @@ import linphonesw
|
|||
ConferenceViewModel.shared.conferenceDisplayMode.value = .ActiveSpeaker
|
||||
}, image:(UIImage(named: "voip_conference_active_speaker")?.tinted(with: VoipTheme.voipDrawableColor.get())!)!)
|
||||
cell.isUserInteractionEnabled = true
|
||||
cell.isSelected = ConferenceViewModel.shared.conferenceDisplayMode.value == .ActiveSpeaker
|
||||
}
|
||||
|
||||
if (indexPath.row == 2) {
|
||||
|
|
@ -78,6 +87,7 @@ import linphonesw
|
|||
ConferenceViewModel.shared.conferenceDisplayMode.value = .AudioOnly
|
||||
}, image:(UIImage(named: "voip_conference_audio_only")?.tinted(with: VoipTheme.voipDrawableColor.get())!)!)
|
||||
cell.isUserInteractionEnabled = true
|
||||
cell.isSelected = ConferenceViewModel.shared.conferenceDisplayMode.value == .AudioOnly
|
||||
}
|
||||
|
||||
cell.separatorInset = .zero
|
||||
|
|
@ -146,6 +156,8 @@ class ConferenceDisplayModeSelectionCell : UITableViewCell {
|
|||
contentView.addSubview(icon)
|
||||
icon.size(w: icon_size, h: icon_size).alignParentRight(withMargin: side_margins).centerY().done()
|
||||
radio.isUserInteractionEnabled = false
|
||||
contentView.backgroundColor = .clear
|
||||
backgroundColor = .clear
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
|
|
|
|||
|
|
@ -182,6 +182,13 @@ class VoipConferenceGridView: UIView, UICollectionViewDataSource, UICollectionVi
|
|||
self.reloadData()
|
||||
}
|
||||
}
|
||||
|
||||
//Appearance
|
||||
UIDeviceBridge.displayModeSwitched.observe { _ in
|
||||
self.gridContainer.backgroundColor = ControlsViewModel.shared.fullScreenMode.value == true ? .black : VoipTheme.voipBackgroundColor.get()
|
||||
self.reloadData()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,10 @@ class DismissableView: UIView {
|
|||
|
||||
self.addSubview(contentView)
|
||||
contentView.alignUnder(view: headerView).matchParentSideBorders().alignParentBottom().done()
|
||||
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
self.headerView.backgroundColor = VoipTheme.voipToolbarBackgroundColor.get()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,12 @@ import linphonesw
|
|||
noParticipantsLabel.center().matchParentSideBorders(insetedByDx: side_margin).done()
|
||||
noParticipantsLabel.isHidden = ConferenceViewModel.shared.conferenceParticipants.value?.count ?? 0 > 0
|
||||
noParticipantsLabel.numberOfLines = 2
|
||||
|
||||
self.participantsListTableView.backgroundColor = VoipTheme.voipBackgroundBWColor.get()
|
||||
|
||||
UIDeviceBridge.displayModeSwitched.observe { _ in
|
||||
self.participantsListTableView.backgroundColor = VoipTheme.voipBackgroundBWColor.get()
|
||||
self.participantsListTableView.reloadData()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,8 @@ class VoipParticipantCell: UITableViewCell {
|
|||
isAdminView.leadingAnchor.constraint(greaterThanOrEqualTo: leadingAnchor).isActive = true
|
||||
isAdminView.trailingAnchor.constraint(equalTo: trailingAnchor).isActive = true
|
||||
isAdminView.matchParentHeight().toRightOf(nameAddress).alignParentRight(withMargin: dismiss_right_margin).done()
|
||||
|
||||
contentView.backgroundColor = .clear
|
||||
backgroundColor = .clear
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
|
|
|
|||
|
|
@ -46,6 +46,10 @@ class Avatar : UIView {
|
|||
iconImageView.backgroundColor = .white
|
||||
initialsLabel.matchParentSideBorders().matchParentHeight().done()
|
||||
iconImageView.matchParentDimmensions().done()
|
||||
UIDeviceBridge.displayModeSwitched.observe { _ in
|
||||
self.initialsLabel.applyStyle(textStyle)
|
||||
self.backgroundColor = color.get()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -76,6 +76,9 @@ class CallControlButton : ButtonWithStateBackgrounds {
|
|||
onClick {
|
||||
self.onClickAction?()
|
||||
}
|
||||
UIDeviceBridge.displayModeSwitched.observe { _ in
|
||||
self.applyTintedIcons(tintedIcons: buttonTheme.tintableStateIcons)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,9 +42,11 @@ class FormButton : ButtonWithStateBackgrounds {
|
|||
super.init(backgroundStateColors: backgroundStateColors)
|
||||
layer.cornerRadius = button_radius
|
||||
clipsToBounds = true
|
||||
applyTitleStyle(bold ? VoipTheme.form_button_bold : VoipTheme.form_button_light)
|
||||
height(button_height).done()
|
||||
addSidePadding()
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
self.applyTitleStyle(bold ? VoipTheme.form_button_bold : VoipTheme.form_button_light)
|
||||
}
|
||||
}
|
||||
|
||||
convenience init (title:String, backgroundStateColors: [UInt: LightDarkColor], bold:Bool = true, fixedSize:Bool = true) {
|
||||
|
|
|
|||
|
|
@ -58,23 +58,29 @@ class StyledDatePicker: UIView {
|
|||
datePicker.matchParentDimmensions().done()
|
||||
|
||||
formattedLabel.isUserInteractionEnabled = false
|
||||
formattedLabel.backgroundColor = VoipTheme.voipFormBackgroundColor.get()
|
||||
addSubview(formattedLabel)
|
||||
formattedLabel.matchParentDimmensions().done()
|
||||
|
||||
let chevron = UIImageView(image: UIImage(named: "chevron_list_close"))
|
||||
let chevron = UIImageView()
|
||||
|
||||
|
||||
addSubview(chevron)
|
||||
chevron.alignParentRight(withMargin: chevron_margin).centerY().done()
|
||||
chevron.isHidden = readOnly
|
||||
|
||||
setFormInputBackground(readOnly:readOnly)
|
||||
height(form_input_height).done()
|
||||
|
||||
if (readOnly) {
|
||||
formattedLabel.textColor = formattedLabel.textColor.withAlphaComponent(0.5)
|
||||
}
|
||||
|
||||
isUserInteractionEnabled = !readOnly
|
||||
self.liveValue = liveValue
|
||||
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
self.setFormInputBackground(readOnly:readOnly)
|
||||
self.formattedLabel.backgroundColor = VoipTheme.voipFormBackgroundColor.get()
|
||||
chevron.image = UIImage(named: "chevron_list_close")?.tinted(with: VoipTheme.voipDrawableColor.get())
|
||||
if (readOnly) {
|
||||
self.formattedLabel.textColor = self.formattedLabel.textColor.withAlphaComponent(0.5)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ class StyledLabel: UILabel {
|
|||
super.init(frame: .zero)
|
||||
self.text = text
|
||||
applyStyle(style)
|
||||
UIDeviceBridge.displayModeSwitched.observe { _ in
|
||||
self.applyStyleColors(style)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ class StyledTextView: UITextView, UITextViewDelegate {
|
|||
super.init(frame:.zero, textContainer: nil)
|
||||
textContainer.maximumNumberOfLines = maxLines
|
||||
applyStyle(style)
|
||||
setFormInputBackground(readOnly:readOnly)
|
||||
placeHolder.map {
|
||||
self.placeholder = $0
|
||||
}
|
||||
|
|
@ -66,6 +65,10 @@ class StyledTextView: UITextView, UITextViewDelegate {
|
|||
textColor = textColor?.withAlphaComponent(0.5)
|
||||
}
|
||||
isUserInteractionEnabled = !readOnly
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
self.applyStyleColors(style)
|
||||
self.setFormInputBackground(readOnly:readOnly)
|
||||
}
|
||||
}
|
||||
|
||||
func textViewDidBeginEditing(_ textView: UITextView) {
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ class StyledValuePicker: UIView {
|
|||
super.init(frame: .zero)
|
||||
|
||||
formattedLabel.isUserInteractionEnabled = false
|
||||
formattedLabel.backgroundColor = VoipTheme.voipFormBackgroundColor.get()
|
||||
liveIndex.value.map { formattedLabel.text = " "+options[$0] }
|
||||
|
||||
if (readOnly) {
|
||||
|
|
@ -55,25 +54,20 @@ class StyledValuePicker: UIView {
|
|||
addSubview(formattedLabel)
|
||||
formattedLabel.alignParentLeft().alignParentRight(withMargin: (readOnly ? chevron_margin : form_input_height)).matchParentHeight().done()
|
||||
|
||||
let chevron = UIImageView(image: UIImage(named: "chevron_list_close"))
|
||||
let chevron = UIImageView()
|
||||
|
||||
addSubview(chevron)
|
||||
chevron.alignParentRight(withMargin: chevron_margin).centerY().done()
|
||||
chevron.isHidden = readOnly
|
||||
|
||||
setFormInputBackground(readOnly:readOnly)
|
||||
|
||||
|
||||
DropDown.appearance().textColor = VoipTheme.conference_scheduling_font.fgColor.get()
|
||||
DropDown.appearance().selectedTextColor = VoipTheme.conference_scheduling_font.fgColor.get()
|
||||
|
||||
DropDown.appearance().textFont = formattedLabel.font
|
||||
DropDown.appearance().backgroundColor = .white
|
||||
DropDown.appearance().selectionBackgroundColor = VoipTheme.light_grey_color
|
||||
DropDown.appearance().cellHeight = form_input_height
|
||||
|
||||
dropDown.anchorView = self
|
||||
dropDown.bottomOffset = CGPoint(x: 0, y:(dropDown.anchorView?.plainView.bounds.height)!)
|
||||
dropDown.dataSource = options
|
||||
dropDown.backgroundColor = .white
|
||||
dropDown.width = dropdown_width
|
||||
|
||||
dropDown.selectionAction = { [unowned self] (index: Int, item: String) in
|
||||
|
|
@ -96,6 +90,17 @@ class StyledValuePicker: UIView {
|
|||
}
|
||||
isUserInteractionEnabled = !readOnly
|
||||
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
chevron.image = UIImage(named: "chevron_list_close")?.tinted(with: VoipTheme.voipDrawableColor.get())
|
||||
self.formattedLabel.backgroundColor = VoipTheme.voipFormBackgroundColor.get()
|
||||
DropDown.appearance().textColor = VoipTheme.conference_scheduling_font.fgColor.get()
|
||||
DropDown.appearance().selectedTextColor = VoipTheme.conference_scheduling_font.fgColor.get()
|
||||
DropDown.appearance().backgroundColor = VoipTheme.voipFormBackgroundColor.get()
|
||||
DropDown.appearance().selectionBackgroundColor = VoipTheme.backgroundWhiteBlack.get()
|
||||
self.dropDown.backgroundColor = VoipTheme.backgroundWhiteBlack.get()
|
||||
self.setFormInputBackground(readOnly:readOnly)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func setIndex(index: Int) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue