|
@@ -144,8 +144,9 @@ class SeminarViewController: UIViewController {
|
|
|
|
|
|
lazy var raiseHandBtn: UIButton = {
|
|
|
let button = UIButton()
|
|
|
- buttonRotate.frame = CGRect(x:0, y:0, width:30, height:30)
|
|
|
+ button.frame = CGRect(x:0, y:0, width:40, height:40)
|
|
|
button.setImage(UIImage(named: "pb_raise_hand", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), for: .normal)
|
|
|
+ button.imageView?.contentMode = .scaleAspectFit
|
|
|
button.layer.cornerRadius = button.maxCornerRadius()
|
|
|
button.backgroundColor = .mainColor
|
|
|
button.addTarget(self, action: #selector(raiseHand(sender:)), for: .touchUpInside)
|
|
@@ -154,8 +155,9 @@ class SeminarViewController: UIViewController {
|
|
|
|
|
|
lazy var screenShareBtn: UIButton = {
|
|
|
let button = UIButton()
|
|
|
- buttonRotate.frame = CGRect(x:0, y:0, width:30, height:30)
|
|
|
+ button.frame = CGRect(x:0, y:0, width:40, height:40)
|
|
|
button.setImage(UIImage(named: "pb_screen_share", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), for: .normal)
|
|
|
+ button.imageView?.contentMode = .scaleAspectFit
|
|
|
button.layer.cornerRadius = button.maxCornerRadius()
|
|
|
button.backgroundColor = .mainColor
|
|
|
button.addTarget(self, action: #selector(screenShare(sender:)), for: .touchUpInside)
|
|
@@ -164,8 +166,9 @@ class SeminarViewController: UIViewController {
|
|
|
|
|
|
lazy var whiteboardBtn: UIButton = {
|
|
|
let button = UIButton()
|
|
|
- buttonRotate.frame = CGRect(x:0, y:0, width:30, height:30)
|
|
|
+ button.frame = CGRect(x:0, y:0, width:40, height:40)
|
|
|
button.setImage(UIImage(named: "pb_od_draw", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), for: .normal)
|
|
|
+ button.imageView?.contentMode = .scaleAspectFit
|
|
|
button.layer.cornerRadius = button.maxCornerRadius()
|
|
|
button.backgroundColor = .mainColor
|
|
|
button.addTarget(self, action: #selector(whiteboard(sender:)), for: .touchUpInside)
|
|
@@ -173,13 +176,14 @@ class SeminarViewController: UIViewController {
|
|
|
}()
|
|
|
|
|
|
lazy var buttonRotate: UIButton = {
|
|
|
- let buttonRotate = UIButton()
|
|
|
- buttonRotate.frame = CGRect(x:0, y:0, width:30, height:30)
|
|
|
- buttonRotate.setImage(UIImage(systemName: "arrow.triangle.2.circlepath.camera")?.withTintColor(.mainColor, renderingMode: .alwaysOriginal), for: .normal)
|
|
|
- buttonRotate.backgroundColor = .white.withAlphaComponent(0.2)
|
|
|
- buttonRotate.layer.cornerRadius = 15.0
|
|
|
- buttonRotate.addTarget(self, action: #selector(camera(sender:)), for: .touchUpInside)
|
|
|
- return buttonRotate
|
|
|
+ let button = UIButton()
|
|
|
+ button.frame = CGRect(x:0, y:0, width:40, height:40)
|
|
|
+ button.setImage(UIImage(named: "pb_ic_camera_rear", in: Bundle.resourceBundle(for: Nexilis.self), with: nil), for: .normal)
|
|
|
+ button.imageView?.contentMode = .scaleAspectFit
|
|
|
+ button.layer.cornerRadius = button.maxCornerRadius()
|
|
|
+ button.backgroundColor = .mainColor
|
|
|
+ button.addTarget(self, action: #selector(camera(sender:)), for: .touchUpInside)
|
|
|
+ return button
|
|
|
}()
|
|
|
|
|
|
// TODO: badges when raise hand to broadcaster
|
|
@@ -212,6 +216,16 @@ class SeminarViewController: UIViewController {
|
|
|
return count
|
|
|
}()
|
|
|
|
|
|
+ lazy var toolbarView : UIStackView = {
|
|
|
+ let stackView = UIStackView()
|
|
|
+ stackView.axis = .vertical
|
|
|
+ stackView.alignment = .center
|
|
|
+ stackView.distribution = .fillEqually
|
|
|
+ stackView.spacing = 10 // Adjust the spacing between buttons
|
|
|
+
|
|
|
+ return stackView
|
|
|
+ }()
|
|
|
+
|
|
|
override func viewDidLoad() {
|
|
|
super.viewDidLoad()
|
|
|
|
|
@@ -255,15 +269,17 @@ class SeminarViewController: UIViewController {
|
|
|
stack.anchor(left: view.leftAnchor, bottom: keyboardLayoutGuide.topAnchor,
|
|
|
right: view.rightAnchor, paddingLeft: 20, paddingBottom: 30, paddingRight: 20, height: 200)
|
|
|
|
|
|
+ addToolbarView()
|
|
|
+
|
|
|
stack.addSubview(tableView)
|
|
|
stack.addSubview(textView)
|
|
|
stack.addSubview(send)
|
|
|
|
|
|
- send.layer.cornerRadius = 16.5
|
|
|
+ send.layer.cornerRadius = 16
|
|
|
send.layer.masksToBounds = true
|
|
|
|
|
|
textView.anchor(left: stack.leftAnchor, bottom: stack.bottomAnchor, right: stack.rightAnchor)
|
|
|
- send.anchor(bottom: textView.bottomAnchor, right: textView.rightAnchor, paddingBottom: 2, width: 33, height: 33)
|
|
|
+ send.anchor(bottom: textView.bottomAnchor, right: textView.rightAnchor, paddingBottom: 1, width: 32, height: 32)
|
|
|
tableView.anchor(left: stack.leftAnchor, bottom: textView.topAnchor, right: stack.rightAnchor)
|
|
|
heightTableView = tableView.heightAnchor.constraint(equalToConstant: 44.0)
|
|
|
heightTableView?.isActive = true
|
|
@@ -278,7 +294,6 @@ class SeminarViewController: UIViewController {
|
|
|
|
|
|
Nexilis.shared.seminarDelegate = self
|
|
|
if isLive {
|
|
|
- navigationItem.rightBarButtonItem = UIBarButtonItem(customView: buttonRotate)
|
|
|
API.ibca(sTitle: data, nCamIdx: 1, nResIdx: 2, nVQuality: 4, tvCameraPreview: tvCameraPreviewB, ivRemoteS: ivRemoteViewS)
|
|
|
} else {
|
|
|
API.iabc(nCamIdx: 1, nResIdx: 2, nVQuality: 4, tvCameraPreview: tvCameraPreviewS, sBroadcasterID: data, ivRemoteM: ivRemoteViewM, ivRemoteS: ivRemoteViewS)
|
|
@@ -286,7 +301,49 @@ class SeminarViewController: UIViewController {
|
|
|
}
|
|
|
|
|
|
func addToolbarView(){
|
|
|
- // TODO: add buttons
|
|
|
+ if isLive {
|
|
|
+ buttonRotate.widthAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
+ buttonRotate.heightAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
+ toolbarView.insertArrangedSubview(buttonRotate, at: 0)
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ raiseHandBtn.widthAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
+ raiseHandBtn.heightAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
+ toolbarView.insertArrangedSubview(raiseHandBtn, at: 0)
|
|
|
+ }
|
|
|
+ whiteboardBtn.widthAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
+ whiteboardBtn.heightAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
+ screenShareBtn.widthAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
+ screenShareBtn.heightAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
+ toolbarView.addArrangedSubview(whiteboardBtn)
|
|
|
+ toolbarView.addArrangedSubview(screenShareBtn)
|
|
|
+
|
|
|
+ // Add the stack view to the view controller's view
|
|
|
+ view.addSubview(toolbarView)
|
|
|
+
|
|
|
+ // Set constraints for the stack view
|
|
|
+ toolbarView.translatesAutoresizingMaskIntoConstraints = false
|
|
|
+ NSLayoutConstraint.activate([
|
|
|
+ toolbarView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 10),
|
|
|
+ toolbarView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -10),
|
|
|
+ toolbarView.heightAnchor.constraint(equalToConstant: 140),
|
|
|
+ toolbarView.widthAnchor.constraint(equalToConstant: 45)
|
|
|
+ ])
|
|
|
+ }
|
|
|
+
|
|
|
+ func switchRaiseHand(){
|
|
|
+ if hasRaiseHand {
|
|
|
+ raiseHandBtn.removeFromSuperview()
|
|
|
+ buttonRotate.widthAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
+ buttonRotate.heightAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
+ toolbarView.insertArrangedSubview(buttonRotate, at: 0)
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ buttonRotate.removeFromSuperview()
|
|
|
+ raiseHandBtn.widthAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
+ raiseHandBtn.heightAnchor.constraint(equalToConstant: 40).isActive = true
|
|
|
+ toolbarView.insertArrangedSubview(raiseHandBtn, at: 0)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
func addCountViewerView() {
|
|
@@ -304,7 +361,7 @@ class SeminarViewController: UIViewController {
|
|
|
|
|
|
viewCountViewer.addSubview(countViewer)
|
|
|
countViewer.anchor(left: imageEye.rightAnchor, right:viewCountViewer.rightAnchor, paddingLeft: 5.0, paddingRight: 5.0, centerY: viewCountViewer.centerYAnchor)
|
|
|
- countViewer.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(showListViewer(selector:))))
|
|
|
+ countViewer.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(showListViewer(sender:))))
|
|
|
}
|
|
|
|
|
|
override func viewWillDisappear(_ animated: Bool) {
|
|
@@ -449,7 +506,7 @@ class SeminarViewController: UIViewController {
|
|
|
guard hasRaiseHand else {
|
|
|
return
|
|
|
}
|
|
|
- / TODO: Show list viewer
|
|
|
+ // TODO: Show list viewer
|
|
|
}
|
|
|
|
|
|
}
|