Skip to content

Commit

Permalink
chore(release): update DyteUiKit to 0.6.6
Browse files Browse the repository at this point in the history
  • Loading branch information
dyte-devel committed Apr 22, 2024
1 parent 8f2c2dc commit 04cff75
Show file tree
Hide file tree
Showing 19 changed files with 128 additions and 1,088 deletions.
7 changes: 4 additions & 3 deletions DyteUiKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'DyteUiKit'
s.version = '0.6.5'
s.version = '0.6.6'
s.summary = 'Customise UI of your Dyte meetings'

s.description = "Customise UI of your Dyte meetings. You can use this prebuilt meeting flow or you can customise it on individual component level"
Expand All @@ -25,7 +25,8 @@ Pod::Spec.new do |s|
s.swift_version = "5.0"
s.ios.frameworks = ['UIKit', 'AVFAudio']
s.resource_bundle = { 'DyteUiKit' => 'DyteUiKit/Resources/*' }
s.dependency 'DyteiOSCore' , '1.34.1'
s.dependency 'AmazonIVSPlayer' , '1.19.0'
s.module_name = 'DyteUiKit'
s.dependency 'DyteiOSCore', '~> 1.34.4'
s.dependency 'DyteWebRTC', '~> 0.0.4'
s.dependency 'AmazonIVSPlayer', '~> 1.19.0'
end
993 changes: 0 additions & 993 deletions DyteUiKit/DyteUiKit.xcodeproj/project.pbxproj

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ open class DyteBaseViewController: UIViewController, AdaptableUI {
waitingView.set(.fillSuperView(self.view))
self.view.endEditing(true)
waitingRoomView = waitingView
waitingView.show(status: status)
waitingView.show(status: ParticipantMeetingStatus.getStatus(status: status))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public class LivestreamViewController: UIViewController {
self.viewModel.dyteSelfListner.observeSelfRemoved { [weak self] success in
guard let self = self else {return}

func showWaitingRoom(status: WaitListStatus, time:TimeInterval, onComplete:@escaping()->Void) {
func showWaitingRoom(status: ParticipantMeetingStatus, time:TimeInterval, onComplete:@escaping()->Void) {
if status != .none {
let waitingView = WaitingRoomView(automaticClose: true, onCompletion: onComplete)
waitingView.backgroundColor = self.view.backgroundColor
Expand All @@ -93,7 +93,7 @@ public class LivestreamViewController: UIViewController {
}
}

showWaitingRoom(status: .rejected, time: 2) { [weak self] in
showWaitingRoom(status: .meetingEnded, time: 2) { [weak self] in
guard let self = self else {return}
self.viewModel.clean()
self.completion()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public class MeetingViewController: DyteBaseViewController {
self.viewModel.dyteSelfListner.observeSelfRemoved { [weak self] success in
guard let self = self else {return}

func showWaitingRoom(status: WaitListStatus, time:TimeInterval, onComplete:@escaping()->Void) {
func showWaitingRoom(status: ParticipantMeetingStatus, time:TimeInterval, onComplete:@escaping()->Void) {
if status != .none {
let waitingView = WaitingRoomView(automaticClose: true, onCompletion: onComplete)
waitingView.backgroundColor = self.view.backgroundColor
Expand All @@ -129,7 +129,7 @@ public class MeetingViewController: DyteBaseViewController {
}
}
//self.dismiss(animated: true)
showWaitingRoom(status: .rejected, time: 2) { [weak self] in
showWaitingRoom(status: .meetingEnded, time: 2) { [weak self] in
guard let self = self else {return}
self.viewModel.clean()
self.onFinishedMeeting()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ extension ParticipantInCallTableViewCell: ConfigureView {
guard let self = self else {return}
self.audioButton.isSelected = !isEnabled
}
model.participantUpdateEventListner.observePinState { [weak self] isPinned, observer in
guard let self = self else {return}
self.setPinView(isHidden: !isPinned)
}
model.participantUpdateEventListner.observeVideoState { [weak self] isEnabled, observer in
guard let self = self else {return}
self.videoButton.isSelected = !isEnabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,11 @@ extension WebinarParticipantViewController: UITableViewDataSource {
else if let cell = cell as? WebinarViewersTableViewCell {
cell.buttonMoreClick = { [weak self] button in
guard let self = self else {return}
if cell.model.participantUpdateEventListner.participant.userId == viewModel.mobileClient.localUser.userId {
if self.createMoreMenuForViewers(participantListner: cell.model.participantUpdateEventListner, indexPath: indexPath) {
if self.isDebugModeOn {
print("Debug DyteUIKit | Critical UIBug Please check why we are showing this button")
}
}
}
}
cell.setPinView(isHidden: !cell.model.participantUpdateEventListner.participant.isPinned)
}
Expand Down Expand Up @@ -258,6 +256,7 @@ extension WebinarParticipantViewController: UITableViewDataSource {
}
return cell
}

private func createMoreMenuForViewers(participantListner: DyteParticipantUpdateEventListner, indexPath: IndexPath)-> Bool {
var menus = [MenuType]()
let participant = participantListner.participant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,13 @@ extension WebinarParticipantViewControllerModel {
image = DyteImage(url: url)
}


sectionTwo.insert(TableItemSearchableConfigurator<ParticipantInCallTableViewCell,ParticipantInCallTableViewCellModel>(model:ParticipantInCallTableViewCellModel(image: image, title: name, showBottomSeparator: showBottomSeparator, showTopSeparator: false, participantUpdateEventListner: DyteParticipantUpdateEventListner(participant: participant), showMoreButton: showMoreButton())))
}
}
return sectionTwo
}


private func getInCallViewers(minimumParticpantCountToShowSearchBar: Int) -> BaseConfiguratorSection<CollectionTableConfigurator> {
var joinedParticipants = [DyteJoinedMeetingParticipant]()
joinedParticipants.append(contentsOf: self.mobileClient.stage.viewers)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,25 @@ public class DyteChatViewController: DyteBaseViewController, NSTextStorageDelega
var messageTextFieldBottomConstraint: NSLayoutConstraint?
var sendFileButtonBottomConstraint: NSLayoutConstraint?
var sendButtonBottomConstraint: NSLayoutConstraint?

let sendFileButtonDisabledView: UIView = {
let view = UIView()
view.backgroundColor = DesignLibrary.shared.color.background.shade1000
view.alpha = 0.8
return view
}()

let sendTextViewDisabledView: UIView = {
let view = UIView()
view.backgroundColor = DesignLibrary.shared.color.background.shade1000
view.alpha = 0.8
return view
}()

let sendFileButton = DyteButton(style: .iconOnly(icon: DyteImage(image: ImageProvider.image(named: "icon_chat_add"))), dyteButtonState: .focus)
let sendImageButton = DyteButton(style: .iconOnly(icon: DyteImage(image: ImageProvider.image(named: "icon_image"))), dyteButtonState: .active)
let sendMessageButton = DyteButton(style: .iconOnly(icon: DyteImage(image: ImageProvider.image(named: "icon_chat_send"))), dyteButtonState: .active)

var documentsViewController: DocumentsViewController?
let imagePicker = UIImagePickerController()
let backgroundColor = DesignLibrary.shared.color.background.shade1000
Expand Down Expand Up @@ -66,6 +82,16 @@ public class DyteChatViewController: DyteBaseViewController, NSTextStorageDelega
addWaitingRoom {}
setUpReconnection(failed: {}, success: {})
loadChatMessages()
addPermissionUpdateObserver()
}

func addPermissionUpdateObserver() {
dyteSelfListner.observeSelfPermissionChanged { [weak self] in
guard let self = self else {
return
}
self.refreshPermission()
}
}

public override func viewWillAppear(_ animated: Bool) {
Expand Down Expand Up @@ -176,6 +202,7 @@ public class DyteChatViewController: DyteBaseViewController, NSTextStorageDelega
button.accessibilityIdentifier = "Cross_Button"
return button
}()

leftButton.backgroundColor = navigationItem.backBarButtonItem?.tintColor
leftButton.addTarget(self, action: #selector(goBack), for: .touchUpInside)
let customBarButtonItem = UIBarButtonItem(customView: leftButton)
Expand All @@ -191,29 +218,15 @@ public class DyteChatViewController: DyteBaseViewController, NSTextStorageDelega
sendFileButton.setImage(fileIcon, for: .normal)
sendFileButton.addTarget(self, action: #selector(menuTapped), for: .touchUpInside)
view.addSubview(sendFileButton)
if self.meeting.localUser.permissions.chat.canSendFiles {
sendFileButton.set(.width(48))
sendFileButton.isHidden = false
} else {
sendFileButton.set(.width(0))
sendFileButton.isHidden = true
}

// let imageIcon = ImageProvider.image(named: "icon_image")
// sendImageButton.setImage(imageIcon, for: .normal)
// sendImageButton.set(.width(48))
// sendImageButton.addTarget(self, action: #selector(addImageButtonTapped), for: .touchUpInside)
// view.addSubview(sendImageButton)


sendFileButton.set(.width(48))
sendFileButton.addSubview(sendFileButtonDisabledView)
sendFileButtonDisabledView.set(.fillSuperView(sendFileButton))
sendMessageButton.set(.width(48))
sendMessageButton.backgroundColor = dyteSharedTokenColor.brand.shade500
sendMessageButton.clipsToBounds = true
sendMessageButton.addTarget(self, action: #selector(sendButtonTapped), for: .touchUpInside)
view.addSubview(sendMessageButton)



// add constraints
let constraints = [
messageTableView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
Expand All @@ -232,22 +245,24 @@ public class DyteChatViewController: DyteBaseViewController, NSTextStorageDelega
sendMessageButton.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -8),
]

// configure addImageButton
// addImageButton.setTitle("Add Image", for: .normal)
// addImageButton.addTarget(self, action: #selector(addImageButtonTapped), for: .touchUpInside)
// addImageButton.translatesAutoresizingMaskIntoConstraints = false
// view.addSubview(addImageButton)
//
//
// addFileButton.setTitle("Add File", for: .normal)
// addFileButton.addTarget(self, action: #selector(addFileButtonTapped), for: .touchUpInside)
// addFileButton.translatesAutoresizingMaskIntoConstraints = false
// view.addSubview(addFileButton)

NSLayoutConstraint.activate(constraints)
messageTextViewHeightConstraint = messageTextView.heightAnchor.constraint(equalToConstant: 48)
messageTextViewHeightConstraint?.isActive = true
}
view.addSubview(sendTextViewDisabledView)
sendTextViewDisabledView.set(.sameTopBottom(sendMessageButton),
.leading(messageTextView),
.trailing(sendMessageButton))
refreshPermission()
}

private func refreshPermission() {
let canSendFiles = self.meeting.localUser.permissions.chat.canSendFiles
let canSendText = self.meeting.localUser.permissions.chat.canSendText
self.sendTextViewDisabledView.isHidden = canSendText
self.sendFileButtonDisabledView.isHidden = canSendFiles
messageTextView.resignFirstResponder()
}


private func createMoreMenu() {
var menus = [MenuType]()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ public class DyteSetupViewController: DyteBaseViewController, KeyboardObservable
super.viewDidLoad()
setupView()
self.view.backgroundColor = backgroundColor

}

private var viewModel: SetupViewModel!
Expand Down Expand Up @@ -581,7 +580,7 @@ extension DyteSetupViewController {
waitingView.set(.fillSuperView(self.view))
self.view.endEditing(true)
waitingRoomView = waitingView
waitingView.show(status: status)
waitingView.show(status: ParticipantMeetingStatus.getStatus(status: status))
}
}
}
Expand Down
48 changes: 42 additions & 6 deletions DyteUiKit/DyteUiKit/DyteUiKit/Screens/Setup/WaitingRoomView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,32 @@
import UIKit
import DyteiOSCore


public enum ParticipantMeetingStatus {
case waiting
case rejected
case accepted
case kicked
case meetingEnded
case none
}

extension ParticipantMeetingStatus {
static func getStatus(status: WaitListStatus) -> ParticipantMeetingStatus {
switch status {
case .accepted:
return .accepted
case .waiting:
return .waiting
case .rejected:
return .rejected
default:
return .none
}
}
}


public class WaitingRoomView: UIView {

var titleLabel: DyteLabel = {
Expand Down Expand Up @@ -53,7 +79,7 @@ public class WaitingRoomView: UIView {
baseView.addSubViews(titleLabel,buttonBaseView)
titleLabel.set(.sameLeadingTrailing(baseView),
.top(baseView))
buttonBaseView.set(.sameLeadingTrailing(baseView), .below(titleLabel),
buttonBaseView.set(.sameLeadingTrailing(baseView), .below(titleLabel, dyteSharedTokenSpace.space2),
.bottom(baseView))
}

Expand All @@ -69,20 +95,30 @@ public class WaitingRoomView: UIView {
self.onComplete()
}

public func show(status: WaitListStatus) {
public func show(status: ParticipantMeetingStatus) {
self.button.isHidden = true
if status == WaitListStatus.waiting {
if status == .waiting {
self.titleLabel.text = "You are in the waiting room, the host will let you in soon."
self.titleLabel.textColor = dyteSharedTokenColor.textColor.onBackground.shade1000

}else if status == WaitListStatus.accepted {
}else if status == .accepted {
self.removeFromSuperview()
}else if status == WaitListStatus.rejected {
}else if status == .rejected {
self.titleLabel.text = "Your request to join the meeting was denied."
self.titleLabel.textColor = dyteSharedTokenColor.status.danger
self.button.isHidden = false

}
else if status == .kicked {
self.titleLabel.text = "Your were removed from the meeting"
self.titleLabel.textColor = dyteSharedTokenColor.status.danger
self.button.isHidden = false
}
else if status == .meetingEnded {
self.titleLabel.text = "The meeting ended."
self.titleLabel.textColor = dyteSharedTokenColor.textColor.onBackground.shade1000
self.button.isHidden = false
}

}

public func show(message: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,8 @@ open class DyteMoreButtonControlBar: DyteControlBarButton {

menus.append(.settings)

let chatPermission = self.meeting.localUser.permissions.chat
if chatPermission.canSendFiles || chatPermission.canSendText {
let chatCount = Shared.data.getUnreadChatCount(totalMessage: self.meeting.chat.messages.count)
menus.append(.chat(notificationMessage: chatCount > 0 ? "\(chatCount)" : ""))
}
let chatCount = Shared.data.getUnreadChatCount(totalMessage: self.meeting.chat.messages.count)
menus.append(.chat(notificationMessage: chatCount > 0 ? "\(chatCount)" : ""))

var message = ""
let pending = self.meeting.getPendingParticipantCount()
Expand Down
Loading

0 comments on commit 04cff75

Please sign in to comment.