mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 23:48:29 +02:00
Merge branch 'ismail/5117_thread_message_actions' into ismail/5092_thread_list
This commit is contained in:
@@ -20,11 +20,6 @@ class ThreadViewController: RoomViewController {
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private enum Constants {
|
||||
static let sizeOniPad: CGSize = CGSize(width: 375, height: 667)
|
||||
static let additionalTopInset: CGFloat = 20
|
||||
}
|
||||
|
||||
private(set) var threadId: String!
|
||||
|
||||
class func instantiate(withThreadId threadId: String,
|
||||
@@ -49,37 +44,4 @@ class ThreadViewController: RoomViewController {
|
||||
threadTitleView.threadId = threadId
|
||||
}
|
||||
|
||||
private func topSafeAreaInset() -> CGFloat {
|
||||
guard let window = UIApplication.shared.keyWindow else {
|
||||
return Constants.additionalTopInset
|
||||
}
|
||||
|
||||
return window.safeAreaInsets.top + Constants.additionalTopInset
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: - CustomSizedPresentable
|
||||
|
||||
extension ThreadViewController: CustomSizedPresentable {
|
||||
|
||||
func customSize(withParentContainerSize containerSize: CGSize) -> CGSize {
|
||||
if UIDevice.current.isPhone {
|
||||
return CGSize(width: containerSize.width,
|
||||
height: containerSize.height - topSafeAreaInset())
|
||||
}
|
||||
return Constants.sizeOniPad
|
||||
}
|
||||
|
||||
func position(withParentContainerSize containerSize: CGSize) -> CGPoint {
|
||||
let mySize = customSize(withParentContainerSize: containerSize)
|
||||
|
||||
if UIDevice.current.isPhone {
|
||||
return CGPoint(x: 0, y: topSafeAreaInset())
|
||||
}
|
||||
|
||||
return CGPoint(x: (containerSize.width - mySize.width)/2,
|
||||
y: (containerSize.height - mySize.height)/2)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user